Game Development Community

TGB Archetypes?

by Stephen Nichols · in Torque Game Builder · 03/12/2009 (7:47 pm) · 4 replies

I'm using version 1.7 of TGB.

I'd like to create object archetypes using the editor. It seems that I can load image maps, compose hierarchies of objects and assign behaviors using the level editor.

However, I'm wondering what the best way to reuse those compund objects is...

Does anyone know:

1. Can I use levels as "object palettes" efficiently? I'd prefer to reference palette levels from my gameplay levels. In this way I can reuse objects and make changes to all instances of an object when bugs are fixed.

2. If not, what is the standard method for achieving this level of abstraction using TGB?

Any help would be appreciated!

steve

#1
03/20/2009 (9:29 am)
I'll take it that this is a problem that nobody else has solved... or they're being particularly guarded about their solution. :)

My team has found a decent solution to this problem that allows us to use td2 scene files to visually package up compund objects. We've made some changes to the editor and whatnot to support this nicely.

This modification allows you to import another level into your level and place imported compound objects on your level. The imported objects are referenced, not copied, which allows you to make changes to them in their original level. This, in my opinion, is far superior to the "place an object off the level" approach. It's also nicer than the "use datablocks to specify visual data" approach.

Once the code is well tested, I'll see about putting it into a resource for anyone else to use.

steve
#2
03/23/2009 (12:32 pm)
Hmm I'm not 100% about what changes you have made. Usually when I need to create a hierarchy, I use classes and superclasses. I build the object using the "onLevelLoaded" command on a class so that in the editor I simply add the class name to a dummy object. Then I can build out whatever attachments or behaviours I want from there, making the changes on the backend scripting code. Certainly being able to do this in the editor would be cool, but I never looked into the editor code so I couldn't speak to the way you have it set up. It's certainly got my interest peeked though!

Also, how is the TGB editor code. Is it a set of script files, or is it c++? I need to update some things soon and can't look at my home computer right now.
#3
03/23/2009 (1:57 pm)
It's a bit of both... some script and some C++.

We looked at writing custom code to create compound objects... that would definitely work. However, that's not too palatable for visually-minded designers and artists.

The code is almost ready. We'll see how it performs in the hands of the designer types! :)

As it stands, we can now use the editor to create new "archetypes". These archetypes are simply T2D scenes. T2D scenes can now import other T2D scenes and receive a read-only version of any objects contained within. The designers are allowed to move the imported objects around and modify rotation / size. Beyond that, they have to load up the original T2D file and make changes there.

More info soon as we get the bugs worked out...

steve
#4
05/20/2009 (11:26 am)
hey...

i was wodnering, how are the changes you made to the editor goin?... i'd like to give that modifications a try.