Quote: "Are you using animated models that are "in step" with each other? I believe DBPro uses a rather crude way of finding out which animation frame it should be using each sync for each animated object."
I'm not entirely sure if I understand what you are saying. I wrote my own functions to handle the animations so I had more control over their timings. I never use the commands
play object or
stop object, instead I use a variable called
frame# which increments and decrements manually, and I update the unit's frames with
set object frame frame#.
Also note that the units are all using a fastbone shader.
Quote: "1. You need to take a hard look at everything happening inside of that sync timer."
There's not much to look "inside" of the sync timer, because this is the code:
time_elapsed = hitimer( 1000000 )
sync
time_elapsed = hitimer( 1000000 ) - time_elapsed
Quote: "2. You also might have some problems outside of the timer, such as culling being completely disabled everywhere on extremely rare scenarios due to possible bugs, so check all culling routines. The fact that a "world timer" is also high seems to imply the problem could be related to culled objects."
The world timer is high because it controls the Fog of War updates. More technical information on that can be found here :
http://www.youtube.com/watch?v=43AmR6XiV80
Quote: "3. You might be using a 2D graphic function somewhere, even in an extremely rare scenario. This can produce rapid reduction in frame rate."
I'm using image kit to render 2D images. Again, even if images would be the problem, it doesn't explain why the frame rate suddenly drops.
Quote: "4. The sound system is linked to sync in some small ways. I am aware that things like listener position changes seem to update only when sync is called not when the actual movement command is used. There could be more to this."
Currently no sounds in PonyCraft yet.
Quote: "5. You may be having issues with texture memory. If the game needed to move a lot of texture memory on the hardware level, this can produce a noticeable lag. Some of the textures being used may be sitting in RAM and not VRAM. This may be caused by having too little VRAM on the video card. Try reducing textures, or to debug, tie everything to the same texture. Also check your shaders, to see if you are doing anything periodically that causes a massive reload of some kind.
6. Some other process on your computer might be taking to many resources on rare instances, causing bottlenecks in performance. An excellent example would be an Anti-Virus intercepting file access of your program, and taking too much time."
I ran this on a nVidia GTX 580 (1500 MB VRAM) so I doubt that's the problem, but I'll check into that.
Quote: "7. I see you have the beginnings of one of those fancy 3D map/radar hud things. The additional camera, or radar/map itself might be in some way causing this. Try completely disabling this feature, including the extra camera, and any and all supporting code."
The minimap is just an image, no extra camera used.
Quote: "It sounds to me like you need to do some code profiling. Put timers around code blocks and see were your real performance issues are. "
Screen shot does just that.
Quote: "Are you using vsync per-chance? If the frame rate dropped even a little below 60 it would then be locked down to 30 (my understanding at least) which sounds like it could be very easily your issue as it is the sync command which would then be 'waiting' behind the scenes before allowing the program to continue."
Nope, vsync is disabled and sync rate is uncapped. Everything in the game is handled with timer based movement.
TheComet
"Why geeks like computers: unzip, strip, touch, finger, grep, mount, fsck, more, yes, fsck, fsck, fsck, umount, sleep." - Unknown