Guitar Hero-like Timing Mechanic

I'm currently working on making a game inspired by Guitar Hero and Frets on Fire, so far so good - I've written a script that can parse the .chart files created by FeedBack Editor into payload .

My concern is how will I make sure the times are correct (I will have to convert these beat values ​​to ms instead of) _? The files I'm processing store values ​​like this:

0 = N 1 120
120 = N 2 120
240 = N 3 576

      

In cases where the first integer is in some measure, a note has to happen, N is whether or not the note is a hammer, then Fret ID_ (green or red, etc.) _ and the length of the note, again in bits.

I'm worried that songs will get out of sync easily if sudden FPS spikes are lagging behind, what might be preventing it from getting out of sync?

I've tried searching sources to find out how confident they are that the timing on the notes is correct, but I can't find anything helpful.

+3


source to share


1 answer


This is a tricky issue because it depends on your audio player API. For it to work properly, you will need to have a function in your player that returns the current playback position. Let's say your API player has a way to get the position in milliseconds.



I would do the synchronization in my own code, because if you use a value inside lua the GC might explode and throw you out of sync. Just use lua to analyze timings and create arrays of structures (or something similar) for your own code.

+1


source







All Articles