Advertisement

Threading DDraw and sprite updating?

Started by February 27, 2000 06:57 PM
0 comments, last by SikCiv 24 years, 9 months ago
Dont no if this is the best way to do it, but my games'' main loop blasts the GFX as fast as it can, sometimes reaching around 120 frames in window mode, and around 76 in Fullscreen, whilst a single multimedia timer running 100 times a second updates my sprites and inputs. Is this the ''normal'' way to time things, or should I run the screen updates using some kind of timer system, limiting the frame rate to 60FPS? The problem is, in Win2K u can see the CPU usage, and my app is using 99% while running apps like winamp and PSP6 in the background. Ive ran other games, and they only use up about 17% (and they''re in S/W 3D)!! How is this possible?

  Downloads:  ZeroOne Realm

You should set a hold-down timer (ie, 60 FPS) to make sure that your game doesn''t go too fast. I know this seems weird, but if you''re playing your game on a machine with twice the power of yours, it will be unplayable due to the fact that the sprites won''t work at a "normal" pace -- they''ll just blast ahead as fast as possible (play Ultima 7 and see what I mean). This timer also makes sure that the rest of the system has access to resources during the sleep duration (and will fix the "99%" issue you''re having). Plus, the fact that your sprites are updating at 100FPS, there is really no need to be blitting the back buffer to the primary every frame, only when the sprites update.

I would benchmark your game on a system with the minimum system requirements you recommend and set your FPS from that machine. I do all of my coding on a Toshiba 550 p166 with 64 megs of RAM (piece of crap with no hardware support and 2 megs vram). If I can squeeze 60FPS here, I can do it on any system

-Chris
---<<>>--- Chris Rouillard Software Engineercrouilla@hotmail.com

This topic is closed to new replies.

Advertisement