URL to ASCII Map

General forum for game-related discussion.

Moderator: Moderators

haeggar
Supporting Member 2008
Posts: 19
Joined: Tue Jan 11, 2005 21:10 pm

URL to ASCII Map

Post by haeggar »

to avoid the tells where to find the ascii map :)

http://haeggar.techzone.at/icesus/map.php
http://haeggar.techzone.at/icesus/map_street.htm

ps: ideas how to improve the map - all to this topic pls
Last edited by haeggar on Thu Mar 16, 2006 17:37 pm, edited 3 times in total.
apog
Supporting Member 2009
Posts: 95
Joined: Sat Jan 22, 2005 02:04 am

Post by apog »

At close to 2.9MB to download, I'm guessing it's not for those with low connection speeds.

You could cut down about 840KB by changing the lines from:
<span style=“color:#XXXXXX;">
to:
<span class="XX">
where "XX" is a style specification added to your style header.

Example:

Code: Select all

<style>
div &#123;
	position&#58;absolute; 
	overflow&#58;auto;
	visibility&#58;hidden;
	border-bottom&#58; 1px solid #FFFFFF;
	border-top&#58; 1px solid #FFFFFF;
	border-left&#58; 1px solid #FFFFFF;
	border-right&#58; 1px solid #FFFFFF;
	background-color&#58; #000000;
	color&#58;#FFFFFF;
	font-family&#58;'Courier New', Courier, mono;
	font-size&#58;small;
&#125;

.g1 &#123;
	color&#58; #FFFFFF;
&#125;
</style>
<span class ="g1">gggggggggggggggggggggg</span>
It doesn't seem like much, but it does kill off about 30% of the file size.

You could also probably (not tested) cut out another 210KB by changing the span to B tags and adding "font-weight:normal" to the CSS style. I'm not sure if this would work in firefox, opera, etc, but it does work in IE.

Code: Select all

<style>
div &#123;
	position&#58;absolute; 
	overflow&#58;auto;
	visibility&#58;hidden;
	border-bottom&#58; 1px solid #FFFFFF;
	border-top&#58; 1px solid #FFFFFF;
	border-left&#58; 1px solid #FFFFFF;
	border-right&#58; 1px solid #FFFFFF;
	background-color&#58; #000000;
	color&#58;#FFFFFF;
	font-family&#58;'Courier New', Courier, mono;
	font-size&#58;small;
&#125;

.g1 &#123;
	color&#58; #FFFFFF;font-weight&#58;normal
&#125;
</style>
<b class ="g1">gggggggggggggggggggggg</b>
Again, doesn't seem like much except it's easy to implement and does kill off about 210KB (about 7% of the original file size).

On top of all of that, you could make a default color for the <span> or <b> tags for the most used color combo. So if plains have the most <span> tags created (not the most number of terrain, but the most span tags), then you could do something like the following (assumes forests have the most number of associated span tags).

Code: Select all

<style>
div &#123;
	position&#58;absolute; 
	overflow&#58;auto;
	visibility&#58;hidden;
	border-bottom&#58; 1px solid #FFFFFF;
	border-top&#58; 1px solid #FFFFFF;
	border-left&#58; 1px solid #FFFFFF;
	border-right&#58; 1px solid #FFFFFF;
	background-color&#58; #000000;
	color&#58;#FFFFFF;
	font-family&#58;'Courier New', Courier, mono;
	font-size&#58;small;
&#125;
span &#123;
	color&#58; #00FF00;
&#125;
.g1 &#123;
	color&#58; #FFFFFF;
&#125;
</style>
<span class ="g1">gggggggggggggggggggggg</span><span>eeeeeeee</span>
The amount that this reduces will be directly related to the type of terrain that has the most span tags. In the example above, because you've given the span tag the default of green, any span tag without a specific CSS class will show green. Thus saving 11 bytes multiplied by the number of span tags that are the default color. There are 79k+ span tags in the page, so if one type of terrain has 10-20k span tags then it would save an additional 110KB - 220KB.

So if all of those were done, it might be something like 1MB-1.3MB saved out of 2.9MB total.

PS. I just realized that you only really need 2 character class names for terrains like "e" and "e", but you could just use 1 character class names for "g", "p", etc. This would save yet more bytes.
haeggar
Supporting Member 2008
Posts: 19
Joined: Tue Jan 11, 2005 21:10 pm

Post by haeggar »

inspired by apogs wonderful ideas => new version:

http://haeggar.techzone.at/icesus/map.php
haeggar
Supporting Member 2008
Posts: 19
Joined: Tue Jan 11, 2005 21:10 pm

Post by haeggar »

New Version of the map :) For those who dont need the full map. its possible now to cut the world in pieces :D

parameters are: top,left,width,height

e.g.

http://haeggar.techzone.at/icesus/map.p ... &height=25

just found it funny to code that - no idea if it is of use :D

BUT you can reduce the size of the map to load.
creln
Posts: 12
Joined: Tue Apr 27, 2004 16:59 pm

Post by creln »

Didn't really think this through but using classes seemed very space inefficent way. After small talk with my personal css expert atreus we reached agreement that creating main level elements instead of these classes is the space efficient way. Example by courtesy of atreus http://arabuusimiehet.com/typo/testi.html. Some way to get rid of end tags would be nice but reading CSS specs makes my head hurt:(
haeggar
Supporting Member 2008
Posts: 19
Joined: Tue Jan 11, 2005 21:10 pm

Post by haeggar »

that example unfortunately only works with FIREFOX not with MSIE
User avatar
atreus
Supporting Member 2006
Posts: 29
Joined: Tue Mar 30, 2004 19:13 pm
Location: Hellsinki. Funland.
Contact:

Post by atreus »

haeggar wrote:that example unfortunately only works with FIREFOX not with MSIE
More like the only browser it DOESN'T work with, is MSIE (Firefox, Opera work perfectly).

Anyway, classes are the safe way of doing it since most mainstream browsers support them well enough. Defining your own elements would be the space-saving way of doing it, just requires a browser that actually works.

.atr.

Edit: Removed the unnecessary punchline and replaced with another. :)
Last edited by atreus on Tue Mar 14, 2006 12:33 pm, edited 3 times in total.
.psychedelicious.
haeggar
Supporting Member 2008
Posts: 19
Joined: Tue Jan 11, 2005 21:10 pm

Post by haeggar »

just tested it with firefox ...

i prefer firefox too, but the webserver logfile shows that > 70% of the ppl downloading the map user IE

well i could code a second version for REAL BROWSERS
apog
Supporting Member 2009
Posts: 95
Joined: Sat Jan 22, 2005 02:04 am

Post by apog »

haeggar wrote:that example unfortunately only works with FIREFOX not with MSIE
That page isn't valid HTML. So I would guess that is why it's not displayed correctly in IE. There is no DTD defined that tells the browser what those new tags do. It is not even valid XHTML (not well formed, doesn't include DTD, invalid characters strings). FireFox is making a lot of assumptions to get this to work.
apog
Supporting Member 2009
Posts: 95
Joined: Sat Jan 22, 2005 02:04 am

Post by apog »

atreus wrote:Defining your own elements would be the space-saving way of doing it, just requires a browser that actually works
Can you point to the documentation that states that creating your own elements, without fully implementing XHTML, is allowed?
User avatar
atreus
Supporting Member 2006
Posts: 29
Joined: Tue Mar 30, 2004 19:13 pm
Location: Hellsinki. Funland.
Contact:

Post by atreus »

apog wrote:
haeggar wrote:that example unfortunately only works with FIREFOX not with MSIE
That page isn't valid HTML. So I would guess that is why it's not displayed correctly in IE. There is no DTD defined that tells the browser what those new tags do. It is not even valid XHTML (not well formed, doesn't include DTD, invalid characters strings). FireFox is making a lot of assumptions to get this to work.
I know. I'm lazy when it comes to quick'n'dirty tests - it's just not worth the effort going 100% by the specification when you're just quickly testing something.

I do admit that my dislike of IE is - while not unfounded - slightly unfair.

.atr.

PS. No, I can't point you to documentation that states that creating your own elements without fully implementing XHTML is allowed, but can you point me to documentation that explicitly forbids it? Note that I'm not trying to be a smart-ass here, it's an honest question hoping for an answer - it's been a while since I had to really concentrate on knowing the specs in WWW matters.
.psychedelicious.
apog
Supporting Member 2009
Posts: 95
Joined: Sat Jan 22, 2005 02:04 am

Post by apog »

atreus wrote:No, I can't point you to documentation that states that creating your own elements without fully implementing XHTML is allowed, but can you point me to documentation that explicitly forbids it?
http://www.w3.org/Style/customdtd
etadan
Posts: 136
Joined: Mon Mar 29, 2004 10:58 am
Location: Unknown

Moo

Post by etadan »

Possibly slightly offtopic, but, anyone has any idea how to properly covert:

Code: Select all

htt*eee                        htt/eee
***ttte          into          --+ttte
tt**ttt                        tt|\ttt
tt*t***                        tt|t+--
"The mage island crossing"
haeggar
Supporting Member 2008
Posts: 19
Joined: Tue Jan 11, 2005 21:10 pm

Post by haeggar »

thats pretty hard since i convert the colorcodes from the original icesus map on iceus.org and all the roads have the same color - the only thing possible is to hardcode every position and thats a LOT of work :(
User avatar
belannaer
Wizard
Posts: 566
Joined: Sun Mar 28, 2004 15:23 pm
Location: Oulu, Finland

Post by belannaer »

How much help would it be if I provided the actual ASCII map to work with? Would it be possible to apply colouring to it easily? Although this would require me to hand over a new map when some changes are made to it. It could be freely available on the website unless it was so damn big and that would make it quite bandwidth eater :)

Drop me a tell, I might not notice answers to this topic quickly.
Post Reply