![]() |
|
Using XML for level design |
Goalie Ca
Member #2,579
July 2002
![]() |
I was wondering if anyone has used XML for level and character design and such and if it would be a good idea or a waste of time. It seems there are a lot of xml parsers out there and it would save a lot of time trying to load stuff into structures. Edit: As for xml parsers, expat (c-language) is opensource and said to be very fast. Are there any better ones. ------------- |
Matthew Leverton
Supreme Loser
January 1999
![]() |
A waste of time. XML is meant for multiple programs to share abstract data. It does have some good uses, but I think they are limited... Why do you think "loading stuff" into structures is hard? How would XML make that any easier? XML is not meant to be hand-edited, so it doesn't gain any points there. |
X-G
Member #856
December 2000
![]() |
Doesn't Crystal Space use XML for its map format? -- |
Goalie Ca
Member #2,579
July 2002
![]() |
Well, i was thinking that it may be usefull for a describing maps and characters in an rpg as well as a save game file. I know its more human readeable and easier for me edit. I also thought something like this might be nice.
<level id='1'> <character level='7' name="King Ryan"> <treasures> ogre_gloves sun_talisman </treasures> <coordinate x='1' y='1' z='1'/> <bitmap>img.png</bitmap> <lives amount='5'/> </character> <treasure name="moon_talisman"> <properties> <bitmap>img.png</bitmap> <lifetime>1000</lifetime> <coordinate x='1' y='1' z='1'/> </properties> </treasure> </level> ------------- |
X-G
Member #856
December 2000
![]() |
What's wrong with this? <treasure name="moon_talisman" bitmap="img.png" lifetime=1000 x='1' y='1' z='1'/>
-- |
Matthew Leverton
Supreme Loser
January 1999
![]() |
Or this: "moon_talisman","img.png",1000,1,1,1 |
mEmO
Member #1,124
March 2001
![]() |
That saves a bit of disk space, but the xml version is by far the most readable one (IMO, though) [edit] --------------------------------------------- |
spellcaster
Member #1,493
September 2001
![]() |
Quote: <treasure name="moon_talisman" bitmap="img.png" lifetime=1000 x='1' y='1' z='1'/> From an XML point of view, that's harder to extend. -- |
X-G
Member #856
December 2000
![]() |
How so? -- |
Goalie Ca
Member #2,579
July 2002
![]() |
XML seems like a bit of overkill but the situation below seems to make it easier to read data in. I'd have to use some sort of delimeter anyways. Also, if i have a map I'll have the tilemap as a seperate file. I'd probably end up placing the items by hand, probably won't be too many. Maybe 20 per level. I don't feel like making a world editor to do that stuff and i don't know any better way to go about it. <treasures> ogre_gloves sun_talisman discovere_item n discovered_item_n_1 discovered_item_n_2 </treasures> <bitmaps>maybe list of these as well</bitmaps>
------------- |
Paul Pridham
Member #250
April 2000
![]() |
What's wrong with the handy dandy built-in Allegro configuration file functions? More readable than XML gunk. ---- |
|