URL to ASCII Map

General forum for game-related discussion.

Moderator: Moderators

etadan
Posts: 136
Joined: Mon Mar 29, 2004 10:58 am
Location: Unknown

Moo

Post by etadan »

Well if it wasn't hard, it wouldn't be so much fun :p
Just though i'd ask if someone has figured it out.
As of hardcoded positions, it's not that hard to do(~4 locations per crossing) but it's hard to keep up to date if map changes. Might still do it one day, because atm icesus worldmap has same colours for rivers and ponds, and it can't be handled by other means
P.S. atm most of the roads look corrrectly, except crossings, because i just convert all road blocks that are surrounded by more than two road blocks into +

Code: Select all

htt/eee
-++ttte
tt++ttt
tt+t+--
PPS this of course would be quite useless if belannaer would provide ascii map. And it's not heavy, packed text takes slightly less than png map.
_____________
i'm having a bit of a fever right now, so i'm not completely sure i know what i'm writing
haeggar
Supporting Member 2008
Posts: 19
Joined: Tue Jan 11, 2005 21:10 pm

Post by haeggar »

well if i think about it its not too hard to parse through the surrounding rooms of a streetcolor-room. lets see if i can find the time to code that. :)
haeggar
Supporting Member 2008
Posts: 19
Joined: Tue Jan 11, 2005 21:10 pm

Post by haeggar »

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

its not realtime generated - needs to much resources - but ill write a cron script that updates the file once a day.

PS: needs to be optimized a bit - just a VERY QUICK and VEEEEEERY DIRTY solution - FEEL FREE ^^

Code: Select all

if ($actchar=="*")
{
	if ($map_ascii[$y-1][$x-1] == "." || 
	$map_ascii[$y-1][$x] == "." || 
	$map_ascii[$y-1][$x+1] == "." || 
	$map_ascii[$y][$x-1] == "." || 
	$map_ascii[$y][$x+1] == "." || 
	$map_ascii[$y+1][$x-1] == "." || 
	$map_ascii[$y+1][$x] == "." || 
	$map_ascii[$y+1][$x+1] == ".")
	{
		$actchar = "+";
	}
	else if ($map_ascii[$y][$x-1] == "*" && $map_ascii[$y][$x+1] == "*")
	{
		$actchar = "-";
	}
	else if ($map_ascii[$y-1][$x] == "*" && $map_ascii[$y+1][$x] == "*")
	{
		$actchar = "|";
	}
	else if ($map_ascii[$y-1][$x-1] == "*" && $map_ascii[$y+1][$x+1] == "*")
	{
		$actchar = "\\";
	}
	else if ($map_ascii[$y-1][$x+1] == "*" && $map_ascii[$y+1][$x-1] == "*")
	{
		$actchar = "/";
	}
else 
{
		$actchar = "+";
	}
}
User avatar
asventral
Supporting Member 2007
Posts: 46
Joined: Mon Mar 29, 2004 18:35 pm
Location: Brussels, Belgium

Post by asventral »

Being quite amazed with that work, i tried to do something myself (mostly for "fun").

So it started with a plain text file (copy/paste from haeggar's html file output) ... made a script to parse it and to put it room by room in my db, and then made a script to display it again.

So actually i've a huge db (about 480k records) and light script that uses about 48Mb memory to display them (not a joke, i put max mem size used by php scripts to 64Mb to get it working XD ) Fortunately i put some cache-writing script in it so if nothing changed for maximum 1 year it will use the cache file and display the result in a few seconds.

Here's the result: http://icesus.gotdns.org/showmap.php

You'd certainly think that i just copied Haeggar's idea, and you're right but... Now that i succeed in that work i'm thinking to get it better, but how ?

As each room is identifiend in my db with its X and Y coordinates ( 0,0 being the upper left corner) i can now add any information to each of them. I could also use them to display a delimited zone around one room using keywords ( ie: using 'vaerlon' would show a square of 20x20 rooms with vaerlon in its center).

Being aware of 'sharing informations' rule an others i'd like to know which kind of data could be shown without trouble (city and village names, area names, ... ? )

Would i dare to ask if there's any way to get an "uptodate" plain text file of the map ? :P

Anyway, i at least had a good time coding and finding solutions to get that working ;) .. Thank you Haeggar :D
apog
Supporting Member 2009
Posts: 95
Joined: Sat Jan 22, 2005 02:04 am

Post by apog »

I always applaud trying to work on something new to learn.

I have two, hopefully, constructive criticisms.

1.) You have actually gone backwards with regards to total file size (thus total bandwidth and time to download). If you read my posts on this topic, you can see that styles can be used to cut down about 1/2 of the file size. While I have not reviewed Haeggar's map recently, I know we spent several days brainstorming how to get everything down to a smaller size and I'm not sure there is much left to cut.

2.) Your map doesn't display correctly in IE6 (possibly 7). This might be solved by using a !doctype as the HTML code appears correct and it might be caused by the fallback to quirks mode. While someone might say "F!#$ IE", Haeggar's map works in everything and his original concept was compatibility as well as functionality.

All in all, a good first attempt, but I would start your idea off by trying to emulate Haeggar more. If you ask him, he might even give you his current code so you can take a look at it. Once you've got the smaller size and compatibility issues down, then I think it would be awesome to see your ideas put in to reality.
User avatar
asventral
Supporting Member 2007
Posts: 46
Joined: Mon Mar 29, 2004 18:35 pm
Location: Brussels, Belgium

Post by asventral »

Hmm ... heh ... you were right ... but for IE the problem was simply a missing "preformated" tag ... where Firefox see breaklines, IE see nothing ;)

I also update the code to use the same system as Haeggar using Bolt tags reformated and subclass to determine font color. Also made it works to use same subclass for terrains which use the same color, like e,E,f,F,d,F

Now my page is a bit more than 1,3Mo (2,9 previously).

Thanks for your criticisms ;)

Result still here: http://icesus.gotdns.org/showmap.php
EDIT: (OLD MAP DOESN'T WORK ANYMORE)
Last edited by asventral on Mon Jul 23, 2007 22:22 pm, edited 1 time in total.
User avatar
belannaer
Wizard
Posts: 566
Joined: Sun Mar 28, 2004 15:23 pm
Location: Oulu, Finland

Post by belannaer »

Changed this topic to sticky as it has some nice info.

Asventral: City names and area names are ok as they are anyway readily available to anyone who bothers to walk into the area and check it themself.

I can still provide the real map if needed, just ask me in game.
User avatar
moraq
Posts: 194
Joined: Sun Jun 13, 2004 18:48 pm
Location: Kemi, Finland
Contact:

Post by moraq »

I guess an able person could take advantage of the freely available Google maps API and convert it to display Icesus map. I tried to look at it but it requires quite a bit of experience in JavaScript (well, too much for me anyway).

If you feel like giving it a shot, read more about the API itself as well as instructions etc from here:
http://www.google.com/apis/maps/signup.html
User avatar
asventral
Supporting Member 2007
Posts: 46
Joined: Mon Mar 29, 2004 18:35 pm
Location: Brussels, Belgium

Post by asventral »

Thanks to Belannaer i put the real map into my database. Now you can see the result here:

http://icesus.gotdns.org/showworldmap.php (new URL)

Yes it has become a little bit heavier (+20% approximatively), but that's because now the whole map is shown.
User avatar
ruizer
Supporting Member 2009
Posts: 5
Joined: Wed Mar 31, 2004 14:25 pm
Location: Oulu, Finland

Post by ruizer »

Thanks for the map. It's really useful. However there seems to be some problems with the coloring. Some of the ponds (blue P) are colored yellow.
It's a long way to far away
User avatar
asventral
Supporting Member 2007
Posts: 46
Joined: Mon Mar 29, 2004 18:35 pm
Location: Brussels, Belgium

Post by asventral »

You are right, casted "haste" on my head and tried to do the job too fast :D

Some characters weren't well coloured ( P,*,_,...), i made sime changes to correct those mistakes and also added some more colours to be as close as possible from ingame map. Made Volvano in white as i was proposed in a mudmail but i'm not sure it would be the best coulour.

Also modified classes, so now there's one for each color, not for each terrain type. Should be a little bit less memory expensive.
(Please do not browse the base site as it won't be updated for some days, it still uses old map version).

Before introducing new features i'm trying to replace php parser with a perl one as it would be far more effective. But my knowledge in perl are very weak (a bit like my icesus character :cry: ) so it could take some days be fore i get back to the website again.

Thanks for your comments anyway :D
Last edited by asventral on Mon Jul 23, 2007 22:23 pm, edited 1 time in total.
User avatar
asventral
Supporting Member 2007
Posts: 46
Joined: Mon Mar 29, 2004 18:35 pm
Location: Brussels, Belgium

Post by asventral »

Hmm perl was finally easier than what i was thinking.

I'm now generating cached map with a perl script (quite faster, can be run as cron, ...). At the same time i managed to get rid of the blank spaces when they aren't needed (ie: end of lines).

Feel free to post any comment (positive or negative, all are welcome while they are constructive :wink: ).
User avatar
asventral
Supporting Member 2007
Posts: 46
Joined: Mon Mar 29, 2004 18:35 pm
Location: Brussels, Belgium

Post by asventral »

As the complete map seems to work quite well, i strated working on new features. I just updated the "areas" option so it will now work with the same database as the map.

You can access the "whole" site at: http://icesus.gotdns.org

Actually there are 2 features working:
- The whole Icesus map
- Area maps (i'll add some more in the next days)

Any suggestion, comment, ... are welcome :D I know the "style" of those pages sucks a lot ... but i'm no artist at all so i prefer working on fuctional things. :wink:

EDIT: Modified area section a bit so that it will now display links to areas in a list. All links have now a defined category (area, city, ...).
User avatar
minny
Posts: 58
Joined: Mon Jan 10, 2005 01:48 am
Location: No where and everywhere!

Post by minny »

*edit* i thought asventral's area maps were maps of the actual area, but i checked it out and realized it's a map of the surroundings of the area. :P And i really like the ASCII map, it makes treasure maps much easier to locate.
User avatar
asventral
Supporting Member 2007
Posts: 46
Joined: Mon Mar 29, 2004 18:35 pm
Location: Brussels, Belgium

Post by asventral »

Area maps could be possible to make, but it would be against "share information" rule ... so ... :wink:

I'm adding some kind of registration/login function actually. My hope is to create interractive content. I was thinking of a trade area where each player could announce their sales or wanted items.

I can't tell when i'll have enough time to make it real but if enough people would be interrested i could make some coding rush :P
Post Reply