Game Development Community

Player export

by AIDan · in Torque Game Engine · 08/13/2001 (1:08 pm) · 23 replies

Hi

I have replaced a rock with my model. I works fine.

Now I want to replace the player. I have exported the model again, removed all animations from the player.cs und deleted the compiled file.

V12 crahes after loading the objects.

What do I have to change to make it work??

greetings
Daniel
Page «Previous 1 2
#1
08/13/2001 (9:26 pm)
Whenever I try to do an export, I get an error saying no bounding box is defined. No one else has mentioned it, so I must be missing something.

I opened up some of the example files, but couldn't see anything about a bounding box.

Help? Anyone? Bueler?

-Mark
#2
08/13/2001 (9:35 pm)
I had the same bounding box problem. . .would love to know too.
Anthony
#3
08/13/2001 (9:54 pm)
Sorry guys, I know the exporter is very hard to use. Unfortunetly there isn't a whole lot of documentation, and neither Rick or I know much about it. This is a big issue on our list, we'll get something sorted out.
#4
08/13/2001 (10:04 pm)
FYI -- I have a meeting scheduled with one of the Tribes2 3D artists on Wednesday the 29th of August to discuss the exporter and help document it.

--Rick
#5
08/14/2001 (5:13 am)
Bounding Box:

Create Box around your model and call it 'bounds'.
#6
08/14/2001 (5:36 am)
Hi

I try to explain how to export a model. It works but I cannot garantee that all information are correct.

futureint.de/files/subtree.jpg

You have to craete a dummy called 'Shape'.
Now create a dummy called 'Detail'.

When your object becomes greater than pixels on the screen, this detaillevel is used.

Now create a dummy called 'Branch'.

futureint.de/files/link.jpg
Link your dummy 'Detail' and 'Branch' to 'Shape'.
The easiest way is to select 'Detail' and 'Branch', activate the 'Link' button, press F12, select 'Shape' and press 'Link'.
Deaktivate the 'Link' button.

So, you want export your model and not only some dummys.
Make sure that all your Meshes are called ''.
I used the prefix 'Submesh_' and =1 so my model is always shown.

Now, select all your '' meshes, activate the 'Link' button, press F12, select 'Branch' and press 'Link'.
Deaktivate the 'Link' button.

Create a box around your model and call it 'bounds'. Your boxes pivot becomes your models pivot, so you better set it to the ground if you want your model stay on it.

This is the way it is decribed in the doc.

Export your scene as .dts file.
Make sure, if you export to a directory including a 'dtsScene.cfg', you have to delete it, or your meshes will not be exported.
I think this file is used when you export the sequences (.dsq).

As you see, I used another way in the picture above. As I see, it has no advantages. I tried it, because I wanted to export my model as player. Did not work :(

greetings
Daniel
#7
08/14/2001 (11:43 am)
If anyone has this going... can I get a little test shape? I need a small flat pad, with collision information so I can build an example script object (a jump pad). The collision info has to be a convex mesh and call "Collision-0" (or "Collision-n" for more than one convex). It doesn't need to be fancy, flat shaded would be fine. If someone decides to take this on, you can email me: timg@garagegames.com.

Thanks guys :)
#8
08/14/2001 (3:53 pm)
Hi

Do I only have to create collision dummys or do I have to set up some information in a script, too??

greetings
Daniel
#9
08/14/2001 (4:44 pm)
Don't need to script anything. When the engine loads a shape, it looks for meshes called "Collision-n" (where n is 0-9). The mesh objects must be convex, and they won't get rendered. I'm not sure where they need to be connected in the max hierarchy, if at all.

In the simplest case, you can just add a box mesh to an existing shape (like the tree) and call it "Collision-0". They player should then collide with this box.
#10
08/14/2001 (5:46 pm)
bump

Just look my post before.
futureint.de/files/subtree.jpg

It has to look like this.
Maybe someone can help you. I'm really busy.
#11
08/14/2001 (5:50 pm)
What do you mean with a convex mesh??
Are the collisin dummys used like a trigger??

greetings
Daniel
#12
08/14/2001 (7:12 pm)
The collision meshes are simplified convex meshes that the player (and other objects) actually collide with. Many shapes (such as the player) have thousands of polygons, colliding against that many polygons is very inefficient. By creating a simplified outline of the shape, collision can be processed much faster.

If you don't have time to mess with it, don't worry about it. Maybe someone else will help out :)
#13
08/14/2001 (11:35 pm)
In the example, dummys were used for collision.

Is that right that I have to use a collision mesh, not dummies??
It's like the bouncing box, but it can be more complex than a box.?

greetings
Daniel
#14
08/15/2001 (10:23 am)
I'm not really clear on the MAX terminology... A box would work, not sure what that has to do with being a dummy though :) Convex shapes have no exterior surface angle under 180 deg, or no interior angle over 180 deg.

So a box is convex, spheres, pyramids, etc. But this is not convex:

---
 \  \
  \  \
  /  /
 /  /
 ---

That is a concave shape :)

The player object uses a simple box for collision, but some of the other Tribes 2 shapes used more complex convex geometry, especially the vehicles.
#15
08/15/2001 (11:31 am)
In your example, rock1 are dummies used for collision info, but that is nonsense, because dummies aren't even meshes.

You mean a mesh where you can't see the inside?
#16
08/15/2001 (12:28 pm)
The sample rocks and trees do not have the correct collision box information. That's why you can walk through them.

They also cause the game to crash when a vehicle touches them.
#17
08/15/2001 (10:36 pm)
in your tutorial you say to add a dummy "branch" but the pic has dummy "start" . . . which should I use and why ?
anthony
#18
08/16/2001 (7:32 am)
In the tutorial, I described the way, described by the V12 doc. The picture shows the other way if you need a special collision model (Collision-).

greetings
Daniel
#19
08/16/2001 (8:01 am)
Installation
Place the file 'dtsexport.dle' in the Max 'Plugins' directory.

Valid Scenes
The following describes how the exporter interprets the scene in Max. Any object at the scene root level (children of the world) is either (a) the bounding box, (b) a sequence object,(c) an unlinked mesh, (d) a sub-tree of the shape, or (e) ignored. Objects not at the root level are ignored (or an error) unless they are either the bounding box or part of a subtree.

The bounding box
The bounding box should be a box that completely encloses the shape at all points in the animation. Note that the bounding boxes pivot point will be the exported shape's pivot point. Likewise, ground animation is based on the animation of the bounding box. So if you want to export a running person, you would place the bounding box around the person at time 0, with the origin of the box at the persons feet. As the person runs, you would animate the bounding box to keep pace with the person. Note: the easiest way to do this would be to link the bounding box to the hips, and set it to only inherit y-position. Notice that in this case the bounding box is not at the scene root level (which is fine). If you want to export a building with part of the building submerged under the ground, you would create the bounding box surrounding the building (as always) but the bounding box pivot point would be where you want the ground to come up to on the building.

Sequence Objects
Sequence objects are necessary if animation is to be exported. The sequence object tells the exporter how to export animation data over a given range of time in Max, and what to call the sequence. A sequence object can be created like other helper objects (it can be found under the 'General' pull down menu). See the section on the Sequence Object Parameters below for more details about the sequence objects.

Unlinked Meshes
When building a shape in Max for previous exporters (namely the Starsiege/Tribes 1 exporter) detail levels of the shape were stored in completely separate subtrees (base128, base64, base32 subtrees, for example). In the new exporter there is generally only one subtree (although it supports more if desired) and the artist must supply a different set of meshes to be drawn for each detail level. This is done by naming different detail levels of the same mesh with the same base name but a different trailing number. E.g., 'head64' and 'head32'. The numbers in the detail level should correspond to the number on the 'detail marker' (see section 'Subtrees', below). One detail level of the mesh needs to be linked to the shape in the appropriate place, the other detail levels of the mesh should be unlinked (children of the world). During export, these unlinked meshes are collected and added to the shape at the appropriate location.

In a Max scene we only have one set of meshes linked to the shape at a time, so we need some convention for including in the file other meshes that correspond to lower detail levels. This is done by leaving meshes that belong to other detail levels should be unlinked (left as children of the world). Furthermore, they must be named just like the meshes that are attached to the shape, except they should end in a different detail number (if in the shape you have a mesh named 'head' or 'head64', then the unlinked version of that mesh that will be drawn for detail level 32 must be called head32). During export, these loose meshes are collected and added to the shape at the appropriate location.

Subtrees
A subtree is a dummy object at the scene root level with the following types of children: at least one detail level marker (a mesh object whose name ends in a number), and at least one branch (a dummy object with children that have geometry somewhere in the sub-hierarchy). The purpose of the detail level marker is simply to indicate to the exporter what detail levels should be present for this subtree. The number corresponds to the pixel size in the game engine at which the shape will draw with these meshes. E.g., if you have markers named 'detail2' and 'detail36', then when the size is 36 or greater the shape would be drawn with the highest detail level (the meshes attached to the shape), when the size is between 2 and 36 it would be drawn with the unlinked meshes (see section 'Unlinked Meshes', above) ending with the number 2, and when the size was less than 2 nothing would draw. The name of the marker is unimportant (except the number, of course) but it does get exported and can be used to look up a detail level by the programmer. What lies under the "branch" corresponds to the actual shape. The whole subtree can be under one branch or there can be multiple branches. If you have a shape at the root level and want to export it, the following rearrangement should suffice:
World
|
|--Shape(dummy object)
|
|--Detail2 (box)
|--Branch (dummy object)
|
|--

Ignored Objects on the Scene Root Level
An object on the root level will normally be interpreted as a mesh or a subtree (unless it's the bounds node or a sequence object). If it has geometry it will be interpreted as a mesh. If this mesh does not correspond to any mesh on the shape, it will be flagged as an error unless 'Allow Unused Meshes' is turned on (in the Error Control sub-panel of the exporter utility panel -- see below for details). If unused meshes are allowed, then the mesh will be ignored. If an object on the root level has no geometry (if it's a dummy object, for example) it will be interpreted as a subtree. If it has no detail markers or branches, then it will be flagged as an error unless 'Allow Empty Subtrees' is turned on (in the Error Control sub-panel of the exporter utility panel). If empty subtrees are allowed, then the object wil be ignored.

Configuration Files
There are a number of parameters used by the exporter that can be saved in configuration files. When the exporter first loads in Max it looks for a file called 'dtsGlobal.cfg' in the Max Plugins directory. When you export a shape the exporter looks for a file called 'dtsScene.cfg' in the same directory as the .max file being exported. On each line of the configuration file there should be either one of the keywords 'AlwaysExport:', 'NeverExport:', or 'NeverAnimate:', a name, or a parameter expression (a line starting with +, -, or =). Names are put into one of 3 lists (the always export list, the never export list, or the never animate list). Which list depends on which of the 3 keywords occurred most recently in the file (if none of them have, the name is put on the always export list). Names can include wildcards (*). The following discussion depends on understanding the distinction in Max between nodes and objects. If you don't understand that distinction, you are probably ok skipping to the next paragraph. Onward: If a node's name matches a name on the never export list, the node won't be exported and any meshes hanging off it will be put on its parent (or its parent's parent if its parent is on the never export list too). If a node is on the always export list it will be exported even if there are no meshes on the node and even if the name matches a name on the never export list (i.e., the always export list takes priority over the never export list). A node matching a name on the never animate list will not be animated even if it animates in max.
For example, the lines:

AlwaysExport:
bip*
NeverExport:
submesh*

would export nodes beginning with 'bip' but not nodes beginning with 'submesh'. Or if 'submesh*' was replaced by '*' exactly those nodes beginning with 'bip' would be exported.
Lines with + or - turn on or off boolean parameters. Lines with = set the value of valued parameters (note: the '=' occurs at the beginning of a line). You can save the current configuration as the default configuration or to a separate file via the exporter utility panel under the 'Configuration Control' sub-panel. Note: node names are only relevant in the dtsScene.cfg file. They are ignored in the 'dtsGlobal.cfg' file.

Export Output type
Three types of files can be exported. A *.dts file contains node structure, meshes, and (optionally) sequences. A *.dsq file contains only sequence information. Sequence information is useless without the nodes and meshes, of course. The *.dsq files are meant to be imported into *.dts file at run time. That way one can store the basic shape separate from any animation of the shape, and can edit the animation separately from the shape. The third file type is *.txt file. This export type exports all the nodes and objects in the scene into a text file. No nodes will be removed (even if the collapse transform parameter is set to true). You can select which of the file types you are exporting by choosing the appropriate extension in the dialog box brought up when you choose File->Export, or by pressing the appropriate button in the exporter utility panel.

Utility Sub-Panel of the Exporter Utility Panel
The utility sub-panel includes three buttons for exporting shapes (one button for each export file type) and three buttons corresponding to special utility functions. The first three of these buttons was described above, the later three will be described in this section.
Renumber selection: this utility operates on the names of all the objects you have selected. It replaces the number at the end of the name with the number you specify. A name without a trailing number will have the specified number added to the end of the name.
Embed shape: the purpose of this utility is to simplify the set up of the Max scene for the exporter. If you have shape you want to export, but it does not abide by the conventions layed out above, then you can select the shape and run the 'Embed shape' utility and everything should be set up for you (except the bounding box). Note: you only have to select the objects of your shape that are children of the world (do not select the unlinked lower detail meshes). See the schematic under the section titled 'Subtrees' as a guide.
Register details: this utility will add all the detail markers to your shape. It searches the scene for all the detail levels of all the meshes it finds on the selected subtrees. Note: to use this utility, you need to select the root level objects of your shape.

Utility Panel and Exporter Parameters in Max
This section provides a brief description of the exporter's parameters.
Parameters found in the 'Parameters' sub-panel:
-- collapse transforms: when set, nodes without attached meshes are
removed from the exported shape. Also removes transforms on never
export list but not transforms on always export list (see section
on configuration files above).
-- Enable sequence export: when set, exporting whole shape will
export sequences too.
-- Animation delta: used to detect animation on transforms. Should
be ignored (I should remove this).
Parameters found in the 'Error Control' sub-panel:
-- Allow empty subtrees: when set, subtrees can be empty (see
section on Valid Scenes above).
-- Allow crossed details: when set two subtrees can have sets of
detail levels that overlap each other (e.g., one has details 2 &
10 while the other has details 5 & 15). When cleared, the above
case would be an error (but 2 & 5 and 10 & 15 wouldn't be).
-- Allow unused meshes: when set, allow unused detached meshes.
-- Allow old-style sequences: when set, sequences from Starsiege /
Tribes1 exporter can be used. This allows one to use old shapes
(except old exporter hasn't been ported to max 3 so this option
is currently irrelevant).
-- Require VICON/BIP node: when set, exporter must find a subtree
called VICON or Bip0. Not currently an important feature...may
be removed at a later date.
Parameters found in the 'Dump file control' sub-panel:
-- various toggles for configuring what gets put in the dump file.
To save time one might turn all or most of these off. Probably
worth having at least 'Dump Shape Hierarchy' turned on. Dump file
is written to 'dump.dmp' in the target directory. Note: by giving
the file the extension .dmp, you can associate a default
application (say, WordPad) to the dump file.
Parameters found in the 'Configuration control' sub-panel:
-- no parameters, but let's you save and load current parameter
values.
The following parameters are not found in the Max user-interface.
They can be changed by editing the globalScene.cfg file:
-- sequence defaults. Default values for all the parameters of the
sequence objects can be modified in the globalScene.cfg file. See
the section below on sequence object parameters for what each of
these parameters does.
-- Param::maxFrameRate: this parameter controls how long it takes
to go from the last frame in a sequence to the first. In max
this is 1/30th of a second by default, and will probably never
change. If you find a way to change it in max, you should change
the value here too...otherwise, you'll probably never touch this.

Sequence Object Parameters
The following are the parameters that can be modified
on sequence objects:
-- Cyclic: (opposite of one-shot sequence).
-- Complete cycle: only relevant if cyclic set. If set, the
exporter assumes that the state of the scene at the end of the
sequence exactly matches the state of the scene at the start of
the sequence. This is not actually how max works, so one will
normally have this turned off (Max adds a pad of 1/30th of a
second to the end of the sequence ... turning the complete cycle
feature on is like setting Param::maxFrameRate to infinity).
-- Blend sequence: ask a programmer for more details.
-- Use Frame Rate: if checked, uses the frame rate supplied in the
frame rate edit box for the exporter frame rate. If not, export
N frames where N is the number supplied in the other edit box.
-- Default sequence priority: controls what sequence controls a node
when two sequences want to control the same node.
-- Ignore ground transform: if checked, won't export a ground
transform for this sequence. Normally not checked.
-- Use Frame Rate (ground transform): if checked uses the supplied
frame rate for exporting the ground transform. Otherwise, export
N frames, where N is the number supplied in the other edit box.
-- Export control parameters: enable and force various types of
animation.
#20
08/16/2001 (8:47 am)
Tim,

I just emailed you a dts WITH collision exported with the plugin. It works in Show and collides, so I am assuming that will work for your purposes. If you want any more models, email me.
Page «Previous 1 2