edsquare
|
|
Posted on: January 19, 2015, 06:59:51 pm |
|
|
Location: The throne of ringworld Joined: Apr 2014
Posts: 402
|
Taking advantage of Robert's offer: As usual let us know if you have any more problems!
What's wrong with the EGM projects? How can I save as .egm?
|
|
|
Logged
|
A child of five would understand this. Send someone to fetch a child of five. Groucho Marx
|
|
|
Goombert
|
|
Reply #1 Posted on: January 19, 2015, 07:34:14 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Yeah this is a known bug, when adding multiple constants support I temporarily broke EGM format. Basically me and Josh really aren't sure what to do at this point. Josh hates the EGM format, it saves rooms as binary blobs like the GMK format and it's barely extensible at all. What he would like is to basically rewrite the whole format with a proper spec and implement everything properly. We have a GitHub ticket filed on this: https://github.com/enigma-dev/lgmplugin/issues/29For now you can just use the old LGM if you want, though I don't think it will work with ENIGMA anymore. We really need to get this fixed ASAP but I specifically don't know what to do, I'll have to talk to Josh. http://enigma-dev.org/docs/Wiki/LateralGM:_Revisions
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
edsquare
|
|
Reply #2 Posted on: January 19, 2015, 07:43:51 pm |
|
|
Location: The throne of ringworld Joined: Apr 2014
Posts: 402
|
Yeah this is a known bug, when adding multiple constants support I temporarily broke EGM format. Basically me and Josh really aren't sure what to do at this point.
Josh hates the EGM format, it saves rooms as binary blobs like the GMK format and it's barely extensible at all. What he would like is to basically rewrite the whole format with a proper spec and implement everything properly. We have a GitHub ticket filed on this: https://github.com/enigma-dev/lgmplugin/issues/29
For now you can just use the old LGM if you want, though I don't think it will work with ENIGMA anymore. We really need to get this fixed ASAP but I specifically don't know what to do, I'll have to talk to Josh. http://enigma-dev.org/docs/Wiki/LateralGM:_Revisions
It will work with the enigma version it had, you see before reinstalling al my OS I made a backup of stuff, so I have a working LGM/ENIGMA 1.8.5 The gmx is the one that makes a folder and puts there your scripts, sprites, etc. Right? Why not take that and improve it and then use that as the new egm? Where do you set the extensions? Maybe I'll have a look see
|
|
|
Logged
|
A child of five would understand this. Send someone to fetch a child of five. Groucho Marx
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #5 Posted on: February 18, 2015, 10:59:07 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
XML is the ugliest imaginable format. It's extensible by nature, yes, but it is extremely verbose. And while its hierarchy makes storing code obvious, the problem is simple enough to work around in YAML. As for XML's propensity for hierarchical data, well, rooms are pretty linear in the scheme of things. I posted a proposal somewhere (or maybe I just started coding it and didn't finish) about what I wanted rooms to look like. Consider something like this:
name: room_0 background-color: 00C0FF backgrounds: - name: bkg_3 depth: 1000 h-repeat: yes v-repeat: no - name: bkg_overlay depth: -1000 h-repeat: no v-repeat: no views: - id: 0 # Optional for in-sequence visible: yes viewport: x: 0 y: 0 w: 640 h: 480 projection: x: 0 y: 0 w: 640 h: 480 follow: object: obj_player border: [32, 24] # Also allowed: separate lines for h/v speed: [4, 4] object-format: - id - object-index - x - y - rotation object-names: - obj_player - obj_dirtwall - obj_7 objects: [ [1000001, 0, 64, 400, 0], [1000002, 1, 0, 432, 0], [1000003, 1, 32, 432, 0], [1000004, 1, 64, 432, 0], [1000006, 1, 96, 432, 0], [1000007, 1, 128, 432, 0], [1000008, 1, 160, 432, 0], [1000009, 1, 192 432, 0], [1000012, 2, 32, 432, 45] # obj_7 is still index 2 on our list, even if its id is really 7. ] creation-codes: - ind: 0 code: | // Code begins here can_fly = false; - ind: 8 code: | // Code begins here text = "To jump, press [space].";
The "// Code begins here" bit is to prevent issues with code snippets wherein the first line is indented for whatever reason. This is important since YAML is indentation-based. XML deals with this by escaping < and >, which I also disapprove of. Comparatively speaking, the cost of YAML is cheap.
I'll also point out that the verbosity around viewport/projection can theoretically be replaced with [snip=yaml]viewport: {x: 0, y: 0, w: 640, h: 480}[/snip], although e-YAML doesn't presently support that.
|
|
« Last Edit: February 18, 2015, 11:04:53 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
|
|
|
|
edsquare
|
|
Reply #7 Posted on: February 19, 2015, 05:41:55 pm |
|
|
Location: The throne of ringworld Joined: Apr 2014
Posts: 402
|
Where in the code are the gmk, gmx, etc formats declared, created and set?
|
|
|
Logged
|
A child of five would understand this. Send someone to fetch a child of five. Groucho Marx
|
|
|
Josh @ Dreamland
|
|
Reply #8 Posted on: February 19, 2015, 09:36:04 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Even with that ugly indent scheme, the XML will be on the order of twice as large for a typical room. The only advantage of the XML is that named attributes allow you to elide attributes with default (probably zero or one) values. If this proves necessary, YAML also allows this using maps. So [snip=xml]<inst id="1000009" obj="2" x="32" y="432"/>[/snip] becomes [snip]{id: 1000009,obj: 2,x: 32,y: 432}[/snip], which is pretty meager savings, but that's still the worst-case, and large rooms will be mostly instances. The ease of parsing of (E)YAML vs XML is also a major feature. And if we're going to go toe-to-toe with full specs, XML will lose outright by YAML's superior support for primitives, node types, and even node references.
Not to mention that the best thing about YAML is that users' code appears verbatim in the format, with the exception that it is indented. I'll grant that it is unlikely for code to contain "</crc>", and unlikely for a given user to want to edit the file manually, and that together this means it's extremely unlikely that a user would want to paste in code with a closing tag, but correctly-formatted code uses HTML entities in place of reserved characters (and there are lots), so in general, a user can't open the room file and copy the code somewhere else, because [snip]if (x < xprevious)[/snip] is not valid EDL.
The comment line we would place in the YAML would be optional; it prevents cases where valid code entered in an IDE would break the format. In the 99 percent case, pasting in a well-formatted piece of code and indenting it twice will suffice, because the first line usually has the least amount of indent. The 99 percent case of the 1 percent case is where someone decided to indent their opening doc comment. They will have to either not do that, or place the opening YAML comment, which we might consider simplifying to, eg, eight or more hyphens.
|
|
|
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 #12 Posted on: November 15, 2015, 06:41:28 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
If you're interested in XML, you may as well use it for everything. And for that price, you may as well use GMX. My understanding is that the two aren't very disparate. Of course, LateralGM still (and presumably always) sucks at working with both of those formats, so it's not as though binary room data is our only fish to fry.
|
|
|
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
|
|
|
|
Goombert
|
|
Reply #14 Posted on: November 16, 2015, 09:17:13 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Harri, the reason for the extension was because it is a subset of YAML, so it's easier to implement. At least that is what Josh told me.
I'm still in favor of XML for GMX and YAML for EGM, otherwise there will be practically no difference between the formats and no advantage of one over the other. Also you should be able to add additional properties to GMX without Studio complaining about the file. Studio will only complain if you remove properties or you change the structure of existing ones. But you can and should be able to add a whole new tag, LGM will be doing this as of the next release to keep the id's in there from a GMK file for backwards compatibility. I've tested this and it seems to load fine in Studio, but if you save the file back, Studio will not save the id tags and will remove them.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|