My question is related with Fixed time step vs Variable time step. But where a fixed frame-rate improve the consistency of a physics based game, is it the case for a rythm game, or wouldn't it be preferable to use a variable frame-rate ?
Say, I set the frame-rate to 100/sec, that will lead to an accuracy of 10ms, which is correct, but depending on the computer it will be possible to have a better accuracy. And if I set a too high frame-rate, some other computers may not follow, which may resolve in unsyncing the game and the music.
- The first solution that came in my mind is to use a variable frame-rate. This way, the game will not be unsynchronized with the music, but the accuracy is too dependent of the computer.
- Another, better, idea (I don't know if this is possible or not), would be to get the instant when has been pressed a key, and the accuracy will be no more dependent of the frame-rate. I'll make this game with LWJGL and I while reading the javadoc I found the method getEventNanoseconds(), and I was wondering how it is reliable since it's written "Only useful for relative comparisons with other Keyboard events, as the absolute time has no defined origin.".
What game loop method, do you think, is the most appropriate for a rythm game ? And for a rythm game with keysound ? Did you made a rythm game, or some game that require a good accuracy and how did you manage the updating ?
Thanks for your help ! :)