Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
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 1496 times)
0 Members and 1 Guest are viewing this topic.
Offline zingbat

Senior Member




Java games rock!


« Posted 2005-03-13 12: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 13: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 15: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!
Legends of Yore - The Casual Retro Roguelike
Offline Daire Quinlan

Junior Member





« Reply #3 - Posted 2005-03-13 16: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: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #4 - Posted 2005-03-13 19: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

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #5 - Posted 2005-03-13 19: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 19: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 20: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 21: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.

 

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

The first screenshot will be displayed as a thumbnail.

TehJavaDev (10 views)
2014-08-28 18:26:30

CopyableCougar4 (24 views)
2014-08-22 19:31:30

atombrot (37 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (29 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (27 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (33 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!