Game Development Community

3D Import and Default Player Questions

by Jan Guilfoyle · in Torque Game Engine · 02/07/2007 (7:59 am) · 4 replies

Hi everyone,

In order to complete our degree programme programme we are required to create a Multimedai production of some sort. We have decided to create a game. The basic premise is a solar system based game, in which the player can fly around the solar system and land on a planet, in which they will have a mission to complete. I have spent 3 solid days now familiarising myself with the Torque Game Engine, and I have got a good grasp of the basics thatnks to Hall of Worlds brilliant "Essential Guide to Torque Game Engine."

I still have plenty of questions, and any help would be hugely appreciated. Even if you can just answer one it is a bonus.

1. First question relates to importing 3D objects. Right well I know Milkshape 3D seems to be the most common way to do this. I am modelling in Cinema 4D mainly, so i export the files as .obj's and bring them into Milkshape. Then I export these as .dts and put them into a directory in Torque. THe models themselves go into the engine fine, but there are no textures on them! I have tried even texturing in Milkshape and then putting them into Torque but no luck. I know most people arent using Cinema 4D but can anyone tell me how they do it, or if there is a better way than Milkshape to get .dts files. To be honest, Im really surprised that there isnt a simpler way.

2. Obviously we cant have an orc being the main player in a space game!! So I guess we'll have to animate someone in a space suit to take his place. Can anyone suggest the best way to import this animation into Torque, and to successfully replace the Orc as the default player?


Im sure there are going to be lots more questions like this, I'll add them as I go! Again, thanks in advance for all help contributed.

The Solar Quest Team.

#1
02/13/2007 (6:01 am)
Hey Jan, I'll answer this to the best of my knowledge:

1) I've always used Maya for my model exporting, so I can't get specific with the tools you are using. The only advice I offer is this: How you texture the model in your program (the naming, folder path, and texture location), should be mirrored in the TGE folder.

Example folder hierarchy:

Space Suit [b](folder)[/b]
    -> SpaceSuit.ms3d [b](your model)[/b]
    -> Textures [b](sub-folder)[/b]
         -> Suit.png [b](texture)[/b]
         -> Helmet.png [b](texture)[/b]

If that's how your folder system for the raw model looks, then the TGE folders for your .dts should look the same.

In example\starter.fps\data\shapes\
Space Suit [b](folder)[/b]
    -> SpaceSuit.dts [b](your exported model)[/b]
    -> Textures [b](sub-folder)[/b]
         -> Suit.png [b](texture)[/b]
         -> Helmet.png [b](texture)[/b]


2) Have a look in example\starter.fps\data\shapes\player.cs: This is an example, in this case the Orc, of how an animated shape gets constructed using TSShapeConstructor. Your baseShape will be the static .dts of your model. You then create sequences out of the animated .dsqs exported from your modeling programming.

Here's a break down:
[b]// This is the declaration of the constructor:[/b]
[b]// PlayerDts will be the script reference back to this animated object[/b]
datablock TSShapeConstructor(PlayerDts)
{

      baseShape = "./player.dts";   [b]// This is your static shape.  notice the ' ./ '. 
                                    // This is saying the .dts file is in the same 
                                    // folder as this script[/b]

      sequence0 = "./player_root.dsq root";  [b]// Sequence# is sort of like an ID, 
                                             // used internally in the animation system
                                            // The first section of the quoted words represents 
                                            // the path to the animated .dsq
                                           // The last portion is the name of the animation, 
                                           // which you will use to play the animation later in 
                                          // the call .playThread(). [/b]


Hope that helps out. If any part is confusing, just repost your problems here.
#2
02/13/2007 (7:18 am)
Thanks Michael, this helps a great deal especially the character stuff. Ive given up trying to use cinema 4d to do the modelling. Luckily I have Maya also, so Im now trying to get the Maya exporter to work for me. I think I have the textures figured out, I just have a few issues with the exporter to iron out but it should be fine in due course!
#3
02/13/2007 (10:42 am)
Hello Jan,

If you're using Maya, may I point you towards my Maya exporting guide here.

Please note: the stuff I wrote about Levels of detail is incorrect - I need to correct it ASAP, but for now, ignore it.

Amr
#4
02/13/2007 (10:58 am)
There is a problem with Cinema 4D obj when import in MilkShape. Cinema 4D is different, someone esle was having this problem and had some good information but I could not find the thread.