Game Development Community

dev|Pro Game Development Curriculum

Torque X 3D for CC && XNA Creators Club GSE

by Scott R. Plaumann · 11/14/2009 (7:11 pm) · 2 comments

11:25 AM 11/13/2009

What to do, where to start:

I'm really likein' the Torque X Builder 3D interface, I'm impressed that Microsoft has loosened the artistic license for IDE/API design. Is it still a prerequisite that the file/open default to the documents folder or didn't they ease up on that. But that's what the Recent Projects submenu is for. From there, it seems that you stay in the selected projects space i.e. directory so the Scene is right there and there's no need to search further to select the Scene Level Data.

Ok, back at it:

Open C#,load your project, run it, open Torque X Builder 3D for Creators Club, load the Game project that's currently active and running in with XNA. In Torque X goto the Scene Level Data tab.

It's XML. I know some XML so I should have a fair chance at some guesses as to what these tags are holding. I think it was a CompSci 200 level class where we were asked to build an XML schema validity program in C++, and of course they were using UNIX or Linux with the compiler (I can't remember if it was GNU or a Borland product or not), good for me! Actually it was pretty cool to be able to write the code at home and then use telnet and FTP to up and download the assignments from home. The Building for the XBOX360 seems pretty much like that except for the fact I needed to wait for my results from the classes T.A. and with the Creators Club I can see the results after the build and deploy are recognized.

In Visual Studio 2005 in Visual Basic I was using their database importers and XML loaders (readers/writers) to connect a data-base which you could download from...

U.S. Department of Agriculture, Agricultural Research Service, USDA Nutrient Data
Laboratory. 2006. USDA National Nutrient Database for Standard Reference, Release 19.

USDA Nutrient Data Laboratory website: www.ars.usda.gov/nutrientdata

...jeeze, I must have put that together a while ago... and then connect that to a Microsoft Access Database importer. It's a form app where the database loads into the DataGridView when started, that's all. I never did get to the sorting or search dialog but I did get it to read it back out as a well-formed XML document. Its out file was almost 10,000KB. The form has its MenuStrip, ToolStrip, TableAdapter, BindingSource, BindingNavigator and of course, its DataSet. It's data, you read it in, you view it, you close the app. Yeah, my bad.

Now for Torque X data.

Start tags and End tags:

Tags and tags, what's in those tags?

I picked up a suite in 2004 from ALTOVA www.altova.com/ named XMLSpy. It's an XML editor and the on-line documentation is well thought out. While going through the help contents they provide they were addressing the question...

"What is XML? XML is a clearly defined way to structure, describe, and interchange data.

Data in this context really means every conceivable kind of data! You can use XML for such diverse things as describing mathematical formulas, chemical compounds, astronomical information, financial derivatives, architectural blueprints, annotating Shakespearean plays, collecting Buddhist wisdoms, or voice-processing in telephone systems! © 2004 Altova"

And somehow that seems to be just what is in those tags. It doesn't seem to be only conventional variable data assignment, but something to do with object declaration and its creation/allocation. In comparing the size and entry type in the XML file it has grown and changed when going from the New Scene leveldata.txscene to the given Template created leveldata.txscene. TorqueSceneData appears to be the main complex type element/component that encapsulates the Level Data in the XML file. Having had taken a look at the FPSdemo I also noticed that there are different *.txscene files that, from my guess, are run when one of the main menus buttons are selected. A pattern is starting to build but right now all I see are stubs. Maybe I should take a look at some old college books for UTD's, dynamic creation and the use of pointers.

There is also a difference between the New Scene and the loaded Scene Level Data from the C# Templates; being, the Starter Game 3D (3.0). There are many more entries than in the New Scene XML. When loading the Template project and viewing the Scene Explorer there are objects added to the TreeView. And that's why something comes up in the in the 3D Scene View tab and not when a New Scene is initialized. With that nicely apparent, I exit Torque X.

I start it back up and realize that some of the menu items are grayed out. Connection to a compiled project seems essential in that it opens and allows for opening a New *.txscene file, which is beginning to become a central mechanism in Torque X for XNA-GSE. Once connected, the menu items are no longer grayed out, they have become active and respond to input.

12:12 PM 11/14/2009

OK, you know the drill:

C# load and run things, TX3D-CC connect to *.txscene, but what's next. The given TX3D Template gives me what. I have a StarterGame3D window with a desert scene and the Torque X Builder 3D API has in its 3D Scene View tab the same camera view of the same dunes. In the running game the dunes have been lost at a further distance. The back clipping plane used with the viewing frustum may haves been brought in closer to the front clipping plane or it might be that it's the Bermuda Triangle version of TV vs computer screen. I guess that's no biggie, just an FYI or a bookmark.

I really can't think of anything else and so that just about covers my little To Do and look-see around the Torque X3D-CC API.

Back to the Welcome tab:

That last slog covered the three steps in creating a new project. I'm out of guesses as far as I'm concerned so the thought of "Strike while the iron is hot." has become "Grab that coal shovel and put some back into that bellows."

Importing: where are my tongs?

Alright, I have read Importing, Editing, Moving and Running from the Welcome screen. Now if you will excuse me, I must put on the conical hat of wisdom that's usually found in the corner of the classroom, on a stool of which I will now be sitting. But seriously, I was just going through that as a dry-run so I don't look as foolish on my way to the corner later. But then again, if I look like a professional on my way to the corner, that's not a good sign either.

Either way it sounds like I need to become a little more adroit with the Torque X API, and it looks like I'm off to the land of pointy-clicky full of tom foolery and ham fisted numb scullery. I'll be back in a bit with either a pointy hat full of nothing or a pointy hat full of pertinent mind dandruff.

One last thing I could use some help with is, when using the "Tags (separated with commas)" box at the botom of the blog builder, what is it used for and is there a good naming convention that makes best use of whatever data sort action it utilizes. I'm clueless.

Until then.

G'day

About the author

My Avatar is the app I'm working on in VB. It would be nice to work in Torque X and port my Visual Basic to C#\XNA. Also know some XML, UNIX, C++.


#1
11/15/2009 (5:24 pm)
Interesting read. I was reading your BIO and you mentioned porting VB code to C#. Is it VB.NET code or pre-.NET code?

If it is VB.NET code you can easily convert it to C# using the following link: Convert VB to C#
#2
11/17/2009 (1:51 pm)
Yes, it’s MS VS 2005 so I believe it’s VB.NET.

I also have an old computer, a 550 MHz that still runs 98 with Visual Studio 6.0, but that’s just to peruse my legacy VB code. That code used a lot of goto’s, was very monolithic in structure and had very few comments. Back then it was, “As long as I’m on a tear I might as well run with it”.

But this sounds very intriguing. The only problem now is that this app has seventy-eight *.vb, *.designer.vb and *.resx files. I checked out the site and if it were pristine code that I didn’t have the heart to change this sounds like a viable option. As it is I might as well look through the logic, then see if I can modularize overlapping functions, try to make the classes more generic and leave a comment cookie trail all the way through, even for my variable declarations.

I’ll keep up with this blog, running it as long as possible; I’m in for the duration. Thanks for the interest.

G’day