TX3D low frame rate: How-To tweak your scene
by Giuseppe De Francesco · in Torque X 3D · 04/28/2010 (5:19 am) · 2 replies
While fixing the engine memory leaks I banged my head on the frame rate drop playing the FPS Demo Physics on the XBox. After a lot of headaches I've discovered that the in the collision system this issue has already been addressed but isn't documented anywhere, so here I am to share my finding.
The RigidCollisionManager has a few properties that have been exposed to tweak this:
MaxUpdateSetp (yes, it's mistyped but better not to change it to keep the scene file compatibility!)
ResolveCollisionSteps
ResolveContactSteps
There is also another one: ShockSteps but this has 0 as default so ignore it unless you want to use this feature.
The default values are set as follows:
MaxUpdateSetp = 0.01f
ResolveCollisionSteps = 5
ResolveContactSteps = 10
These "steps" are loops performed at each frame, so when you have a lot of rigid bodies in your scene you need to change those values to achieve the proper result. In the FPS Demo I got good results changing the XML in the desertPhysics.txscene file
from this:
<RigidManager type="GarageGames.Torque.T3D.RigidCollision.RigidCollisionManager" name="RigidManager" />
to this:
<RigidManager type="GarageGames.Torque.T3D.RigidCollision.RigidCollisionManager" name="RigidManager">
<MaxUpdateSetp>0.035</MaxUpdateSetp>
<ResolveCollisionSteps>4</ResolveCollisionSteps>
<ResolveContactSteps>9</ResolveContactSteps>
</RigidManager>
I hope this helps ;)
Pino
The RigidCollisionManager has a few properties that have been exposed to tweak this:
MaxUpdateSetp (yes, it's mistyped but better not to change it to keep the scene file compatibility!)
ResolveCollisionSteps
ResolveContactSteps
There is also another one: ShockSteps but this has 0 as default so ignore it unless you want to use this feature.
The default values are set as follows:
MaxUpdateSetp = 0.01f
ResolveCollisionSteps = 5
ResolveContactSteps = 10
These "steps" are loops performed at each frame, so when you have a lot of rigid bodies in your scene you need to change those values to achieve the proper result. In the FPS Demo I got good results changing the XML in the desertPhysics.txscene file
from this:
<RigidManager type="GarageGames.Torque.T3D.RigidCollision.RigidCollisionManager" name="RigidManager" />
to this:
<RigidManager type="GarageGames.Torque.T3D.RigidCollision.RigidCollisionManager" name="RigidManager">
<MaxUpdateSetp>0.035</MaxUpdateSetp>
<ResolveCollisionSteps>4</ResolveCollisionSteps>
<ResolveContactSteps>9</ResolveContactSteps>
</RigidManager>
I hope this helps ;)
Pino
About the author
In the software eng. field since 1981, in charge of R&D during last 10 years. IEEE Senior Member (and volunteer).
#2
04/28/2010 (3:30 pm)
Well, RigidManager is just the created object name, the class' name it is indeed RigidCollisionManager ;)
Torque 3D Owner Henry Shilling
Smokin Skull
so it would be:
<RigidCollisionManager type="GarageGames.Torque.T3D.RigidCollision.RigidCollisionManager" name="RigidManager"> <MaxUpdateSetp>0.35</MaxUpdateSetp> <ResolveCollisionSteps>4</ResolveCollisionSteps> <ResolveContactSteps>9</ResolveContactSteps> </RigidCollisionManager>Is that right? The new default when you create a new project no longer contains RigidManager.
However it does seen to work both ways...