Josh @ Dreamland
|
 |
Posted on: January 28, 2011, 10:19:02 pm |
|
|
Prince of all Goldfish
 Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
ENIGMA needs its own format for game storage. GM takes far too long to load and store some executables; I was thinking it would be best to use a format allowing for quick addition, subtraction, and modification of contained resources.
With that in mind, and with the interests of picking a format that works well with Java, I believe our best bet is to use ZIP.
Essentially, .ogf or .egm files would be a compressed directory containing a subdirectory for each resource, which would be in its own format. I was thinking that the format could be largely eYAML; for instance, a sprite would be given a file name reflecting its ID (sprite0000.ey), and would contain a name: and file: attribute indicating, of course, the actual name of the resource and the image file it contains. This way, the format would basically document itself.
Just as easily, however, individual resources could be kept in separate binary files with their own unique formats.
As an option, a manifest file could be kept, but I think it'd be nicer if users could open and manipulate the resources in any zip-capable file browser and text editor. ZIP also reduces the likelihood for total corruption, and there are many tools around which can repair damaged zip files. Plus, since ZIP is he medium of choice for Java, it is unlikely we will encounter such an issue if we are using Java's own ZIP functions for the same purpose.
Any other settings would be stored in the trunk of the Zip, along with the game information and other important metrics.
This concludes my proposal for the egm (ENIGMA) or ogf (Open Game-) format. If you believe you have a better idea, post it here, and I'll call you a trollwe'll have a reasonable debate.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
 |
Reply #2 Posted on: January 29, 2011, 05:46:13 am |
|
|
Prince of all Goldfish
 Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Same as my plans for image formats. Each resource has a text file with the name and any other information that can be left text, and a reference to a binary file in the same directory. I don't have a problem with resources that would use only a binary file and a name simply having such info glued onto the beginning (we could standardize a format for that).
I won't defend YAML. Some of it is glued together. But it's much easier to parse than XML, and it's much easier to read and much harder to fuck up. Assuming INI is the format used in GNOME .desktop files, that is my secondary proposal.
Besides, I think that if the format is to earn the OGF extension, it should utilize a format that every language has a parser for, not just Python. So yeah, how's INI sound?
|
|
« Last Edit: January 29, 2011, 05:52:36 am by Josh @ Dreamland »
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
Rusky
|
 |
Reply #5 Posted on: January 29, 2011, 02:16:30 pm |
|
|
 Joined: Feb 2008
Posts: 954
|
YAML looks like a nicer format, but I haven't had to deal with parsing it so it may not be the best. JSON is growing in popularity and might be a better choice than YAML, depending on what you want to store.
XML has much better parser support, but it is rather verbose and doesn't make much sense unless you're actually using it as an eXtended Markup Language rather than for configuration or whatever of the billions of other misuses there are.
INI seems like an old, tired format from the 90s. Not that that's a bad thing - it makes it relatively easy to parse - but I don't know how flexible it would be.
In any case, it would be nice to allow different resources to specify their own formats. Just supply a built-in parser for YAML/JSON/XML but let resources decide how to handle things themselves. It would be interesting, I think, to have even built-in resources use the same system (if they don't already).
|
|
« Last Edit: January 29, 2011, 02:20:23 pm by Rusky »
|
Logged
|
|
|
|
Josh @ Dreamland
|
 |
Reply #6 Posted on: January 29, 2011, 04:02:40 pm |
|
|
Prince of all Goldfish
 Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
I feel the same way about XML, and I felt the same way about INI before I saw it was basically GNOME's .desktop format.
YAML is actually pretty easy to parse, but parsers do backflips and are relatively gross in concept. @Rusky I didn't consider offering multiple formats; I think we should have the specification call for it, but I personally don't want to include multiple parsers. Are you suggesting that the file should give a doctype, or that (1) the reader will be expecting the same format the writer uses and (2) an intervening human would be able to tell which format it was? I'm thinking the latter; doctypes are gross.
As for JSON, I recall that it was very similar to YAML. In fact, looking at sample JSON, it seems that YAML is just an ugly mix between Python and JSON (it uses Python's indentation grouping instead of {} like most of everything else).
So basically, XML is out of the question unless the specification is to allow flexible formats (in which case ENIGMA will =NOT= be using XML anyway), JSON is just better-known and more stable YAML and would be a practical consideration (I'll have to modify my YAML parser or strap on a standard one). INI is an older format and would require compromise on both ends. YAML makes Ism's skin crawl (the full spec makes my skin crawl) and would involve sizey compromise on either end to support fully, and eYAML is a concise implementation of YAML that makes only Ism's skin crawl but would be too specific for a general format, thus requiring formats to be optional as per Rusky's proposal.
I am, in general, all for having the text format be up to the extension. However, it seems messy to specify that there is no specified format for these text files, and messier to constrain it to four or so well-known formats without having some doctype, which are nasty. Should we settle on some means of allowing multiple formats, we still have to choose one for LGM extensions to use (I personally doubt we'll use more than one for just ENIGMA, though we should leave it open for future users to do so).
|
|
« Last Edit: January 29, 2011, 04:06:33 pm by Josh @ Dreamland. »
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
Josh @ Dreamland
|
 |
Reply #9 Posted on: January 29, 2011, 11:02:10 pm |
|
|
Prince of all Goldfish
 Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
I side with Ism on not using EDL, despite the unification it would offer. LGM is Java, and the point of ENIGMA is for game development. Put simply, we don't have the resources (read: necessary number of programmers) to allow LGM development in EDL.
If we were to design our own format and make it an official part of our spec, then I strongly believe we should cut up the YAML format and run with the bits we like. Define our own behavior for tab and space mixing (namely, treating tabs and spaces identically). I don't mind using {} for groups to eliminate all ambiguity, but I think if python could do without them, so can we. I do like JSON, except I don't think quotes around keys is necessary.
Give the format some thought. We can probably come to an agreement on the IRC.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Post made January 31, 2011, 03:36:29 am was deleted at the author's request.
|
|
freezway
|
 |
Reply #13 Posted on: February 01, 2011, 01:24:55 am |
|
|
 Joined: Dec 2009
Posts: 220
|
It must be written as a program (in SPL (yes, shakespeare) that compiles a SPL program that then takes an encrypted text file encased in a JPEG and creates a JSON file out of that... well... still better than XML.
|
|
|
Logged
|
if you drop a cat with buttered toast strapped to its back, which side lands down? joshdreamland: our languages are based on the idea that it's going to end up FUBAR /kick retep998
|
|
|
|
|