Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Sync Rate and Frame Rate

Author
Message
Hamish McHaggis
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 31st Jan 2003 15:47
I am wondering what exactely the sync command does. All I con see is that it speeds up the rate that you go through the loop. This is annoying as when you make a game you set the gravity and speed of everything for example, and if you increase the sync rate it may increase the fps but it also speeds everything up. Is there any way to speed the frame rate up without speeding the game up?
Yum! Yum! Yum! Yum!
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 31st Jan 2003 18:43
The SYNC command simply tells DarkBASIC to refresh the screen. So at that point in your program, whatever has happened since the last refresh is then displayed.

It's nothing to do with "speeding up" your program, more to do with controlling it.

If you use "SYNC OFF" then DB itself will control when it refreshes the display.

If you set "SYNC RATE" to 0 then the program will execute as fast as possible - as in when it hits a SYNC command it'll refresh instantly. If you set "SYNC RATE" to something like 30 then when it hits a sync it will check to see if 30 frames have elapsed since the last refresh and then time it accordingly.

DB can and will refresh the screen of it's own accord as well if you leave your program long enough (basically the video memory fills up).

So - yes your "gravity" will appear to run faster because you've opened up the throttle, but if you make your main loop run on a timer system this won't be an issue - it's all down to how you code.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming

Login to post a reply

Server time is: 2025-05-15 10:15:03
Your offset time is: 2025-05-15 10:15:03