URL to ASCII Map View next topic
View previous topic
Post new topicReply to topic
Author Message
etadan


Posts: 136
Location: Unknown

View user's profile
PostPosted: Thu Mar 16, 2006 09:50 am Reply with quoteBack to top

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:
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

View user's profile
PostPosted: Thu Mar 16, 2006 12:30 pm Reply with quoteBack to top

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. Smile
haeggar
Supporting Member 2008

Posts: 19

View user's profile
PostPosted: Thu Mar 16, 2006 13:34 pm Reply with quoteBack to top

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:

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 = "+";
   }
}
asventral
Supporting Member 2007

Posts: 46
Location: Brussels, Belgium

View user's profile
PostPosted: Fri Jul 13, 2007 16:38 pm Reply with quoteBack to top

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 ? Razz

Anyway, i at least had a good time coding and finding solutions to get that working Wink .. Thank you Haeggar Very Happy
apog
Supporting Member 2009

Posts: 95

View user's profile
PostPosted: Mon Jul 16, 2007 08:55 am Reply with quoteBack to top

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.
asventral
Supporting Member 2007

Posts: 46
Location: Brussels, Belgium

View user's profile
PostPosted: Mon Jul 16, 2007 22:03 pm Reply with quoteBack to top

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

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 Wink

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 19:22 pm; edited 1 time in total
belannaer
Wizard

Posts: 566
Location: Oulu, Finland

View user's profile
PostPosted: Wed Jul 18, 2007 09:37 am Reply with quoteBack to top

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.
moraq


Posts: 194
Location: Kemi, Finland

View user's profile
PostPosted: Wed Jul 18, 2007 14:35 pm Reply with quoteBack to top

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
asventral
Supporting Member 2007

Posts: 46
Location: Brussels, Belgium

View user's profile
PostPosted: Fri Jul 20, 2007 00:26 am Reply with quoteBack to top

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.
ruizer
Supporting Member 2009

Posts: 5
Location: Oulu, Finland

View user's profile
PostPosted: Mon Jul 23, 2007 11:41 am Reply with quoteBack to top

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
asventral
Supporting Member 2007

Posts: 46
Location: Brussels, Belgium

View user's profile
PostPosted: Mon Jul 23, 2007 14:46 pm Reply with quoteBack to top

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

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.
Quote:

Result still at: http://icesus.ogtdns.org/showworldmap.php


(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 Crying or Very sad ) so it could take some days be fore i get back to the website again.

Thanks for your comments anyway Very Happy


Last edited by asventral on Mon Jul 23, 2007 19:23 pm; edited 1 time in total
asventral
Supporting Member 2007

Posts: 46
Location: Brussels, Belgium

View user's profile
PostPosted: Mon Jul 23, 2007 19:21 pm Reply with quoteBack to top

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 ).
asventral
Supporting Member 2007

Posts: 46
Location: Brussels, Belgium

View user's profile
PostPosted: Wed Jul 25, 2007 14:35 pm Reply with quoteBack to top

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 Very Happy 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, ...).
minny


Posts: 58
Location: No where and everywhere!

View user's profile
PostPosted: Thu Aug 02, 2007 03:20 am Reply with quoteBack to top

*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. Razz And i really like the ASCII map, it makes treasure maps much easier to locate.
asventral
Supporting Member 2007

Posts: 46
Location: Brussels, Belgium

View user's profile
PostPosted: Thu Aug 02, 2007 19:32 pm Reply with quoteBack to top

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 Razz
Display posts from previous:      
Post new topicReply to topic
View next topic
View previous topic

Navigation


Powered by phpBB | All times are GMT