Game Development Community

Are DTS files instanced?

by Mayor McCheese · in Torque Game Engine · 12/07/2004 (4:27 pm) · 8 replies

Heyaz,

I was just wondering if DTS geometry was instanced?

In my mission file I was doing a test


new TSStatic() {
position = "0 0 -0.25";
rotation = "0 0 0";
scale = "1 1 1";
shapeName = "~/data/shapes/tile2.dts";
};

The thing is I have a lot of the DTS files and it seemed to slow down on load a lot more than I thought it would if geometry was instanced. If it is maybe there is a issue with my mission file since I am not using the mission editor to generate it.

Danke

#1
12/07/2004 (5:00 pm)
Actually I just tried a test and I am getting a nice crash. It stops right about here:

netconnection.h
AssertFatal(info->arrayIndex >= mGhostFreeIndex, "Out of range arrayIndex.");

My mission file contains:

8794 cubes

All laid out next to each other to form one large surface. The cube contains a bounding box, a cube for the collision and one single 256x256 texture. It all references the same DTS file. I would figure torque should be able to handle this since Ive seen scenes with a lot more parts to it at a previous company in another engine.


Danke,
Juan
#2
12/07/2004 (6:31 pm)
TGE does use a resource manager to handle that type of scenario, but what you are running into is the hard coded (but easily changeable) limit of 1024 ghosted objects in one mission.

Lag wise, the performance loss is due simply to the number of total objects in the scene at once. 8794 separate shapes does not equate to very complex shapes with much less complex collision boxes.
#3
12/07/2004 (7:15 pm)
I'd use a replicator ^_^
#4
12/07/2004 (7:34 pm)
I beleive the point of the test was to check to see if it's loadin' the DTS files twice? At which, I'd say it shouldn't, unless something got screwed up... as for your rest... Try it with less than 1024 objects... I was told that there this was a hard coded max # of objects TGE can handle. (It could be upped, but for most, it's sufficent)... Just a thought :p
#5
12/07/2004 (8:39 pm)
Torque only loads a given file once. As for the many objects crash, the assert sounds like a bug. What you should be seeing in stock Torque in this situation is that a thousand objects show up at any given time. The networking system only transmits the thousand most relevant objects. You can change this by tweaking the ghost constants, located in netConnection.h.

Torque itself can handle any number of objects (I suppose it would cap around the 32bit ID limit - 4 billion objects or so).

If possible, I'd suggest keeping the number of objects in your game to the minimum.
#6
12/07/2004 (9:12 pm)
Thanks to everyone for their reply.

Cool. Ive just been turned onto the concepts of ghosting in torque. I found the constants and will tweak accordingly. Is there any way I can turn off networking or transmittion of data for a set of TSSTatic objects? The majority of the geometry I will be creating is just scenery that the user will never interact with. I would limit the amount of objects but I am trying to cut them up into discrete pieces so I would have anything larger than the user so culling based on a objects bounds can work well. Ive worked at a commercial game studio so I was also trying to get my workflow and the engine a bit like what I had while I was there.

The reason for the cube test as well was so I could see if it was possible to effectively create what was almost like a 3d tile based title. Heh. I now have 4000 dts objects in torque all laid out in engine. As long as I don't view across the whole level horizontally the performance seems fine. The reason I thought it was loading the shapes more than once was the time it was taking to load up the mission was a lot more than I anticipated. At least I know now things are instanced so that my memory overhead should be low. Id try a replicator but i need to place the objects in exact places instead of randomly putting them over a certain area.

Well off I go. Thanks again. Ill post some information about my data driven Maya mission editor once I get some screens up(After new years due to work deadlines). Its all about tieing in all the content creation you can under a single tool and a single roof. :)
#7
12/09/2004 (9:14 am)
You're right, for 3D tiles, a custom tailored replicator sounds but just perfect. It'll take a little effort, but it'll sure be worth it. You need a replicator to place objects in a grid. Since you want a tile map, the replicator needs to be able to output different models, and maybe save and read from a custom map format (a simple array-ish data format specifying which tile is being used for each grid slot should do it).
#8
12/09/2004 (12:33 pm)
Ill take a looksy at it. I guess the best way would be to start with the ShapeReplicator? Would that also mean id have to do all my own culling/visibility management/collision detection for my tiles/shapes? Then id have to re-write the exporter I have in Maya. Since it looks for TSStatics to be under a node that represents a SimGroup Id replace the SimGroup with the replicator and then export everything under that node as the data for it. Oi. I really wish I had the time at the moment. Back to regular work :I