Game Development Community

dev|Pro Game Development Curriculum

Torque pipeline progress

by Phil Carlisle · 06/19/2007 (9:56 am) · 17 comments

If you look at the current art pipeline for torque, you can see that there are some issues in terms of usability and process that could do with getting some attention.

The main problems as I see it are:

> The reliance on "exporters" for DCC apps is too much for GG to maintain
> The scene structure implies far too much within the modelling app
> The reliance on a non standard format means that there are issues when working with third parties
> The extensibility of the exporter based approach is in question as new features become available
> There are obvious flaws and missing features in the current pipeline
> The pipeline itself isnt readily extensible with third party tools

Now, I'm not saying that you cant produce great artwork for torque, as clearly you can. But if you start trying to use it from anything but a professional's standpoint, clearly it becomes troublesome. Specifically, for less experienced developers I feel that the process of using thier creations is too complex.

So I've started addressing these and other issues, which is what I'm going to write about here. I wanted to throw out my plans in order for people to feed back and possibly spot potential issues I've not considered.

First, let me outline the basic methodology.

I'm aiming to create a flexible pipeline, that will allow content production in as many applications as possible. By moving to an "import" based methodology rather than an "export" based one, I hope to leverage the fact that file formats change far less frequenctly than DCC apps, plus also capturing many more of these applications in the process.

So where to start?

The ideal, is to allow the user to simply select ANY supported model format (formats I'll enumerate later) from within the world editor and use it as a shape. I plan on having this functionality, but I feel there is some benefit to a slight different strategy initially.

My thinking, is that before I start adding format support directly into torque, I will get a feel for the formats and add some much required functionality into the pipeline beforehand. So my first goal, will be to create a pipeline that allows for conversion from external formats to internal formats. So in a nutshell, you will be able to go from an input format, to an internal format. Lets enumerate them now:

External input formats:
3ds, collada (dae),fbx,obj,mdl,md3,?????
Internal output formats:
dts,dtx

You might have noticed that DTX at the end. Thats going to be an interim test format, so that I can incorporate added functionality into the engine core side of things (i.e. add UV layers etc) while still allowing legacy support for dts's.

So, how does all this work?

Here's a diagram that should give you an overall picture of the structure of this application.

www.boxxor.com/blogimages/pipeline2.jpgClick here for higher res version
The important parts are the importer, the internal scenegraph, the conditioner and the exporter. These are all scriptable by design, such that more complex control is possible.

So what do the parts do?

Importer

This is the interface for loading a given file format into a scene. Essentially it converts an external format into a format that I can easily understand and document, its only purpose is to read from the file and stuff data into the scene.

Scene

The scene is the data repository. There is a manager interface because some situations will require multiple individual scenes to be present (for example, you might want seperate files for each LOD and to use a conditioner to then create a single scene from those).

Conditioner

I coined this term from the Collada docs. Basically, its a process that somehow either processes the data, or transforms it. There are so many different things you would use a conditioner for. The prime one I'm interested in, is the ability to call third party apps for baking ambient occlusion or GI lighting. So for instance, you would write a gelato conditioner that would write out an interim scene and then use NVidia's Gelato renderer to bake out individual lightmaps for each object. A simpler conditioner would perhaps reduce the polygon count on a given mesh, or even simpler still, automatically compute the bounds box of a given shape.

Exporter

This is the final peice of the puzzle. You somehow have to use this data in torque. At some point, the internals of this app will be incorporates into the main engine such that this process isnt required. But for now, it will simply take a given scene and write it out to either dts format, or the new extended capability dtx format.

The main thing is that this is all extensible. Primarily, I can see two main efforts here. Beyond actually reading the given formats. The first is to create a set of useful conditioners. The second is to make the whole process a lot more user friendly.

The second part of that, will require the creation of a "tool" application. Right now I'm thinking that the initial release of this application will be command line based. I understand thats counter to what I say about ease of use. But I intend to remedy that with a follow up UI application that takes the core code and allows you to perform the same operations only graphically. If you've used any of the high end DCC apps in command line mode, you'll see where I'm going with that.

So as you can see, its a considerable task, although to be fair, its not as complex as it sounds. Its basically reading and writing data for the most part. I'll post some more complete design notes later and hopefully get some base code fleshed out and documented enough to show how it all works. One thing I'm very aware of is not making this whole thing more complex than it needs to be. Having working defaults for everything where possible and generally making an easy to use and modify api is important.

So, thats what I'm up to. What about you? :)

#1
06/19/2007 (10:24 am)
Brilliant!!
#2
06/19/2007 (10:39 am)
Oooh so you're actually going ahead with this like you mentioned ages ago? Nice :)

However, as you asked for some feedback on things you may not have considered I'll throw this one straight into the mix: not all apps treat the common file formats in the same way. For instance the 3DS format can be treated in vastly different ways in different apps. (To the point you can just end up with junky models being imported into app B even tho its fine when you exported from app A)

This will obviously cause some problems with importing straight off the bat. I'd suggest maybe having fbx as your first file format to try importing, it supports a lot of functionality and behaves nicely across various apps.
#3
06/19/2007 (11:39 am)
Craig: yeah, I agree. FBX has the advantage of supporting collada, 3ds, obj formats too :) I think we can live with a few apps not being able to use a specific format if thats what it takes to get greater coverage overall.

The worst part is mainly the animation stuff, which I'll do once the basic pipeline works.
#4
06/19/2007 (12:30 pm)
add .x model and animation import support and everyone will be happy. =)
#5
06/19/2007 (1:31 pm)
Sounds complicated :-o

I dunno... I still dont know how LOS work in the Milkshape Exporter... So make that automatic or something ;)

Good luck!
#6
06/19/2007 (1:57 pm)
I was going to also suggest the .x model too, but either way this would be the most significant product for torque that I had ever seen, I have been trying to learn art and trying to learn 3d art and get it to work in .dts at the same time is a pain
#7
06/19/2007 (1:58 pm)
Torque's pipeline is a stregth and a weakness all at the same time. When models come in perfect from an experienced artist it's great for a programmer, but when you start getting into minor niggles it would be nice to have more control sometimes from script or in game editors. From my experience so far it has been troublesome finding someone who can successfully create good functional art for Torque compared with other tools available but that doesn't stop me from continuing down the Torque path. I'm glad to see you working on a better system.
#8
06/19/2007 (3:03 pm)
If you help me find useful info on the .x file format I'd be happy to support it with this.
#9
06/19/2007 (3:13 pm)
.x is an ascii format, so you can actually figure it out by opening it up in a text editor.
#10
06/19/2007 (3:54 pm)
.x is the DirectX model format - www.gamedev.net/reference/articles/article1493.asp
#11
06/20/2007 (3:50 pm)
Quote:Torque's pipeline is a stregth and a weakness all at the same time. When models come in perfect from an experienced artist it's great...

Too true, too true by far :P I've worked with a 'variety of quality' of models etc that I've had to get into Torque in the past and have often found that just tidy neat modelling can save a whole heap of time with getting stuff in-engine.

This is why I'm a little iffy about 3ds being a worthwhile file format to include in the potential import list. I've had models been crazy unwelded at hundreds of verts just because two apps treat the 3ds in different ways. That being said, theres only slight differences... so maybe the import system could include functionality to guess (heck you can probably pick it straight up from the file itself?) which app wrote the 3ds (or whatever file format) and tweak the import slightly?
#12
06/20/2007 (4:23 pm)
dont know if this is of interest to you, but I believe that I saw a resource for direct importing of 3ds files. might give you some insights.
#13
06/22/2007 (3:55 am)
if you can pul this off... WOW!
#14
06/23/2007 (6:18 am)
Craig: well, the best bet for that case (models being insane), is to have a plugin that actually goes over a model and tells the artist whats WRONG with the model. Right now, either you get a crash in the exporter, or you get a crash in the game.
#15
06/24/2007 (11:57 am)
Shining solution!!!

What is with function expansions like procedural texture?

FxGen is a procedural texture generation library and tool to let you implement high resolution textures that fit in kilobytes in your applications. Hear you find informations from the developer of FxGen
#16
07/05/2007 (9:58 am)
Maybe I am just clueless, but how would this work with a program like Blender?
The only way I know of getting the animations out of blender is to export to DTS. The animations do not get exported in any format other than .blend. At least they didn't the last time I looked.

Now, if the same kind of attention were given to a common open format that the Blender DTS exporter has gotten then this approach would be great. You would still have to write an exporter for Blender, but if the format is an open format the rest of the world uses then the exporter would get more attention than a DTS exporter for Blender has.

I think I am starting to see how this would work. The key is using an open format that is extensible for future needs and will not break older exporters/importers.
#17
07/12/2007 (7:54 am)
Its a bit old, but I'll reply for posterity frank.

The thing is, for example if blender output its animations as Collada, or FBX (both fairly competent file formats with open SDK's), then you could simply read any of those formats and have DTS's.

If not, then the solution would be to write a .blend "reader" plugin that would then work. I guess the main point is that its better to only lock you into the DTS format right at the point you need it (as an art asset in the final game) and not at the point where youre editing it (in your DCC application).

Either way works.. but I prefer reading common formats than writing them for reasons I've stated.