XML as a file-format for games dev

And this is different from a DTD or hand coded XML reading how?

Actually I 100% disagree. A well written gramer describes a LOT of code extremely compactly.

And if verbosity bothers you,a well designed app specific data language will be MUCH less verbose then eXessively Messy Languages.

YACC was mentioned for historical reasons. There are at least half a dozen Java parser generators out there.

All this is is a fixed mapping for Java object to XML. Given a fixed mapping to any other data format you could do exactly the same thing.

But that fixed mapping almost ensures that the XML form will be highly inconvenient for hand writing/editing as it isn’t beign driven by the descriptive needs of the app domain. At which point why bother with XML at all? Just serialize. Its a lot more efficient.

[quote]And this is different from a DTD or hand coded XML reading how?
[/quote]
I was quoting the use of reflective parsers. So there is no hand writing of XML reading.

[quote]All this is is a fixed mapping for Java object to XML.
[/quote]
yes [quote]At which point why bother with XML at all?
[/quote]
Becauce you can edit the XML [quote]But that fixed mapping almost ensures that the XML form will be highly inconvenient for hand writing/editing as it isn’t beign driven by the descriptive needs of the app domain.
[/quote]
No, your classnames and variables just have to be good enough to present to your user. You will have to make sure this part of your code base IS driven by the app domain. True, you can argue that this is crossing the developer-user barrier. But if it saves you development time then who cares? Your options are to either
1 write your object model with app driven names and not write a parser or
2 write your object model with arbitary names, then write a parser than converts between the two.

The first option requires you to write just a single object model. The second requires you to write an object model of exactly the same size, but also with a verbose parser that invloves alot of trival assignments.

[quote]And if verbosity bothers you,a well designed app specific data language will be MUCH less verbose then eXessively Messy Languages.
[/quote]
I am not crazy on XML. But I do like it that my java editor supports XML, and can even do intelligent code completion on my XML (yes! even without a DTD! (when I used to use intelliJ)). Your custom developed data formats cannot do that, so it more typing for you.

yes [quote]At which point why bother with XML at all?
[/quote]
Becauce you can edit the XML
[/quote]
Mostly fair enough. Though again I find the chocies auto-created formats make to be at bear minimum annopying and inconvenient. YMMV ofcourse.

I have to raise an eyebrow at the editing point. You can edit XML, but the fact of the matter is, accoridng to my brother who was on the W3C DOM comittee, XMl is specificly not designed for hand editing.

This is why it has significant whitespace, something you really want to avoid in any human written language.

Um, yeah, me too - there’s pretty much no point at all to a grammar, practically speaking, if it is NOT extremely terse. That’s what it’s there for!

I am hugely in favour of grammars - I believe that everyone who understands them will agree they are always a better solution than not having them - but my problem is that the tools for using them today generally suck so badly they are worse than nothing at all. They totally undo the advantages of the grammar itself :(.

[quote]Plus grammers in general are normally pretty verbose.
[/quote]
OK. I will retract that. I spose the only stuff I ever worked with was parsing proper languages, and those grammars are big but then they are as complex as it gets.

[quote]I believe that everyone who understands them will agree they are always a better solution than not having them
[/quote]
Normally if I find a problem that needs one, I try and change the problem. Like using BSH instead of writing my own scripting language or what have you. I just find writing grammars and stuff fiddly and time consuming, though admitadly I have only really done it 3 times in my life (C compiler, Java 1.4 and a 1.5 parser).

[quote]I have to raise an eyebrow at the editing point. You can edit XML, but the fact of the matter is, accoridng to my brother who was on the W3C DOM comittee, XMl is specificly not designed for hand editing.
[/quote]
Thats interesting. I never knew that. But we are game developers so to hell with the rules! Haha.

[quote]but my problem is that the tools for using them today generally suck so badly they are worse than nothing at all.
[/quote]
Actually I think this is the crux of the matter really. I only like using XML in my back end becuase its intergrated with my development environment and I get intelligent editing with it. Also for one of my projects the user had to configure the system, so I decided do it in XML becuase then the user can use their intelligent editor of choice with it. So it all comes down to the wealth of third party tools you get with XML (for me). In theory there is no reason why you couldn’t have similar stuff for grammars, but the tools don’t exist and its too fiddly as a result.