RE: [GD-General] Text file parsing
Brought to you by:
vexxed72
|
From: Paul B. <pa...@mi...> - 2002-12-11 15:12:03
|
> -----Original Message----- > From: Ed Sinjiashvili [mailto:ed...@sw...]=20 > Subject: Re: [GD-General] Text file parsing > > Most people mentioned XML. But if you ask a Lua fan - he'll tell ya > that Lua is XML with a human face ;)=20 Having used both for some time, I would suggest that the decision between lua and XML is more one of whether you *need* procedural data description. =20 We use XML for data in our game with the exception of render meshes, physics data, and one other piece of data (see below). Being able to=20 use off-the-shelf tools/technologies like XML Schema, Schematron,=20 XML Parsers (we use a C one for the game runtime and the .NET one=20 for most tools), and decent grid-based editors has been invaluable=20 for cranking out simple (sometimes single purpose) tools. Our only non-XML, text based data are script files for our in-game cinematics system. The runtime for this system uses Lua files for its file format. The original intent was that we would/could stuff procedural elements in the cinematic scripts by saving them off as Lua functions. =20 As it turns out, we never really found the procedural element useful and/or usable for our game. So, in the end, our Lua script files end up being simple table definitions of entity/event pairs. Because of the limited usefullness of Lua (in this case) we would be better off moving those scripts to XML data so they can take advantage of the in-place data validation mechanisms we have in place. One of the largest complaints I hear against XML is the verbosity of the syntax. Good tools (most off-the-shelf, some home grown) generally remove the syntax as an issue (no one on our team or outside of our team that comes in contact with our data complains). The other complaint is=20 parse time. We ignore parse time issues in our tools (overall we gain=20 in being able to manipulate the data on a large scale with standard tools)=20 and use a non-dataloss compiled XML format for the final shipping build=20 to remove parse time issues (our load times are acceptable to everyone who has played the game). Now, given the work that we've done to use XML (which we think has paid itself off), one thing we've noticed is that we (more or less) built a pretty simple database system that uses XML for its datastore. At that point whether to use an actual DBMS becomes an interesting question. Paul |