So I'm making a Guitar Hero sort of game. I know you guys think it's impossible, but I think I found a way around it. I have the actual game and a rhythm editor. You can choose your own song in the editor and then create beats for it. During that there's an array which records which bumper you pressed at which time in the frame (milliseconds since start of frame).
The actual game loads the music file, array, and a ini file. I almost go it to work, but since all the notes are triggered by time, some miss the action which screws up the song.
Here's both .mfa files, and a test file (music, array, ini). Please help me. I thought about fast loops but then the rest wouldn't work such as the score.
I've got homework but I'll look at it later. But don't use time though, use a counter. Many times people use the built-in timer to do things that can only be accurately done with a counter or alterable value.
Well if a counter was used and the frame rate varied during the course of the game the notes would eventually be off by a lot. So in this case a believe basing the game on real time would be more appropriate.
I tried this once a few years ago and never got the timing to work. :\ It looked really cool and it would record the notes, but after awhile it would always de-syncopate. I'd like to find a solution to this as well. (Accordion Hero. >:})
I never had a problem using a counter that had the time of the song playing dumped into to. I was using direct show I think. So basically, the counter counts up as the song plays (not since the beginning of the frame), then I had my array based off this.
It is difficult to make rhythm games, especially with the method you are using, because you need a system that causes notes to scroll depending on the BPM of the song. Even if you get the basic bpm of a song down, creating synced charts can still be difficult since BPMs tend to drift . . .a lot.
Basing it on time would work to an extent, but it is just a rough work around. The only way I can think to do it(work around or not) would require tons of manual coding in order to make the notes perfectly on sync with the song - which is definitely possible, but not efficient.
I'm defiantly going to make a game out of this now, thanks for the inspiration!
This song was pretty easy cause the bpm don't variate much. It was fun to make too!
It doesn't have any game element to it yet, so just watch the first frame through to understand whats going on then check the code. Also you'll need to extract it to a directory in order for the mfa to access the ini.
EDIT: The only thing that messes up the timing is if the application loses focus or if the frame rates to low. A fix to this would be to make the counter that keeps track of the notes always set to the timer divided by the bpm (or whatever you use for timing.) Then make the game check to make sure all the note between a space of time are present by using a loop. Sounds Fun
Hmm, using realtime to time it would certainly be needed
you'd need an external file defining when the beats (and what type) enter the screen that's loaded and run in. say a beat takes 5 secs to go down,you check position of the song, if it is5secs ahead of when the beat is to be hit, you create the beat, and you constantly set it's position and size (if it grows as it gets closer GHstyle) to further own and larger according to the time, where 0secs past is at the top, 2.5secs past is halfway and 5secs passed is at the bottom. my MMF is updating atm, but im sure you get return the system time in a numeral value, so it can all be extrapolated from that. You'll obtain a frame independent this way too.
I am fairly certain that the machine independent speed option does this,effectively renders the screen when it can, but tries to maintain the fps in the event editor, so if something is meant to move across the screen in5 seconds, evenifthe fps rops by half, it'll get there in 5seconds.