Game Development Community

Large vehicles cause a freeze

by Jack Stone · in Torque Game Engine · 09/01/2005 (5:53 pm) · 6 replies

Well, its not really "freeze" but I get 0.7 FPS, which is pretty much a freeze.
Im working on a space-based game at the moment, which will have the player in a large capital craft instead of a fighter, so I need vehicles a lot larger than the buggy and things of that size.
I have a perfectly working starship in my game, at about 8 - 9 times the size of the buggy, but I need it to be a lot bigger. The problem is when I scale the model up in the engine, or export it at a larger size from max, I get 0.7 FPS when im looking at the model. (Normal framerate when its too far away to be drawn)
I looked at its collision box to see if it was causing performance problems, and it does seem to be calling its on::collision method a lot, but the problem still happens even hwen I scale the collision box down to a much smaller size.
I can get big models into my game no problem, they look great as static shapes, but once I set one as the .dts file to be used with the flyingvehicle class, the framerate drops.

I realise I can try scaling my game world down, instead of scaling my ships up, which may not be too difficult since space is big anyway, but I was wondering if theres somethign obvious im missing?

Also, if I do scale the game world down instead of the ships up, Is there a way to zoom the 3rd person camera view? At the moment my ship is sitting in the middle of the screen in 3rd person, and it look about the size of a shuttle or something. Can I zoom in the camera so that it fills the screen?
Thanks.
Jack

#1
09/01/2005 (6:47 pm)
The larger you collision shapes are in a DTS file the more time Torque has to spend doing Collision Tests. This as you have noticed causes some performance degredation and is the reason why really larger objects are not recommended as DTS shapes.
#2
09/01/2005 (8:41 pm)
Yes, I thought that would be why, but even with a small collision shape and a large actual mesh (The shape is a lot smaller than the mesh) I still get the problem.
But are you saying that its possible to use something other than a DTS shape for my purposes? Ive read about movable DIF shapes and people using those for ships and different things, which is something I could use, but im not sure how to get them working. I mean I could never have the detail I want in a DIF shape, even if I could fly it around somehow.
#3
09/01/2005 (10:47 pm)
Well... You could try to make a .dif (as the basic structure) and add in prefabs into/onto it.
#4
09/02/2005 (12:46 am)
Jack, I had the same problem as you described. The collision mesh was also for me not a problem. I always thought I did something wrong while modelling my large space ship, but it seems like you have the same issues.

I tried also to minimize the collision box to a very minimum to reduce the los/col tests, but that didn't help either.

Hope you find a solution for this - I wasn't successfull until now.

Martin
#5
09/02/2005 (4:17 am)
Remove the collsiion completely, see if you still have same perfromance.
#6
09/02/2005 (10:37 am)
Westy, I tried that, but you need to have at least one collision mesh in a Vehicle shape otherwise Torque will crash. Ill look into this moveable dif idea though, that might actually work out better than my original plan.
Jack