Re: Proposed New MapGen File Format

> The XML doesn't have some place that explicitly says IC, but does it really have to? The
> URLs in the XML allow the program to work with multiple different URL schemes (or
> games). It might be useful as meta-data, but then who determines what is and isn't a valid
> value? Me?

Well, thats true. But what if game X implements something ever so slightly different -- and we
both create clients that use this format. Your client might work fine, but mine doesn't know about
the extra features of game X.

My client would attempt to structure the game using the above standard -- but it would be alot
quicker to say "This client does not support this file" or "This client does not understand the required
extensions for this games map". Then the user can proceed if they want.


Another thing you could include: The author of the map file (who created it). Its not really that
important in the grand scheme of things, but its still nice to give credit where credit is due. For example
i think i read somewhere that you (Smartys) created a mapfile for Capri. Credit should be given to
you within that file.

I guess you could fit this into the description though.




Other then these tiny little, insignificant and probably irrelevant, things i like this standard.

Morbo: Morbo can't understand his teleprompter. He forgot how you say that letter that looks like a man with a hat.
Linda: It's a 't'. It goes "tuh".
Morbo: Hello, little man. I will destroy you!!

http://www.youtube.com/watch?v=cpP7b2lUxVE

27

Re: Proposed New MapGen File Format

I agree with the Game identifier tag.

Rehabilitated IC developer

Re: Proposed New MapGen File Format

What I proposed was an editable text file of information. Not true binary, but representative text.

true binary in the 8 bit avenue has 256 bits available. No where did I propose using all 256 outcomes.

It means the simplicity of the text file would make it so easy to make a wide variety of possible map gens from a wide variety of angles. I could make a map using excel and MSWord for instance, with ease, from such a text file. Simplicity is important in an application.


If you want something complex, with maximum size savings, just say so.

Everything bad in the economy is now Obama's fault. Every job lost, all the debt, all the lost retirement funds. All Obama. Are you happy now? We all get to blame Obama!
Kemp currently not being responded to until he makes CONCISE posts.
Avogardo and Noir ignored by me for life so people know why I do not respond to them. (Informational)

Re: Proposed New MapGen File Format

I dont quite get why a binary file or a two dimensional text file would be bad. The users arent supposed to read it anyways, just the program, which can be independend from systems. And with a format as proposed by flint, it would still be readable for the users. Even better readable than an xml file, because you could get a visual representation of the map "in ASCII art". And the file size would still be very small.

Yes, you're special. Just like everyone else.

Re: Proposed New MapGen File Format

> And with a format as proposed by flint, it would still be readable for
> the users. Even better readable than an xml file, because you could get
> a visual representation of the map "in ASCII art". And the file size would
> still be very small.

No, lol. This would be giving up on speed and space, as well as giving up on
the very readable and editable XML. Basically this "ASCII art" would have the
negatives of both binary format and XML format.

As for the "visual representation" part -- thats the point of the map software.

> I dont quite get why a binary file or a two dimensional text file would be bad.

Its not.

XML is just more "standard-friendly". Its much easier for anyone with even a
little bit of experience to open an XML file and say "Hey, this does that". If you
do the same with a binary file you either need to be prepared (documentation) or
spend time trying to decrypt exactly what each piece of data does.

Morbo: Morbo can't understand his teleprompter. He forgot how you say that letter that looks like a man with a hat.
Linda: It's a 't'. It goes "tuh".
Morbo: Hello, little man. I will destroy you!!

http://www.youtube.com/watch?v=cpP7b2lUxVE

Re: Proposed New MapGen File Format

>If you
do the same with a binary file you either need to be prepared (documentation) or
spend time trying to decrypt exactly what each piece of data does.<

Not if there is simplicity as stated by me.


>I wrote a test script that generates a "worst case" XML file (one where all possible systems exist and every system is a homesystem owned by a unique family). For a 200x200 map, that meant 40,000 systems (no galaxy is ever this full of systems). This led to an uncompressed file that was ~1.75 MB. Gizpping took the file size down to ~140 KB. Other tests with less densely populated files led to similar gains. Hurrah!<

40,000 systems as proposed by me would be 7 bytes per family in total. This means I would be 280kb max size. I think that compares greatly versus your method. Additionally due to it being in a 'essentially' 4 bit equivalent in the language in the text file, you will find that compressing mine would bring it to 140kb also. In truth it would be a bit smaller, we are merely using 11 characters, and 4 bits represents 16. Winzip alone would make this <140kb. A more efficient compression algorithm would probably be able to bring this down to 110kb or so.

As stated my system would have the benefit that with a short description file built into a readme, anyone would be able to make any sort of software to translate it.

I have also got a hard time believing that the  1.75 mb file would read faster than a 280kb file even with the different formats.

Everything bad in the economy is now Obama's fault. Every job lost, all the debt, all the lost retirement funds. All Obama. Are you happy now? We all get to blame Obama!
Kemp currently not being responded to until he makes CONCISE posts.
Avogardo and Noir ignored by me for life so people know why I do not respond to them. (Informational)

Re: Proposed New MapGen File Format

skoe:

"Well, thats true. But what if game X implements something ever so slightly different -- and we both create clients that use this format. Your client might work fine, but mine doesn't know about the extra features of game X."
You're talking about unofficial extensions to the XML (eg: families can claim secondary homesystems (an actual core), or a 1 on 1 galaxy without families is being played). Assuming the minimum is implemented to begin with, any extra information contained in the file is at worst ignored. That's forward compatibility.

One reason I'm hesitant to add a game_id tag is the potential for name collisions/duplication. Is this game IC or ic or or "Imperial Conflict"? What do we do with Ectroverse, where anybody can run their server? Everyone can't have the same tag, but how do we stop duplication? And is the mapgen program really going to have to understand all of these different possible tag/attributes combinations on a per-game basis?

Do you think it makes sense to allow extending the file the same way you can for sitemaps?
http://www.sitemaps.org/protocol.php#extending
Then a particular program could decide from the new xmlns whether or not it supports the extra stuff. I'm not very familiar with XML namespaces, so I don't know exactly how that would work.


"Another thing you could include: The author of the map file (who created it). Its not really that important in the grand scheme of things, but its still nice to give credit where credit is due. For example i think i read somewhere that you (Smartys) created a mapfile for Capri. Credit should be given to you within that file."
Yes, it is. However, like I said, I envision a future where creating this file is done entirely automatically or is made to be much less of a chore than it is now. The author is really non-important in that context.

---

Flint:

"It means the simplicity of the text file would make it so easy to make a wide variety of possible map gens from a wide variety of angles. I could make a map using excel and MSWord for instance, with ease, from such a text file. Simplicity is important in an application."
And what happens when I decide to add a new attribute to systems, to mark them as uninhabitable (one possible game-specific extension). How would your format cope with that? I'm still not sure how your format copes with homesystems, or how it stores other galaxy meta-data (eg: number of systems, number of sectors).

XML is never going to win on the basis of size or parsing speed. However, where it excels is readability and extensibility. Your format would definitely result in a smaller file, especially compressed. Also, as skoe pointed out, XML parsing requires parsing the entire document first and then inferring meaning, whereas with a binary file format you always know where you are (unless someone followed the spec wrong tongue). However, parsing has to be done once, when the file is opened. It doesn't need to be done 100x per second. And, unless I'm mistaken, I can't just add random attributes to systems in your format and still have my file work. wink

Also, saying that you don't need documentation to understand your file is disingenuous. It may seem that way to you because you came up with the format, but someone opening up the file would have very little idea what the format is without documentation of some kind. For instance: who's to say the 0s aren't systems, since 0 is associated with success for executables in Linux? At best, trial and error would be needed if there were documentation (it took me a lot of work to get the current map file format right, even though I had a well documented generator to base my code off of). XML, on the other hand, is largely self-documenting. There will be an xmlns file at some point which provides explicit documentation, but the tag names themselves carry a lot of meaning. People can understand what editing certain attributes, removing certain tags, etc does.

---

Arachnophobia

"I dont quite get why a binary file or a two dimensional text file would be bad. The users arent supposed to read it anyways, just the program, which can be independend from systems. And with a format as proposed by flint, it would still be readable for the users. Even better readable than an xml file, because you could get a visual representation of the map "in ASCII art". And the file size would still be very small."
Extensibility is, I would say, the biggest advantage of XML. If a new feature is added to a game (I've mentioned a few examples earlier in the post), new tags or attributes can easily be added to deal with them. Not so with a binary format.
Size isn't really a factor, since the worst case XML is unrealistic and still compresses very nicely.

CLEAR YOUR CACHE!
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.))

Re: Proposed New MapGen File Format

I did say some minor documentation

If I opened my file, and I deleted a character, and inserted 7 more, I could add a home system just like that. It's that easy.

Yes I admit that it may take a few tries to place it in the correct system without a 'generator' program, but honestly it could be done.

Honestly if you have a different file for each 'addition' you can easily handle it with a binary format.



My file would look, for instance in a 4x4 map with 5 systems, 2 homes:

04'01'0031005'02'0002010

This would look like this when put up

-   01  -  -
o   o   -  -
02 -   -  -
-   -   o  -

It clearly and easily allows for a map to be made, for families of variable fam # lenght (if desired) it is self tracking, and has issues with someone who can read a guide first.

It has 0 for no planet, 1 for a planet, a 2 for next row no planet, a 3 for next row planet, a 4 for home system, 5 for home system next row. You could then use a 6 to stand for 'end of map' if you want.

Or you can use the 1-9 system as stated. Either way works, and works pretty well.

Everything bad in the economy is now Obama's fault. Every job lost, all the debt, all the lost retirement funds. All Obama. Are you happy now? We all get to blame Obama!
Kemp currently not being responded to until he makes CONCISE posts.
Avogardo and Noir ignored by me for life so people know why I do not respond to them. (Informational)

Re: Proposed New MapGen File Format

Lets compare the two formats:
- Size: XML is larger than the binary format, even when both are compressed. However, we're not talking about GB: we're talking about < 100 KB in most cases.
- Readability: XML is largely self-documenting, your format can be understood if some minimal documentation is provided.
- Parsing speed: XML is slower to parse than the data in a corresponding binary format. However, while the magnitude of the difference is unknown, my assumption is that it wouldn't be long enough to dissuade anyone from using the XML. Also, a mapfile is only parsed when it's loaded: all this does is slow down the application start time a little bit.
- Extensibility: XML wins, hands down. And this, I would say, is one of the more important features of the mapfile

Am I missing something?

CLEAR YOUR CACHE!
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.))

Re: Proposed New MapGen File Format

It's Flint you're talking to Smartys. You might as well just hold a mirror up and he'd keep himself entertained for days. If not weeks

tongue

2011 IC League Fantasy Football Champion
2012 IC League Fantasy Football Runner Up
2013 IC League Fantasy Football Champion

http://www.ic-wiki.com/index.php?title=Gondor

Re: Proposed New MapGen File Format

How important is extensibility? Honestly.

Ease of understanding would have allowed me to create the current ICPG map myself if it was made in a format as I propose.

Everything bad in the economy is now Obama's fault. Every job lost, all the debt, all the lost retirement funds. All Obama. Are you happy now? We all get to blame Obama!
Kemp currently not being responded to until he makes CONCISE posts.
Avogardo and Noir ignored by me for life so people know why I do not respond to them. (Informational)

Re: Proposed New MapGen File Format

"How important is extensibility? Honestly."
This has already been covered in previous posts. It is very important.

"Ease of understanding would have allowed me to create the current ICPG map myself if it was made in a format as I propose."
XML has ease of understanding. It's much easier to understand an XML document by itself than a file filled with numbers and single quotes by itself.

CLEAR YOUR CACHE!
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.))

Re: Proposed New MapGen File Format

My concept would be:

The file would start with the galaxy name, width, length, sectors. Now the map begins and you can number all of the bits (or the program does to calculate the family positions). Every bit can be either 0 - no system, or 1 - yes system. After that, you can put family numbers with the corresponding number for placement when you count through the bits. That way you get to represent the whole map plus family positions.

Extensability
If there ever will be more properties for a system than it is existing (1 in the bit) or it being a home system (in the family table), you can just add more tables to the file, right where the family placement was noted.

Size
Should be pretty small no?

Accessability
Shouldnt be hard to understand. And all the "creep data bits" are generated by the computer anyways.

Yes, you're special. Just like everyone else.

Re: Proposed New MapGen File Format

Could you write out an example file? I'm not sure I understand how you would lay out the family data or any other data.

CLEAR YOUR CACHE!
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.))

Re: Proposed New MapGen File Format

In any case, even though I can't write out the file I think I understand what you're going for. What you're describing is very similar to the current format used. In fact, it's almost identical. wink

I don't think the format is as easy to understand as you assume it is. You would definitely need some kind of external reference spec to tell you what each "table" means, as well as what the values mean.

There's also a flaw with your extensibility argument. If I add another "table", the program has to know what the next "table" it's reading is. With ICMapGen, the last element of the file is the vertical sector count, which wasn't included in the original format but was tagged on so it could be used in later versions of the program. If you allow arbitrary extensibility, you need some way (an ordered header of identifiers perhaps?) to indicate what the tables are so the program can derive some meaning from them. I'm going to assume the issue of skipping unknown data is moot, since you can easily include a special character to indicate the end of a "table".

Having to add a whole new table is also a lot less flexible than just adding an attribute to some systems or a new element or two.

CLEAR YOUR CACHE!
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.))

Re: Proposed New MapGen File Format

meh. I know nothing of xml.

This is why I proposed my format. Can I take the xml data, use word to insert tabs between blanks and star systems, then export to excel?

Everything bad in the economy is now Obama's fault. Every job lost, all the debt, all the lost retirement funds. All Obama. Are you happy now? We all get to blame Obama!
Kemp currently not being responded to until he makes CONCISE posts.
Avogardo and Noir ignored by me for life so people know why I do not respond to them. (Informational)

Re: Proposed New MapGen File Format

No. But the average user is not going to be doing that, they're going to be using tools that use the data. And the ones that will want to manipulate the data will find that they can do much more with it as an XML document. wink

CLEAR YOUR CACHE!
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.))

43

Re: Proposed New MapGen File Format

>Ease of understanding would have allowed me to create the current ICPG map myself if it was made in a format as I propose.

The problem is only YOU would know how to make the map format. If someone else came along and wanted to make a program that used the map file format, when they opened up a binary file they would just see seemingly random bytes of data. That's what I saw when I made my graphical family news analyzer and is what made me avoid using the current mapgen format for it.

>How important is extensibility? Honestly.
It's ridiculously important. Say a new feature requires piece of data per system and is added to the mapfile. Programs using your map file would have to be recompiled to parse the file differently without error. With XML, a new tag is represented. Since the program doing the parsing is looking for specific tags rather then data in specific positions, extraneous tags would be ignored and older programs could still read the newer extended format.

>This is why I proposed my format. Can I take the xml data, use word to insert tabs between blanks and star systems, then export to excel?

1. I don't know what you're saying you want to try to do
2. Can you do that with the current mapgen format?  You're proposed format is is identical to the one we already have.

Rehabilitated IC developer

Re: Proposed New MapGen File Format

Not a binary file. I will pay you $100000000 dollars if it is actually a binary file. I proposed a text file with plain text characters. Anyone who read a readme could easily understand it.


Now apologize for calling it undecipherable and all that X(

Everything bad in the economy is now Obama's fault. Every job lost, all the debt, all the lost retirement funds. All Obama. Are you happy now? We all get to blame Obama!
Kemp currently not being responded to until he makes CONCISE posts.
Avogardo and Noir ignored by me for life so people know why I do not respond to them. (Informational)

Re: Proposed New MapGen File Format

> Now apologize for calling it undecipherable and all that

It IS absurd.

To compress this file you would need to use some sort of huffman code, which would require it to
be in binary. You could get some ultra-cool compression, but whats the point? Ease of use is much
more important.

> Can I take the xml data, use word to insert tabs between blanks and star systems, then export to excel?

Tabs? Why on earth would you want to do that?

You can import XML data into word and excel yes -- using vba. It would be MUCH MORE friendly to do
then to try and parse each individual character yourself.

> Not a binary file.

The major downfall of your "format" is that if there is one wrong character, the entire thing falls down. With
XML if i accidentally screw up one character, either the data itself is invalid (I.e. wrong), or the XML structure
is wrong. The latter case will bring up an error in your XML parser telling you exactly where (line, ch) you
stuffed up.

Morbo: Morbo can't understand his teleprompter. He forgot how you say that letter that looks like a man with a hat.
Linda: It's a 't'. It goes "tuh".
Morbo: Hello, little man. I will destroy you!!

http://www.youtube.com/watch?v=cpP7b2lUxVE

Re: Proposed New MapGen File Format

> One reason I'm hesitant to add a game_id tag is the potential for name collisions/duplication. Is
> this game IC or ic or or "Imperial Conflict"? What do we do with Ectroverse, where anybody can
> run their server? Everyone can't have the same tag, but how do we stop duplication?

See the second part. You don't support "websites", you support "games".

> And is the mapgen program really going to have to understand all of these different possible
> tag/attributes combinations on a per-game basis?

No, you understand a particular games special extensions. If you do not understand the specific
extensions you alert the user "OY YOU, DONT SUPPORT, K?". The user can then exit your program
or accept that certain features are unavailable and proceed anyway.

In terms of "games":
For example IC might be open-sourced one day. If both of us have IC, and make modifications,
then we can't really call it IC anymore can we? But if only one of us makes modifications, then the
one who hasn't can still call his game "IC".



Also this standard needs a way of identifying itself. E.g Is this standard 1.1 or 1.2? Or maybe we use
an incrementing character? (A, B, C).

Morbo: Morbo can't understand his teleprompter. He forgot how you say that letter that looks like a man with a hat.
Linda: It's a 't'. It goes "tuh".
Morbo: Hello, little man. I will destroy you!!

http://www.youtube.com/watch?v=cpP7b2lUxVE

Re: Proposed New MapGen File Format

skoe: I'm not sure I understand what you mean.
Lets say there are three games, A, B, and C. A supports feature 1, B supports feature 2, and C supports feature 1 and feature 2. Is each program supposed to be aware of the features that games A/B/C support?

As for versioning, that would be taken care of by a main xmlns. A new version means a new xmlns.

Keep in mind that I have very little experience with XML namespaces. I need to do some research/testing to clarify some of this.

CLEAR YOUR CACHE!
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.))

48 (edited by Smartys 15-May-2009 00:41:43)

Re: Proposed New MapGen File Format

OK, so given a slightly enhanced understanding of XML namespaces, here's how I would tackle this problem of multiple featuresets:

Game A has a namespace URI of http://example.com/a/1.1/
Game B has a namespace URI of http://example.com/b/1.2/
Game C has a namespace URI of http://example.com/c/1.0/
There is some default namespace URI, http://example.com/1.6/
(keep in mind that these are made up URIs).

A program has a static list of what namespace URIs it understands. If it encounters an element with a namespace that it does not understand, it prompts the user. Otherwise, it handles that element based on its understanding of the namespace. This allows games to mix/match features (or, to have separate namespaces for each feature). These namespaces are reusable by other games, so if I develop an IC-like game I can use IC's namespace URI (and include additional namespaces for new features if I so desire).

Note: namespaces have nothing to do with validation. They essentially just give a prefix to the element names so they don't conflict with one another.

Anyway, the advantage of this over a game_id element is that namespaces are reusable and game IDs are not. Instead of having a different set of parsing logic for each game, you have additional parsing logic for each namespace and call the parsing logic that you need.

Does that make sense to anyone other than me? Should I write up a demo XML file?

CLEAR YOUR CACHE!
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.))

Re: Proposed New MapGen File Format

> Does that make sense to anyone other than me? Should I write up a demo XML file?

What if each game uses different lingo? I.e. terminology that differs? Family might be
called something else. Having a way to identify 'games' would be beneficial.

Namespaces should be used for future revisions (1.0, 1.1, 1.2). Though i don't exactly see
how much the map file can change...

Morbo: Morbo can't understand his teleprompter. He forgot how you say that letter that looks like a man with a hat.
Linda: It's a 't'. It goes "tuh".
Morbo: Hello, little man. I will destroy you!!

http://www.youtube.com/watch?v=cpP7b2lUxVE

Re: Proposed New MapGen File Format

Skoe your wrong. With 11 total characters, an error would not cause it all to fall down... an ignore anything but those 11 characters function can easily be written.



Why are you saying the most incorrect things?


Is this some Flint hating that is happening?

Everything bad in the economy is now Obama's fault. Every job lost, all the debt, all the lost retirement funds. All Obama. Are you happy now? We all get to blame Obama!
Kemp currently not being responded to until he makes CONCISE posts.
Avogardo and Noir ignored by me for life so people know why I do not respond to them. (Informational)