Topic: Proposed New MapGen File Format
One of the main shortcomings of the current IC Map Generator tool is the fact that it only runs on Windows. At some point in the next few months, I'll hopefully get a chance to play around and write a similar tool in Java, which would run on any system that supports the Java VM (aka: most computers). The code for the tool would be released under the GPL and the project itself would be open to contributions from other players. I'm just doing a little brainstorming now about one aspect of the tool, namely the format for the map files.
The current IC MapGen stores its map data files as a binary blob. That's a space-efficient design (the ICPG map, for instance, is ~10 KB) but it is difficult/impossible to decipher unless you know what the bytes are supposed to represent. It's also not very extensible (if you look at the format, the last part is tacked on to allow for galaxies without an equal number of vertical and horizontal sectors), so the file format is very specific to the tool.
So, as an alternative, I propose an XML based format. It would be more verbose (and thus take up more space, although likely not exceeding 80-100 KB) but it would be more extensible and less domain-specific than a binary format. The format I've come up with so far is:
<map galaxy_id="1" galaxy_name="Milky Way">
<description>Round 8</description>
<sectors_x>2</sectors_x>
<sectors_y>2</sectors_y>
<systems_x>100</systems_x>
<systems_y>100</systems_y>
<system_url>http://www.imperialconflict.com/system.php?x=%d&y=%d</system_url>
<family_url>http://www.imperialconflict.com/myFamily.php?fam=%d</family_url>
<systems>
<system x="1" y="2" homesystem="2048" />
<system x="28" y="44" />
</systems>
</map>A key:
<map> is the container tag, it has attributes that give information about the galaxy that is represented. This would be useful if the tool wanted to change the display based on the galaxy (eg: the background of the display could be a transparent picture of the galaxy in question).
<description> is a description of what the current map is supposed to represent. In the current IC MapGen, it's used to allow users to identify the map from within the program.
<sectors_x> and <sectors_y> simply give the number of sectors in the galaxy
<systems_x> and <systems_x> simply give the x/y boundaries for coordinates.
<system_url> and <family_url> are URLs used to load external pages, either system pages or family pages.
<systems> is a container for the individual <system> tags.
<system> tags represent systems on the map. They have x and y attributes that represent the co-ordinates and an optional homesystem attribute which specifies which family's homesystem it is.
Now, I'm posting all of this because I would like feedback:
Does XML sound like a good choice? Does this file format look OK? Am I forgetting some data that the tool would need? Does some of this not make sense? ![]()
http://www.microsoft.com/windows/ie/usi … cache.mspx
Do not read this fortune under penalty of law.
Violators will be prosecuted.
(Penal Code sec. 2.3.2 (II.a.))