Dark Reign 3 Status Updates

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Or even

<date month="2" day="10" year="2004" />

For the example you had there:

Code: Select all

<camTrack>
       <pos x="20" y="20" z="20" />
       <pos x="21" y="21" z="20" />
       ...
</camTrack>
Is better than

Code: Select all

CameraTrack1
20 20 20
21 21 20
Because it is both more readable and easily modified. Say you now wanted to have multiple camera paths and each camera track has it's own ID number. To do this would take 3 extra lines of code whereas it will probably be harder to do just parsing a straight text file.

Code: Select all

<camTrack id="1">
       <pos x="20" y="20" z="20" />
       <pos x="21" y="21" z="20" />
       ...
</camTrack>

<camTrack id="2">
       <pos x="16" y="20" z="13" />
       <pos x="17" y="21" z="20" />
       ...
</camTrack>
It could easily be adapted to include tracking a unit as well in the same type of layout.

Code: Select all

<camTrack id="1" speed="1">
       <pos x="20" y="20" z="20" />
       <pos x="21" y="21" z="20" />
       ...
</camTrack>

<camTrack id="2" speed="2">
       <targ id="102" time="10000" />
</camTrack>
XML leaves you more options later on I think, as there is bound to be a lot more information you want to load from a file.
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

You can do that in a text parser.

Code: Select all

//Camera Track Save File, Points are in X Y Z format

Name=CameraTrack1
ID=1
Speed=1000
Camera=2
Point=20 20 20
Point=20 20 540

//A Second Camera Track
Name=CameaTrackBlerg
ID=2
Speed=2000
Camera=40
Point=100 200 14
Point=2948 2903 439
Point=11 11 11
Simple as pie and you get the same readability as xml
The Robomaniac
Project Head / Lead Programmer
Centaur Force
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

The thing with XML besides readability is it's object oriented approach.

Common parsers that would read Robo's file format would choke and die if there were extra lines, or missing lines. Or worse, it wouldnt choke and die-- it woudl start reading improper values.

With XML you can be assured that the data being read in matches the idea it represents. Furthermore, its easier to write a forward-compatible parser that deals with data trees than with flat-file formats.
a screen cap is worth 0x100000 DWORDS
Captain_Kill
Posts: 124
Joined: Sun Jun 27, 2004 11:02 am
Contact:

Post by Captain_Kill »

OMG THREAD HIJACK!!!111!!!! :lol:

The funny thing is, I use a different structure than what any of you people have suggested so far:

Code: Select all

<point X="123.000" Y="123.000" Z="123.000" />
That's the format for one point. Targets are done in the same way. Because XML files are read/written in the same order, you don't need ID numbers for each point or target. One line per point or target is simple plus it's a nice common sense structure.

Anyway... the small amount of code required to read/write XML files in Irrlicht plus its simplicity outweighs any short term problems. And besides, for what I'm using this for read speed isn't that much of a problem because files aren't loaded in gameplay and I can always cache stuff if necessary.

Manakel: I'll try your suggestion for Cal3D :twisted: Hope it works :D
2.8GHz P4 with HT - 512MB DDR - ATI Radeon 9600XT 256MB - Windows XP - VC++ 6 and VC++ 2003

Dark Reign 3 Home Page: http://darkreign3.notwhatyouthink.org/
Dark Reign 3 Forums: http://notwhatyouthink.org/darkreign3bb/
ManakelScared

Post by ManakelScared »

i think it would be first easier by doing the transform localy in Cal3dnode and then try to move it out to optimize ...

If you want me to help, dont hesitate to send the version @

woody 66 G ******************************tele2.fr
Captain_Kill
Posts: 124
Joined: Sun Jun 27, 2004 11:02 am
Contact:

Post by Captain_Kill »

Hey Manakel, check my earlier posts for the Cal3D code including an example model and program. That version is what I'm still using now.
2.8GHz P4 with HT - 512MB DDR - ATI Radeon 9600XT 256MB - Windows XP - VC++ 6 and VC++ 2003

Dark Reign 3 Home Page: http://darkreign3.notwhatyouthink.org/
Dark Reign 3 Forums: http://notwhatyouthink.org/darkreign3bb/
Post Reply