Hi, i've been working on my game, and i have come across an annoyingly confusing problem. Sync rate. From my knowledge, most comercial games these days start with v-sync off, but you can turn it on. I understand that a program running without v-sync is like using the command:
sync rate 0
and a program with v-sync on is like putting this in your main loop:
sync rate screen fps()
the thing is, i suppose it doesen't matter what the screen fps OR the main loop frequency is, but i want the actual game to have the same pace regardless of how crappy the user's computer is
. For example, to handle just the physics, i might:
do
(commands)
rate#=60/screen fps()
updatephy#=updatephy#+rate#
variable#=updatephy#-prevupdates#
if variable#>=1
phy update
variable#=variable#-1
prevupdates#=prevupdates#+1
endif
if variable#>=1
phy update
variable#=variable#-1
prevupdates#=prevupdates#+1
endif
if variable#>=1
phy update
variable#=variable#-1
prevupdates#=prevupdates#+1
endif
loop
that way the physics would run at 60 hertz, regardless of the screen fps. is someone was getting 30fps, the physics would update twice each loop. if someone had 120fps, the physics should update every other loop. any wierd number, and the physics should still update at approxamitley 60Hz.
My question is, is that they way you would do it? How would you do it? Is it worth the trouble? If not, should I just limit my users to 60fps regardless of their computer, or perhaps have a "low performance" mode which limits users to 30fps and updates the physics and things twice per loop?
hmmmmm... KTHXBAI
*´¨;
¸.•´¸.•*´¨; ¸.•*¨;
(¸.•´ (¸.Eviljackson1