|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic Page: 1 2 »» |
Last Thread Next Thread ![]() |
| XML in Games |
|
![]() superpig GDNet Technical Lead Member since: 5/26/2001 From: Oxford, United Kingdom |
||||
|
|
||||
| Phew, I wrote this a while ago! A couple of people have emailed me already: Jonas Eichhorst has pointed out a typo - I left off a quotation mark in the description of my fridge, in the tupperware-box node. Thanks Keith McAfee asks why I talk about writing my own parser, rather than using one of the established parsing libraries (such as expat). Erk. Let's just say I wrote this back in the days when I was naieve and uneducated, and had little knowledge of the pre-established parsers. I'll still write a second article though, sometime - demonstrating how to use a DOM with an XML document; reading using a parser (probably expat - Xerces-C is a little big) and writing out using DOM classes directly. Superpig - saving pigs from untimely fates, and when he's not doing that, runs The Binary Refinery. |
||||
|
||||
![]() Buster Member since: 4/26/2000 From: USA |
||||
|
|
||||
| I have to admit, after reading the first six words of this article: "The foundation of the Internet, HTML..." I just had to stop. HTML the FOUNDATION of the Internet? LOL!! There's just no possible way you know anything of value, so I'm sorry, I can't continue reading this trash. |
||||
|
||||
![]() Turt99 Member since: 5/14/2002 From: Brampton, Canada |
||||
|
|
||||
quote: This is a very odd statement to me, I mean HTML isn't the greatest thing in the world but I can't really think of anything that has a stronger presents in the internet. Yes there is PHP, ASP, JSP, and others but they all use HTML to do the basic formatting.. Anyways I quickly skimmed through the article and I was hoping for a little more, but thats because I was already planning to use XML in my current project.. maybe your next article will be more usefull to me.. It great to see people taking there own time to write these articles Please visit Turt99 Productions |
||||
|
||||
![]() alchemar Member since: 4/10/2001 From: CA, USA |
||||
|
|
||||
| I liked the article, I am also using XML in my game. I also wrote my own class instead of using Expat, TinyXML or Xerces. One of the reasons I did that was I did not want to get into DTD docs. Another reason I wrote my own is that I intend to also be able to save my XML to binary files for the finished program. |
||||
|
||||
![]() Big B Member since: 6/21/2000 From: Ottawa, Canada |
||||
|
|
||||
| My $.02. In the introduction, you don't actually say what XML is or does, just what you have without it. I would have said something like: "Simply put, XML is meta-data. That is, data that describes other data." and something like "XML structures your data." Next point is that "item"s in XML are called "elements", not "nodes" (in a DOM tree, they are "element nodes", but the tutorial isn't there yet). Its probably good that you didn't go over DTDs, but they should be covered somewhere in the series. Otherwise a pretty good tutorial. superpig, you think you could email me the next tutorial before it gets published. I've written my own XML parser (it read SGML too) and have been working with marked up data for a while now. I think my expertise could be of some help. PS - HTML is actually an SGML application, not its own markup language. [edited by - Big B on April 21, 2003 1:05:15 PM] |
||||
|
||||
![]() rypyr Member since: 2/24/2003 From: Chicago, IL, United States |
||||
|
|
||||
quote: There is a big difference between the internet and the world wide web. The WWW is only one application of the vast internet. I am sure the author of the article meant to say "The foundation of the WWW, HTML...". Regards, Jeff Edit: Removed the extra quote tags... [edited by - rypyr on April 21, 2003 1:25:45 PM] |
||||
|
||||
![]() superpig GDNet Technical Lead Member since: 5/26/2001 From: Oxford, United Kingdom |
||||
|
|
||||
| Yes, rypyr, you're exactly right. Thank you. Big B: I'll just draw attention to the part at the end where it says 'I wonder why I write all my articles at 2:30am...' I'll do a quick rewrite of this soon to correct some of the most simple terminology errors and typos (because I have a feeling that's what people are going to be emailing me the most about). Superpig - saving pigs from untimely fates, and when he's not doing that, runs The Binary Refinery. |
||||
|
||||
![]() VietCoder Member since: 1/17/2003 From: France |
||||
|
|
||||
| Hi, Hey hey !! don't be so Hard guys !! I red your article at 1:30am and like it. It's true, that's it's a little empty...you give severals examples but not enough explanations, in fact i find you don't go far enough in the subject. Anyway it's very interesting (i guess i'll try to code a simple parser...) waiting for the next one... ++ VietCoder |
||||
|
||||
![]() tuxx Member since: 10/6/2001 From: Milwaukee, USA |
||||
|
|
||||
I have to point out something about your style. You seem to use attributes a lot, and while that's ok, I don't think that that is the best way to do it. Oftenly attributes are used not to describe data, but to provide the parser with information about that tag. In XML it is generally recommended to use child elements instead of attributes where possible.quote: quote: I don't think it really matters much, I just felt that I should point it out. |
||||
|
||||
![]() superpig GDNet Technical Lead Member since: 5/26/2001 From: Oxford, United Kingdom |
||||
|
|
||||
| tuxx, As you may have guessed from my mixing up of the words 'node' and 'element,' I'm somewhat used to using XML in DOM form. As such, each element is treated as a single object, with child elements as child objects. I'm more comfortable with the idea of an object having it's own properties (read: attributes) than having those properties stored as child objects. So yes, it is a style thing; but yes, it doesn't really matter. Just to let you people know, the rewrite is now almost complete, and will be emailed to Dave before the night is over. Superpig - saving pigs from untimely fates, and when he's not doing that, runs The Binary Refinery. |
||||
|
||||
![]() JasonA Member since: 11/2/2001 From: Los Angeles, CA, United States |
||||
|
|
||||
| Another great article, superpig! I can't wait for the next editions of your articles (Engine from ground up, and this XML article)!!! Thanks for your dedication, Jason |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| Fairly good article, that adventure game example set off a small mental explosision about scripting/configuration using xml and introspection in C#. Good stuff |
||||
|
||||
![]() superpig GDNet Technical Lead Member since: 5/26/2001 From: Oxford, United Kingdom |
||||
|
|
||||
| Updated, with numerous small fixes (thanks Dave, and everyone who's emailed me to point out how stupid I am). Superpig - saving pigs from untimely fates, and when he's not doing that, runs The Binary Refinery. |
||||
|
||||
![]() ALH Member since: 8/22/1999 From: Sao Paulo, SP, Brazil |
||||
|
|
||||
| I liked your article a lot, it is a great idea using XML in games and your examples are fitting also, but I harshly object in using it on multiplayer games, as stated in this article: "Surely, in the days of object-orientation and massively-multiplayer online games, there must be a better way? I think XML can fill part of the gap." That would certainly eat up a lot of bandwidth and some unecessary processing power; Resources wich are to be preserved in your grasps in game developing. Maybe its interesting in some other types of online applications, but I wouldnt agree on online gaming. |
||||
|
||||
![]() Illumini Member since: 10/13/2002 From: California, USA |
||||
|
|
||||
| Actaully I think it would be very useful for developing purposeat the least. I haven't messed with any of the parsers but I assume they are fairly easy to use. If so it would provide a quick easy way to maintain data during development. And it could be easily replaced once large scale testing is required with a simlar but compiled binary form of the data. |
||||
|
||||
![]() superpig GDNet Technical Lead Member since: 5/26/2001 From: Oxford, United Kingdom |
||||
|
|
||||
quote: Oh, heh... I wasn't suggesting XML should be applied to multiplayer games - I was being rhetorical, and trying to give some impression of the game industry having come a long way, and now achieving technically impressive things. My bad, I guess that's not totally clear. It would eat up bandwidth and processing power, yes, but only when used in realtime. If it's being sent straight between the client and server *anyway*, then you lose some of the benefit of XML - such as the fact that it's human-readable. However, I would not say that 'because it's a multiplayer game, XML cannot be used.' There are still plenty of opportunities to use it - a very large part of a multiplayer game is held in common with a non-multiplayer game. I can also think of one further interesting application - format negotiation. If one server is used by a suite of MMO games, and each game requires different types of data from the server, then XML could be used to describe to the server the format of data that the client is expecting. Just an idea. Superpig - saving pigs from untimely fates, and when he's not doing that, runs The Binary Refinery. |
||||
|
||||
![]() jofferman Member since: 8/5/2002 From: The Netherlands |
||||
|
|
||||
| While I like the idea of using XML in games, I don't think XML is a very practical solution for saving/loading games or asset management (as suggested in the article), unless your game worlds are very small. A typical 3D level, for example, contains thousands of elements (boxes, doors, buildings, aliens, etc.) which, when stored as XML, are going to take up a *lot* of harddisk space. Loading the level (by parsing the XML file) is probably going to take forever... and a 5 MB XML file isn't really human-readable anymore. There's plenty of practical uses for XML though (config files, object type descriptors, etc.). But it's applicability is not without limits. Jim Offerman lead developer Crevace Games www.crevace.com |
||||
|
||||
![]() JohanOfverstedt Member since: 1/3/2003 From: Sweden |
||||
|
|
||||
| Yes, there certainly are limits Tried to do a little larger database with about 80 000 elements. Hehe, just say it choked badly Nice article by the way! |
||||
|
||||
![]() superpig GDNet Technical Lead Member since: 5/26/2001 From: Oxford, United Kingdom |
||||
|
|
||||
quote: Oh, agreed. There's a risk of 'golden hammer' syndrome here (when you've got a golden hammer, everything looks like a nail)... that's when you begin twisting the technology to fit the problem, rather than using the correct technology - my adventure game example was also one I felt was a little contrived, as there are better solutions to the problem. I disagree when it comes to asset management, though. There's nothing that says all your XML need be in one file... perhaps one XML document to describe a module would be sufficient. But XML, if you use it for asset management, would be a godsend for modders (IMO), because it's so much simpler than adhering to a particular directory structure, or having the developer provide some 'index' file format. XML becomes something like the Universal Save project; tools for 'mod packaging' could become available to help modders pack their files in a common way. Superpig - saving pigs from untimely fates, and when he's not doing that, runs The Binary Refinery. |
||||
|
||||
![]() Illumini Member since: 10/13/2002 From: California, USA |
||||
|
|
||||
| To kinda follow up on the last strand of comments about size and such, here is something of note. Age of Mythology used a huge number of XML files for tons of stuff, including gamedata. In the final release they were compiled into XMB files, which a simply a commpressed binary representation of the XML file. I don't know the specific's on how this all worked, but anone intrested might take a look around the AOM community as there seems to be an XMB->XML converter out. |
||||
|
||||
![]() amikael Member since: 8/27/2003 From: Sweden |
||||
|
|
||||
| XML in games are of particular interest to me. Check out http://www.naltabyte.se/liquid to see what I mean.. (^-^)7 |
||||
|
||||
![]() Seriema Member since: 6/15/2001 From: Stockholm, Sweden |
||||
|
|
||||
| Buster: you're an idiot how can one be so rude against someone trying to _contribute_ to the game development scene?? well taste this: quote: "HTML has been to the foundation of the Web" sure this post is late, but "nigga pliz"... "No lies of sugar can sweeten the sournes of reality" }+TITANIUM+{ A.K.A. DXnewbie[onMIRC] |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| XML is great... it has all of the disadvantages of a text-based file format, and none of the advantages of a binary format! Hey cool, I've made my data twice as large... and it's not even encrypted! Neat! |
||||
|
||||
![]() superpig GDNet Technical Lead Member since: 5/26/2001 From: Oxford, United Kingdom |
||||
|
|
||||
quote: Chill, Seriema; originally the article *did* say 'HTML, the foundation of the Internet,' and I agree that it is wrong (though I don't think much of the way Buster chose to express his opinion). The article was updated to read 'foundation of the Web' *after* Buster posted. So, down boy Superpig - saving pigs from untimely fates, and when he's not doing that, runs The Binary Refinery. Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4 |
||||
|
||||
|
Page: 1 2 »» All times are ET (US) ![]() |
Last Thread Next Thread ![]() |
|