I don't know how long this problem has existed, as I've never run this kind of test before. I discovered this by running stress tests with animated models. I was comparing boned animation to keyframe animation.
Boned animation, 50 identical models, same number of animations, Size, 242 KB.
FPS ranges from almost 240 FPS to 50, depending on how many models are on screen.
Keyframe animation, 50 identical models loaded. Size, 1.16 megabytes.
15 fps, no matter where the camera is pointing.
]
With keyframe animated models, the framerates don't change, whether I'm looking at 1, 3, or 25 models at the same time. So, obviously, DBP is not culling them when they're animated.
Here's a rather dramatic example of the culling problem with animated models...
Here's the code, but the entire project with media is included in the download link below...
Rem Keyframe Animation Culling Example
Rem July 19th 2006
Rem Cash Curtis II
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
rem _____ _ _ _ _ _ _ _
rem |_ _| (_) | (_) | (_) | | (_)
rem | | _ __ _| |_ _ __ _| |_ ______ _| |_ _ ___ _ __
rem | | | '_ | | __| |/ _` | | |_ / _` | __| |/ _ | '_
rem _| |_| | | | | |_| | (_| | | |/ / (_| | |_| | (_) | | | |
rem |_____|_| |_|_|__|_|__,_|_|_/_____,_|__|_|___/|_| |_|
rem
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
sync on
center text screen width()/2,screen height()/2,"Loading"
sync
color backdrop rgb(0,0,0)
sync rate 0
load object "export.x",1
set object filter 1,0
for i=2 to 50
clone object i,1
position object i,(i*2)-50,0,0
next i
make light 1
exclude object on 1
position camera 0.0,1,-2.0
for i=2 to 50
set object speed i,20
loop object i,72,96
`exclude object on i
next i
rem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
rem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
rem __ __ _ _
rem | / | (_) | |
rem | / | __ _ _ _ __ | | ___ ___ _ __
rem | |/| |/ _` | | '_ | | / _ / _ | '_
rem | | | | (_| | | | | | | |___| (_) | (_) | |_) |
rem |_| |_|__,_|_|_| |_| |_________/ ___/| .__/
rem | |
rem |_|
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
rem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
do
text 10,10,"FPS: "+str$(screen fps())
control camera using arrowkeys 0,.1,.08
Rem Keyframe object and animation culling
for i=2 to 50
if controlkey()
text 10,40,"Keyframe animation culling on."
if object in screen(i)
exclude object off i
if object playing(i)=0 then play object i
set object speed i, (200.0/screen fps())*20.0
endif
if object in screen(i)=0
exclude object on i
stop object i
endif
else
text 10,40,"Keyframe animation culling off. Hold controlkey and use mouse"
text 10,50,"to move camera to observe object culling."
exclude object off i
if object playing(i)=0 then play object i
endif
next i
` store old camera angle
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
` store new camera angle
CameraAngleY# = wrapvalue ( CameraAngleY# + mousemovex ( ) * 0.2 )
CameraAngleX# = wrapvalue ( CameraAngleX# + mousemovey ( ) * 0.2 )
` rotate camera
yrotate camera curveangle ( CameraAngleY#, OldCamAngleY#, 24 )
xrotate camera curveangle ( CameraAngleX#, OldCamAngleX#, 24 )
sync
loop
rem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
rem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Keyframe Animation Culling Example, 2.17 MB
Compile the program. You'll see a line of soldiers in a row. The framerate will be extremely low. Hold the control key and see manual culling being applied to the models. You can move the camera around with the mouse. Framerates jump from 15 to as much as 230 on my computer, depending on how many soldiers you're looking at.
This tells me quite conclusively that DBP is not culling. Of course I can manually cull them myself with 'exclude object on', but that's beside the point. This definitely appears to be a bug, and a potentially noob game killing bug at that. I imagine that every RPG has failed as soon as people started loading animated models into their world, as there is no reason to suspect that DBP handles animated models differently than regular ones.
And, it is possible to cull them, so there is no reason that DBP shouldn't be. DBPs culling would simply be faster than any manual calculations that can be made, so the problem should be fixed.
Thanks!
Come see the WIP!