How to limit FPS?
#1
Posted 01 May 2012 - 01:23 PM
send it to someone else it won't work. I thought the debug.exe was the compiled game, but apparently
it isn't. What am I doing wrong?
The error says the configuration isn't right and it mentions the file sxstrace.exe.
Rimevan
#2
Posted 01 May 2012 - 01:42 PM
#3
Posted 01 May 2012 - 01:55 PM
EDIT: Nevermind, I found out how to create the release version. Thanks for helping me!
Rimevan
#4
Posted 02 May 2012 - 12:08 PM
it is insanely fast (game is not playable this way). I thought the solution would be to restrict the framerate to a certain amount, but I don't
know how I could do that. I use Visual Studio 2008. Does anyone know how to limit the fps (or tell me why the release version is way faster
than the debug version)?
Rimevan
#5
Posted 02 May 2012 - 01:20 PM
if ((timeNow - timeOfLastFrame) < (1 / fpsSetting))
{
// don't render
}
And, multiple divergent topics in one thread is 1) frowned upon, and 2) counter-productive, as people who have read the thread will not know to come back in because you switched conversation topics.
#6
Posted 02 May 2012 - 01:23 PM
http://www.koonsolo....tters-gameloop/
http://gafferongames...-your-timestep/
The reason the release version is faster is because the compiler will optimize the machine instructions more for the release. It will also skip some safety checks etc. I don't know very much about compilers and debuggers, but I believe having the debugger monitoring the execution also slows it own a lot.
#7
Posted 02 May 2012 - 02:06 PM
alphadog, on 02 May 2012 - 01:20 PM, said:
if ((timeNow - timeOfLastFrame) < (1 / fpsSetting))
{
// don't render
}
And, multiple divergent topics in one thread is 1) frowned upon, and 2) counter-productive, as people who have read the thread will not know to come back in because you switched conversation topics.
I'm sorry for not creating a new topic, I will create a new one in the future.
geon, on 02 May 2012 - 01:23 PM, said:
http://www.koonsolo....tters-gameloop/
http://gafferongames...-your-timestep/
The reason the release version is faster is because the compiler will optimize the machine instructions more for the release. It will also skip some safety checks etc. I don't know very much about compilers and debuggers, but I believe having the debugger monitoring the execution also slows it own a lot.
So based on 'The speed of your game should never depend on how fast your computer is' I could just slow everything down and it would be the same on every pc? In that case I could just let it 'sleep' every
other second to solve this.
Rimevan
#8
Posted 02 May 2012 - 02:11 PM
It pretty much comes down to getting the time difference between 2 consecutive frames and use that to make everything frame-rate-independent.
#9
Posted 02 May 2012 - 02:15 PM
Rimevan, on 02 May 2012 - 02:06 PM, said:
other second to solve this.
Well, that would slow it down, on average. Between the sleeping periods, it will still run just as fast, and it would be unplayable.
What you want is to make the simulation slower, while continue rendering with as high FPS as your monitor can handle.
You probably don't want to call sleep(), since you can't be sure your game will "wake up" in time for the next frame, and you'll get strutting animation. If you use v-syncing, the driver should block while waiting for the next frame anyway, so you won't burn CPU cycles and battery life for nothing.
#10
Posted 02 May 2012 - 02:26 PM
Rimevan
#11
Posted 02 May 2012 - 03:48 PM
#12
Posted 02 May 2012 - 04:23 PM
alphadog, on 02 May 2012 - 03:48 PM, said:
The game is just one file, so it skips everything, not just the rendering.
Rimevan
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












