Game Development Community

Big slowdown when model near terrain

by Frank Bignone · in Torque Game Engine · 01/04/2002 (4:22 am) · 5 replies

I experience very big slowdown when my airplane are near the terrain. After profiling the game, it seems that this function : mConvex.findClosestStateBounded(...) is very time consuming.

I'm currently working on this, but I will appreciate any help or hints.

Thx

About the author

Real programmers don't waste time recompiling; they patch the binary files... ... Real programmers don't waste time patching binary files; they patch memory.


#1
01/04/2002 (8:19 am)
yes i noticed the same thing with vehicles ive put into the game. running the release version is a better (less slowdown) but still not quite right
ryan
#2
01/04/2002 (1:34 pm)
Yes, unfortunately Tribes 2 had a similar problem.

I believe the collision detection for the bounding boxes around vehicles is chewing up A LOT of resources, and this is no joke.
#3
01/04/2002 (4:52 pm)
You can try this.

When you fly high and crash really hard down, everything stuck.

greetings
Daniel
#4
01/06/2002 (3:19 am)
I tried the release version. It is still *very* slow.
I may be doing something wrong...

cu+
#5
01/06/2002 (10:56 am)
After digging a little bit, and experiencing with the code, I came up with something more than acceptable.
To give you some tips, here it is:
1. Check the updateWorkingList, and tailor it according to your model physics (for the newLen calculation).
2. For ShapeBaseConvex convex attribute, it's is better to have a collision mesh with *few* triangles (no more than 30) or you will experience very big slowdown.
3. In the Convex::getCollisionInfo, you may factorize a little bit the code, by doing the inverse calculation of mat only once. Also, tailor the tol parameters to your need.
4. In CollisionState::distanceBounded (and distance), you may change the max number of iter to something smaller than 100, it will also help (do not set it to something too small, or you may get incorrect result)
5. In the updatePos function, put also a maxIter in the max loop.

I ended up with very few slowdown. I can notice some slowdow only when I'm in free-look mode (camera) and I turn around my plane which is just on top of the ground.

I get a crash on the waterworld map, and I will look at that now.

Futhermore, I wonder if we can have LOD collision meshes, and the engine automatically select the good one (for speed purpose as collision is done also on the server and it may be difficult to handle many vehicules on the server).