forum.webdiplomacy.net

webDip dev coordination forum / public access todo list
It is currently Mon Dec 18, 2017 5:10 am

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Seperate map generator
PostPosted: Sat Jun 28, 2008 7:21 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
The map generator should be able to get separated from the actual installation. Perhaps with the ability to use multiple different servers as map generators.

The map data would be sent through text, and the other server would then draw the map (and cache it), so

seperateserver.com/map.php?Kiel=GermanArmy&Edinborough=EnglishFleet... etc

It would need to compress the string somehow to keep it from being too long, but this would reduce a lot of load on a popular phpdiplomacy.net server


Top
 Profile  
 
PostPosted: Thu Jul 03, 2008 8:16 pm 
Offline

Joined: Sat Jun 28, 2008 4:59 pm
Posts: 17
I hate to be the bearer of bad tidings, but I don't think that there's any practical way to URL-encode both map position and center ownership in a single 256 byte string. even if you devise an encoding method for standard, you're probably shooting yourself in the foot for variant support later on.

There are a couple other ways to accomplish this, however. The easiest may be to create a mysql user with select permission on the databases relevant to drawing the maps. This means making the database accessible to outside connections and possibly creating custom views.

An idea that I am advocating heavily is to use an existing format to mail results and summaries to an archive. I'm working with someone right now on an archive that would include postal games, but something similar has been in use in the judge community for a while - http://www.floc.net/. The archive under construction will not use judge-specific terminology. For example, games are played in a "venue", which might be a 'Zine (the usual vehicle for a postal game), club (hand-adjudicated email and live games), judge, another type of server, a 'Con, or some format that does not yet exist. This archive server, or something like it specifically for the phpDip community could provide database-level access to on-going games without increasing the security challenges of individual installations.


Top
 Profile  
 
PostPosted: Thu Jul 03, 2008 8:27 pm 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
Well it could perhaps store the data needed in an XML file and the GET string would just contain a URL to the XML file.

Though someone else wrote an SVG module for the map, which would mean the XML file is the map itself (though SVG doesn't have a lot of support). Canvas is another option for drawing the map, as are Flash, JavaFX and Silverlight, there are lots of exiting web technologies out there for this sort of thing.

I'm just thinking out loud though, you're right that 256 chars really is a squeeze (I didn't know that was the limit but it sounds about right)


Top
 Profile  
 
PostPosted: Thu Jul 03, 2008 10:25 pm 
Offline

Joined: Sat Jun 28, 2008 4:59 pm
Posts: 17
Some of those technologies are too exciting. I like the XML idea. It's a nice compact standard that's fully extensible and possibly even human readable. Once the code is written in PHP, I could look at porting it to C to produce the same format using the now obsolete judge "map" command. It would be nice to make modifications to the judge to have it keep pace with the rest of the hobby changing everything else because development has slowed to a crawl on the judge.

Chris


Top
 Profile  
 
PostPosted: Mon Jul 07, 2008 1:54 pm 
Offline

Joined: Tue Jul 01, 2008 2:42 pm
Posts: 11
Location: chicago
POST would circumvent the 256 character restriction and retain the separation of concerns.


Top
 Profile  
 
PostPosted: Tue Jul 08, 2008 5:08 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
The problem is passing data via post without a form. I was thinking something like http://seperateserver.com/map.php?[Tunis=Army&... map data here], which would be linked to as an image. I don't see how you could do that with POST :(


Top
 Profile  
 
PostPosted: Tue Jul 08, 2008 5:19 pm 
Offline

Joined: Tue Jul 01, 2008 2:42 pm
Posts: 11
Location: chicago
Ahhh, I had thought once adjudication was done you'd send a post to the map generation server which would reply to you with some url or key that would allow you to construct the url to the cached copy of the image.


Top
 Profile  
 
PostPosted: Tue Sep 02, 2008 9:58 pm 
Offline

Joined: Fri Aug 29, 2008 11:58 pm
Posts: 4
If you wanted to encode the state (area ownership & unit location) into a GET string it will fit in 59 URL-legal bytes. (using 64 of the 128 ascii characters to encode the equivalent of 6 bits of information per character in the URL)

The last move history would be more difficult.
Allowing about 56 bytes for the http://, hostname, path & file name, this would allow 140ish bytes to encode this turn's moves.

Anyone fancy working this one out?


Top
 Profile  
 
PostPosted: Wed Sep 03, 2008 12:07 pm 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
Realistically I think a different way to do it would have to be found than going through GET. Even if you could use some fancy data-structure to squeeze the data in it'd just create problems down the line if/when variants are added


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group