Thanks for the demo.
I've just tried it and the results are a bit odd. Without the spacebar I get a steady 15 fps (

). When I press and hold the spacebar the fps gradually drops. I kept it pressed for a few minutes and got bored after about 4 minutes by which time the fps had dropped to 5. Surprisingly it stayed at that level when I released the space bar.
I also tried using play object instead with much the same results (you'd probably need to adjust the speed or something if you want to use that).
I've no idea what should cause a gradual slowdown like that unless one of the commands has a memory leak - and I can't recall how to check that.
I also tried using sync with my native desktop resolution but other than getting much cleaner objects the results were the same. Here's the final code I tried:
set display mode desktop width(), desktop height(), 32
sync on : sync rate 0 : sync
autocam off
load object "raknos_low.x",1 : scale object 1,25,25,25
position camera 100,100,-50 : point camera 100,0,100
objnum = 2
for x = 1 to 10
for z = 1 to 10
clone object objnum,1
position object objnum,x*20,0,z*20
inc objnum
next z
next i
do
text 5,5,"FPS: " + str$(screen fps()) : inc counter,10
for o = 1 to 101
yrotate object o,wrapvalue(counter/10)
` if spacekey() = 1 then set object frame o,object frame(o)+1
if spacekey() = 1
play object o,object frame(o)+1
else
stop object o
endif
next o
sync
loop
As a final experiment I tried using fixed numbers in the play object command like this:
play object o,100 `object frame(o)+1
When I do that I get no lag if I set the fixed value to 0, a fall from 15 to 13 fps when I use 100 (as in the snippet), to 12 fps when I use 200 and so on.
This is a pure guess but it makes me wonder whether DBPro is somehow looping through all the frames till it finds the one you specify in the set object frame or play object commands. That would explain the gradual slowdown. If that is the case then it seems as if you need to make sure you use those commands sparingly, i.e. only when the animation sequence has changed. You would then get a lag in just the sync when the change occurs and shouldn't be noticeable.
However, that theory doesn't explain why the lag persists when you release the space bar. That makes me wonder whether this "behind the scenes" looping takes place every sync. In the following snippet, for example, the frame number seems to increase as the FPS drops till the frame reaches 500 when the objects are reset to frame 0 and the fps returns to its original value.
Perhaps someone with more experience of animations has a suggestion.
set display mode desktop width(), desktop height(), 32
sync on : sync rate 0 : sync
autocam off
load object "raknos_low.x",1 : scale object 1,25,25,25
position camera 100,100,-50 : point camera 100,0,100
objnum = 2
for x = 1 to 10
for z = 1 to 10
clone object objnum,1
position object objnum,x*20,0,z*20
inc objnum
next z
next i
do
text 5,5,"FPS: " + str$(screen fps()) : text 5, 25, "frame: " + str$(object frame(1)) : inc counter,10
for o = 1 to 101
yrotate object o,wrapvalue(counter/10)
if spacekey() = 1
play object o,(object frame(o)+1) mod 500
else
stop object o
endif
next o
sync
loop
Sorry about the lengthy post.
Edit The only suggestion I can think of is to use lower poly objects if you need that many on screen at once. I don't know for certain whether that would reduce the problem though.