XML

Started by
18 comments, last by Alpha_ProgDes 17 years, 10 months ago
Quote:Original post by Zahlman
Don't ask "What is X and how can I use it?" Ask "What things exist that can help me do Y?" Trust me, in the long run there will be much less pain.


I like this advice!

On topic: one thing XML is used for is to make it a bit more easy for games to be moddable. In civilization 4 for example, you can change all kinds of things from unit statistics to interface to the in-game text in XML. Being in text form, this makes it easier for modders to understand and use.
This article on gamedev is about that, the following snippet from it is very clear:
<invadersgame>      <level>            <!-- here's where we declare the aliens -->            <alien xpos="0" ypos="100" color="red" points="10" />            <alien xpos="100" ypos="100" color="green" points="10" />            <alien xpos="200" ypos="100" color="blue" points="10" />      </level></invadersgame>
Advertisement
Quote:Original post by Nypyren
@ ph33r: Totally agreed. I just posted that because we're in the beginner's forum ;)

[Edit ... on second thought...]

You can drastically speed up an asset pipeline by using a binary intermediate format. You just have to put experienced people on the pipeline tools (read: NOT THE INTERNS)


Ahh but thats assuming you always have tool support. What happens when the game play team makes a new data format they need read into the game. Perhaps, its a camera cutscene system they just wrote. If they left it in a binary format they would have to write the build program their self. If they left it in XML they could, for the time being until tool support is there, just edit the XML directly to get game play up and running.

This prevents a stall while waiting for tool support.

Quote:Allowing people to do a text merge of asset intermediate data is a bad idea.
I meant a custom merge program, that based on the format allows an artist to view which file he'd like to pick. If the merge program is specific to the asset type then allowing an artist to use it is ok.
I think XML is a mistake.

I mean, it's abused and ill-used tool which was made by people who didn't really know enough to do such thing and marketted it well. It's a great example about situation where little knowledge about computer science instead of knowing just how to engineer, would been help a lot to make much more capable language than what XML is.

What's bad with XML? Well, it's not generic enough, and it has very complex parsing rules, especially if we consider it has a unconvenient and ugly way to represent strings straight with five unnecessary control character.

I'd propose better language look something like this:
<invadersgame        <level "revenge of the galagans!"                tutorial="""destroy every fighter and prevent enemies breaching                            the planet barrier."""                <aliens <0 100 red>                        <100 100 green points=20>                        <200 100 blue points=5>>>>
~ person who has nothing to say feels itself naked in enviroment where nonsense is hard to camouflage into the nonexistent myriad of noises. ~
Some time in the past, there was a interesting "heated debate" between lisp and XML. A little searching and I didn't find it [sad]
Quote:Original post by Boder
Some time in the past, there was a interesting "heated debate" between lisp and XML. A little searching and I didn't find it [sad]


**This thread is so official it needs to be linkified**
One Language to rule them all

here's a link: http://www.gamedev.net/community/forums/topic.asp?topic_id=137558
there's some more give an hour... hopefully search isn't broken.

note: there's a FEW heated debates about XML and Lisp..
edit: had to link Lisp is King

Beginner in Game Development?  Read here. And read here.

 

Quote:Original post by Cheery
What's bad with XML? Well, it's not generic enough, and it has very complex parsing rules, especially if we consider it has a unconvenient and ugly way to represent strings straight with five unnecessary control character.


???

XML is very generic, and there is no need to worry about the complex (?) parsing rules because the parsing is done for you. And you don't have to "represent strings straight with five unnecessary control character" and so what if it is "ugly".

The nice things about XML are:
  • it is simple,
  • it is flexible,
  • it is powerful,
  • and it comes with a parser.


Some drawbacks are:
  • it doesn't support binary very well,
  • files can get huge and take a long time to process,
  • it might be overkill for very simple data.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
JohnBolton, yes, it'd be that for me too if lisp wouldn't exist.

But because it exists, I prefer it. Mostly because it works also as thinking and programming language. The homoiconic form gives it the power and the thing what XML has not; You are unable to think in XML or write programs with it (not considering embedded algol -style syntax some ppl seems to prefer).

Lisp is simpler than XML, that makes it more flexible and more powerful. Simpler means also that it is more generic than XML.

And as extra: parser is so simple you can write it yourself, and it can be highly optimized, that means even large chunks of information can be processed in decent time. Even better: if you have lisp enviroment under, you can use the highly optimized reader in itself, because lisp reader can be used for representing any data.

You see? You have very simple syntax in lisp!
( == opens a parenthesis.
) == closes it (somewhere this is just a special identifier).
sequence of 0-9 == number
" following " == string, this can go multi-line
other sequences of letters which aren't invalid == interned identifier.
noninvalid characters following : == keyword identifier.

Of course there's all those else macro characters, but I gues it is more for making it fun to program. You could do that with pure data as well. This is only one thing which makes lisp best.

If you need examples about it's flexibility, tell me. ;)
~ person who has nothing to say feels itself naked in enviroment where nonsense is hard to camouflage into the nonexistent myriad of noises. ~
Quote:Original post by Alpha_ProgDes
Quote:Original post by Boder
Some time in the past, there was a interesting "heated debate" between lisp and XML. A little searching and I didn't find it [sad]


**This thread is so official it needs to be linkified**
One Language to rule them all

here's a link: http://www.gamedev.net/community/forums/topic.asp?topic_id=137558
there's some more give an hour... hopefully search isn't broken.

note: there's a FEW heated debates about XML and Lisp..
edit: had to link Lisp is King


Have you managed to find the debate between Lisp and XML? I'd be interested in doing some research into it and see if it would be worth any development time.

- Dave

Quote:Original post by ph33r
Have you managed to find the debate between Lisp and XML? I'd be interested in doing some research into it and see if it would be worth any development time.

- Dave


here's something:
Code is data....

I don't know what they've been talking here before, but personally I'd prefer you to look further into Lisp. I found my virtues and enlightened in computer science; It told me where do I find my super geek from. After understanding the philosophy behind Lisp, I've been feeling like a superman with computers. I feel I can do anything I want!
~ person who has nothing to say feels itself naked in enviroment where nonsense is hard to camouflage into the nonexistent myriad of noises. ~
Quote:Original post by ph33r
Quote:Original post by Alpha_ProgDes
Quote:Original post by Boder
Some time in the past, there was a interesting "heated debate" between lisp and XML. A little searching and I didn't find it [sad]


**This thread is so official it needs to be linkified**
One Language to rule them all

here's a link: http://www.gamedev.net/community/forums/topic.asp?topic_id=137558
there's some more give an hour... hopefully search isn't broken.

note: there's a FEW heated debates about XML and Lisp..
edit: had to link Lisp is King


Have you managed to find the debate between Lisp and XML? I'd be interested in doing some research into it and see if it would be worth any development time.

- Dave

Unfortunately, my Google-Fu is still at grasshopper status. I know there's been at least 5 Lisp vs. XML threads, but I can only find those 2. [sad]

Beginner in Game Development?  Read here. And read here.

 

This topic is closed to new replies.

Advertisement