Game Development Community

Torque X Starter Project with no xml

by David Helmer · in Torque X 2D · 05/12/2008 (5:58 am) · 3 replies

My roommate and I are trying to get a project going with no xml because we're more comfortable defining all of our game components in C# but we're having a hell of a time getting a version of the "starter game" going without the xml.

There's a comment above SceneLoader.Load saying that anything in the xml file can also be created manually in C# code, but there doesn't seem any documentation for the instantiation of the game without the xml.

Any help, much appreciated, thanks!

#1
05/12/2008 (11:12 am)
I recommend starting with a basic XML .txscene file to load a default scenegraph, camera, and whatever materials you need. Then you can create all your sceneobjects in code and attach components to them. Why reinvent the wheel?

If you really want to do everything without the .txscene file, open a basic .txscene and try to duplicate what you see in there. I've never tried this so I don't know what tricks there are to it.
#2
06/28/2008 (7:22 pm)
The documentation doesn't give you specifics on the object hierarchy, thus, you have to try to figure it out on your own.

I've had no success of converting the objects defined in the XML to code, as well. If I had access to the Sceneloader source, it would be no problem; I guess that's how they get you to cough up 150 bucks.

Vague documentation FTW!
#3
06/28/2008 (11:51 pm)
This is entirely possible, but as D. Robert Duke indicated, you need to create everything yourself. The scene graph, the camera, materials, the whole works. That being said, the XML file really is like a roadmap for your code, follow the XML from top to bottom and create all the classes in code as you come across the XML. Just remember that as you instantiate the classes, they each need to be registered with the TorqueObjectDatabase. Afterall, this is all that the SceneLoader and de-serializer ultimately do anyway.

John K.