mystery slowdown

Blitz3D Forums/Blitz3D Beginners Area/mystery slowdown

ryan scott(Posted 2005) [#1]
i am not clear why my program is slowing down.

it happens when i have a lot of enemies on the screen, however it depends what they are doing.

if they are all within the area of the camera, not very far away, everything runs fine.

if they go off into the distance, i start to get major slowdown, down below 2 fps. even if i'm not viewing them it happens.

i tried using collisiontime to see if anything was taking very long, but the numbers don't really change.

can anyone guess from this information what could be causing my slowdown? is there something about having objects really far away that could cause this?


Baystep Productions(Posted 2005) [#2]
Umm, usualy its the optimization of you AI scripts.
But the camera thing doesn't make much sense. Code optimization could overcome some of this like occlusion and stuff. Only executing the bare minimals.


ryan scott(Posted 2005) [#3]
hmm i have no AI. They are moving forward, colliding with the surface, adjusting their position to match it. I mean, they are pretty dumb.


octothorpe(Posted 2005) [#4]
Make sure you can measure the problem - check how many Millisecs() a frame takes with the camera "near" and the camera "far".

Reduce the problem to the simplest case. Remove parts of your program until you can no longer demonstrate the difference in performance depending on where the camera is. If you've reduced your program as much as possible and can still reproduce the problem with a tiny amount of code, post it.


Ross C(Posted 2005) [#5]
Do a polycount readout for far and near also. See what numbers you come up with.


Happy Sammy(Posted 2005) [#6]
Hi all,

I think your program needs LOD (level of detail)

Sammy
:)


Sledge(Posted 2005) [#7]
Do the objects always end up far away from the camera? If so, you need to keep them close and test again to determine if distance from the camera (rather than the amount of time the program is running) really is the cause of your woes.


jfk EO-11110(Posted 2005) [#8]
the only reason for this I can think of is Linepick, that may be slow the longer the picking range is. So if you do a lot of linepicks from the camera to the enemies, this could be a reason. Although - 2 FPS - that sounds more like a fundamental design mistake of the app structure.