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.

Newcomers DBPro Corner / weird problem with sync,can someone explain?

Author
Message
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 12th Nov 2008 17:46
hi i added sync into my gosub

my code looks like:

phy update
sync

i run my game but its kind of slow,but if i take out sync
my game runs wayyy better!

can someone explain why this is???
i thought sync was supposed to make the game run faster.. ???

Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 12th Nov 2008 18:37
Sync is supposed to update the engine (ie. render your scene), and sleep (if neccessary) for a certain amount of time before doing so, in order to maintain a set framerate (as set with SYNC RATE).
So, it is nothing strange with it slowing down your game.
But since it apparently works anyways, I suppose that you have used SYNC OFF, which lets the engine handle the updates on its own.
If you then put in your own sync command, it will update twice per loop, which would naturally decrease speed.


-> Oh, come on...
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 12th Nov 2008 18:38
If you are using SYNC, then you must start your program like so:

SYNC ON : SYNC RATE 0

otherwise you are SYNCing, and DB Pro is also SYNCing on your behalf. In this example, the program will run as fast as possible. You can set a frame rate by replacing 0 with the relevant value.

Login to post a reply

Server time is: 2024-09-27 22:31:31
Your offset time is: 2024-09-27 22:31:31