Jump to content

  • Log In with Google      Sign In   
  • Create Account


Real time vs Set time calculation of music game note timing


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Roukiske   Members   -  Reputation: 106

Like
0Likes
Like

Posted 16 December 2012 - 04:54 PM

Hello everyone, first post of what I hope to become many posts here at GameDev

I am creating a small music game and I've come across 2 ways I could implement timing in it. I could either have the game setup the time each note must be hit before the song starts (Set time) or have the game calculate the timing offset using the current note position and the target note position (Real time). I am asking this because I will be taking into account song charts that include different BPM throughout the song such as slow downs, speed ups, and stops. This adds more complexity to the calculations. I would just like an opinion on how someone would choose which way to implement the game. I have already made an algorithm to find out these numbers in both situations.

Some pros and cons I thought about each implementation:

Real time
+ Decrease the time it takes to setup a song
+ More accurate time
- Incease the time it takes the program to find the timing offset during gameplay

Set time
+ Decrease the time it takes the program to find the timing offset during gameplay
- Increase the time it takes to setup a song (Negligable?)
- Extra parameters such as note.hitTime in the note class
- Prone to bugs in timing since the time is a setTime that may or may not be correct

Thank you for your time everyone

- JackStylez

Sponsor:

#2 L. Spiro   Crossbones+   -  Reputation: 12249

Like
1Likes
Like

Posted 16 December 2012 - 05:47 PM

Whatever you are doing to play the song, do the same thing to handle the timing of any events related to the song. I expect you would be using your “real-time” method for both.

As for changing of the tempo, either way you would have to determine where the beats are so you would still have to do the more complex calculations one way or another.
The best way to go would be to pre-calculate the times of events but to process the list in real-time.


L. Spiro
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#3 Roukiske   Members   -  Reputation: 106

Like
0Likes
Like

Posted 16 December 2012 - 06:02 PM

Whatever you are doing to play the song, do the same thing to handle the timing of any events related to the song. I expect you would be using your “real-time” method for both.

As for changing of the tempo, either way you would have to determine where the beats are so you would still have to do the more complex calculations one way or another.
The best way to go would be to pre-calculate the times of events but to process the list in real-time.


L. Spiro


Ah this is very true thank you. I will still need calculations to compute where I am in the song, so I might as well use that data at the same time instead of calculating it twice. I still have not looked up playing music files through openGL in C++ so I don't know about the music playing method yet, but that helped a lot.

- JackStylez

#4 L. Spiro   Crossbones+   -  Reputation: 12249

Like
1Likes
Like

Posted 16 December 2012 - 06:44 PM

OpenGL is for graphics. I think you meant OpenAL.


L. Spiro
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#5 Roukiske   Members   -  Reputation: 106

Like
0Likes
Like

Posted 16 December 2012 - 06:47 PM

Right, openAL. Force of habit to type openGL for me haha

- JackStylez




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS