Game Development Community

Scaling cheetah drops fps to 0.5 !

by Ahsan Muzaheed · in Torque 3D Professional · 12/19/2012 (8:02 pm) · 2 replies

game/scripts/server/cheetah.cs

function CheetahCar::onAdd(%this, %obj)
{
   Parent::onAdd(%this, %obj);

  .............
  ..............
   
    
  //%obj.setScale("3 3 3");//fps ok 
  %obj.setScale("4 4 4");//fps drop to 0.5 
    
}

last line is the culprit.
using something bigger than 3 is dropping fps.
i did try on other places but still the same.

but if u try to scale on world editor's inspector panel then it is ok only if scale factor is smaller than 8.
but if u try 8 or higher value than again fps drop to 3 or 4.
i think it differs from pc to pc.

why it is happening?

About the author

Torque 3D enthusiastic since 2010.Have been working in several T3D projects besides of Unreal Engine 4 and Unity 3D. NEED a hand with your project? SHoot me a mail. http://www.garagegames.com/community/forums /viewthread/138437/


#1
12/20/2012 (1:36 am)
First step: use the profiler. Hold down Ctrl+F3 for a second or two before the scaling, and then after it, and compare the two dumps. Or at least post them here for us to get a look at!
#2
12/20/2012 (5:28 am)
ok.i will post them.
for now if u want to test just do this:

copy full template.
open empty terrian.mis

add cheetah.
scale it to "5 5 5".
everything will be ok.

close the game.
now restart terrain.
it will hang(seems hang,but t3d actually became slow.for me it start game 20 minute later).

now again close t3d.

open "empty terrian.mis" with notpad.
and edit:

new WheeledVehicle() {
  dataBlock = "CheetahCar";
      .......
      scale = "5 5 5";//"1 1 1";//

to
new WheeledVehicle() {
  dataBlock = "CheetahCar";
      .......
      scale = "1 1 1";//"5 5 5";//

it will load ok.