Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Using xml for games  (Read 1271 times)
0 Members and 1 Guest are viewing this topic.
Offline zingbat

Senior Member




Java games rock!


« Posted 2005-03-13 13:59:14 »

So how worth is using xml for game data ?
Offline Vorax

Senior Member


Projects: 1


System shutting down in 5..4..3...


« Reply #1 - Posted 2005-03-13 14:08:43 »

I would say it would be pretty good for many things such as level data and entity data.  Both of which can be read prior to starting the game/level.  So performance won't be an issue.

The nice thing about using XML would be having all the parsing API's done.  One less thing to code.

Offline woogley
« Reply #2 - Posted 2005-03-13 16:51:32 »

XML is good for level data - clear organization, and most browsers color-code and outline XML pages, so readability is a plus.

however, on the negative side, XML levels will be significantly larger in bytes than a custom file format or something. So if you're not worried about size or users trying to edit your levels, XML is the way to go.

Vorax is definitely right about the parsing thing- that's a big roadblock that's already cleared for you Cheesy
Games published by our own members! Check 'em out!
Try the Free Demo of Revenge of the Titans
Offline Daire Quinlan

Junior Member





« Reply #3 - Posted 2005-03-13 17:39:07 »

I just started using XML the other day to specify object setups and animation ranges and so on for my objects. I started writing my own parser for the data then threw my hands up into the air and converted it all over to XML instead. Takes the gruntwork out :-)

I'm just using the Javax DOM implementations which I suspect is a bit heavyweight for what I'm using it for. Anyone using any Lightweight XML libs they'd recommend ?

D.
Offline CaptainJester

JGO Knight


Medals: 10
Projects: 2


Make it work; make it better.


« Reply #4 - Posted 2005-03-13 20:04:34 »

Quote
XML is good for level data - clear organization, and most browsers color-code and outline XML pages, so readability is a plus.

however, on the negative side, XML levels will be significantly larger in bytes than a custom file format or something. So if you're not worried about size or users trying to edit your levels, XML is the way to go.

Vorax is definitely right about the parsing thing- that's a big roadblock that's already cleared for you Cheesy

That's not a problem.  You can just compress the XML file.  Or compress your distributino jar.

Offline kevglass
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #5 - Posted 2005-03-13 20:10:49 »

This was also discuessed here:

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=GameDesign;action=display;num=1102608981

Might have been better placed in that forum also.

Quote

So how worth is using xml for game data ?


Depends on the game data and the game. XML is a tool, you choose whether its applicable to your task.

Kev

Offline zingbat

Senior Member




Java games rock!


« Reply #6 - Posted 2005-03-13 20:48:21 »

Quote

I'm just using the Javax DOM implementations which I suspect is a bit heavyweight for what I'm using it for. Anyone using any Lightweight XML libs they'd recommend ?

D.


There are JDOM and Xerces but since i never made a game using XML data i don't how much is parsing speed a problem in a game application context. Ziping the data will solve the size problem.

There are other alternatives like using JAXB to marshal objects directly from xml files. Don't know anything about how eficient this is.

What i really would like to know is, from the experience of guys who already used this in a functional game, what are the bottlenecks and where they are most critical when using xml and with what tools.

For example a rough estimate of the order of magnitude of difference between the startup time of a game using binary files (for game databases) and the same game using the java xml to load that data in a xml format. Would it be about 2 times, 10 times, 100 times ?
Offline Daire Quinlan

Junior Member





« Reply #7 - Posted 2005-03-13 21:31:08 »

well, I only use XML quite sparingly. Firstly for configuration files that are parsed on game start and maybe written to once or twice if the user changes any options. Secondly for Object definition files. My object data is a large binary, MD2 style keyframed animation, then the XML file just contains information such as the filename of the binary data, what shader class used to texture the object, What animation sequences (if any) there are in the file etc etc. Loaded up when the object is first requested and then all the objects are cached and instances used for rendering, so obviously any performance hit I'd get would be negligble, and more than offset by the convenience factor.

D.
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #8 - Posted 2005-03-13 22:24:13 »

I use XML to store Odejava physics data - http://tanksoftware.com/xode/

Nice and easy to read, easy to parse too.

Will.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (71 views)
2013-05-17 21:29:12

alaslipknot (82 views)
2013-05-16 21:24:48

gouessej (112 views)
2013-05-16 00:53:38

gouessej (107 views)
2013-05-16 00:17:58

theagentd (118 views)
2013-05-15 15:01:13

theagentd (107 views)
2013-05-15 15:00:54

StreetDoggy (151 views)
2013-05-14 15:56:26

kutucuk (175 views)
2013-05-12 17:10:36

kutucuk (172 views)
2013-05-12 15:36:09

UnluckyDevil (181 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.11 seconds with 20 queries.