Game Development Community

Moving from DIF interiors to Collada to resolve Zone/Portal issues

by Paul Weston · in Torque 3D Professional · 07/06/2011 (10:16 am) · 4 replies

Hello all,

I've been working with Brian Murray of Gambit Realm for some time now, and have been helping him draft various questions for the forums which we've posted under his account so he would get the reply notifications... Anyhow, thought it was time I started posting under my own account now that I am doing most of the programming work myself while Brian concentrates on the artwork.

To refresh everyone's memory, we are currently finishing off our Star Trek NCC1701 project, where we have the entire original series Enterprise working in T3D. Having been turned down by CBS/Paramount for an official license, we are aiming to just complete all the decks and release it for free as-is, and then move on to another project - the RMS Titanic.

With that introduction out of the way, I have a question about the new Zone code that Rene implemented in the latest release (amazing work by the way Rene, and great Youtube video tutorials for it as well)... Due to the fact that the Enterprise is so huge with so many objects, the game was getting unplayable on most systems without zoning. But zoning did not work effectively until now, so we are only now trying to work all this out.

THE PROBLEM:

- The decks for our Enterprise (floors and walls) were built using Constructor, saved as DIF files, and added to the mission files as "InteriorInstances". We noticed in the latest 1.1 Final release of T3D that Interiors (at least DIF interiors, can't speak for other types) are not functioning correctly when we start to zone the ship. Basically, within a zone, the walls and floor do not render. This kind of makes the ship un-navigable and the zones unusable. Have seen this mentioned in a couple of other threads.

- So I decided to ditch the DIF interiors and replace them with Collada DAE files (generated using the "Export Interiors as Collada" option in the World Editor). Simple enough to do, and sure enough they went back into the game almost perfectly, although some required a bit of lining up for some reason as the positioning did not seem to match.

- The problem we're seeing now is that these Collada objects do not have any collision, so we go right through the floor and walls.

- I am just looking for the proper pipeline to complete this conversion of all the decks... Do we simply load up the newly exported DAE files in Milkshape or Ultimate Unwrap and then add a collision to them? Or is there a step I'm missing in the conversion process that would create the collision mesh automatically?

- I ask this because as InteriorInstances, the collision mesh on the DIFs worked properly (I'm assuming this is a function of using the "InteriorInstance" type?), without having to specify any specific collision mesh when we created the DIFs originally in Constructor.

Can anyone shed some light on the best way to take old DIF files and convert them to DAE with a collision mesh so they could make effective floors and walls for the ship?

Please forgive any ignorance on my part as it relates to this stuff, I am not an artist and do not have a lot of experience with the art tools pipeline... Just looking for some advice.

Any takers?

Thanks much!
Paul W.

#1
07/06/2011 (10:31 am)
On import the DAE is converted to DTS - there is a check box for "Allow Player Step" and another to use the visible mesh for collision in the shape properties.
#2
07/06/2011 (11:03 am)
Aha!

Thanks - I had set "Allow Player Step" to 1, but the Collision was set to "Collision Mesh" by default. I set that to "Visible Mesh" as you say, and now I can walk on the floor. Perfect!

Couple more things I noticed:

- When bringing the floor and walls back into the game as DAE files, they don't line up perfectly anymore, the walls and floors have to be selected together and nudged around a bit to line up with the existing objects (doors, tables, roof beams, etc). I just copied the position, rotation, and scale from the previous InteriorInstance and applied them to the TSstatic DAE version, thought that would put it back in at the same place. Is there something I have to consider when doing this, or is it just a manual process to nudge everything back into place?

- Also, for some reason, the decals on the walls are now all upside down? What's up with that?

Thanks again, getting close now... The portals really work great - if I temporarily remove the walls and floor I can see all the culling going on in the floor below as I move in and out of sight range of the stairwell portals. Very cool.
#3
07/06/2011 (10:06 pm)
Follow-up...

Solved upside down textures by just flipping the source images :)

Models line up perfectly if we export interiors to Collada without transform, and then bring the DAEs back in using the same co-ordinates as the original DIFs.

Now we're getting all the zones in and putting it all together, the culling is working great! Amazing performance boost doing away with the DIFs and putting working zones in...

Thanks to all for the help.
#4
07/11/2011 (9:59 am)
I'm just looking at converting DIF interiors into Collada too for the reasons you mentioned and have been doing a lot of work in investigating the results you get out.

There's a few performance gotcha's from using the editor to convert them:

1. Using Visible Mesh for the collisions can really very badly hurt performance if you have a bit of detail in your models, think of a flight of stairs to use every poly (visible mesh) for collision you're talking 100tris you can simplify that for collision to a flat plane and reduce to 2 tris -- plus you don't go bumping up and down slopes.

Decals and Shadows in BL can also use the collision mesh or visible mesh so by having good collision meshes you get the performance boost in all 3 areas.

Also T3D does collision hierarchically and will do a bounding box collision test on each section of collision mesh (COL-1, COL-2, COL-3) etc and for any that collide then it will perform the more expensive polysoup triangle level collision. If you manually create collisions you can be smart i.e. create COL-1 as lounge, COL-2 as kitchen and break up collision on just the room/area you are in.

If you use visible mesh I believe T3D bundles the whole mesh into 1 area so you'd have to test against the whole model.


2. Exporting Interiors to Collada also loses any LOD's you had in your interior and just exports the highest LOD so you'll to recreate all of them.

3. Because your Interiors are BSP based what you get exported to collada is the convex brushes which will contain a lot of unneeded polys - if you open up the file in 3DS Max you'll soon notice you could clean them up a lot -- some of our houses we've managed to reduce the poly count by about 40%. Again if you are using visible mesh for collision that helps too.

Hope that helps.