Jump to content

Rhythm game coding strategies


BideoWego
 Share

Recommended Posts

Hello from Bideo Wego!

 

bideo_wego_logo.png

 


 

I wanted to post about a music/rhythm based game I just uploaded on Kongregate.

 

mo_ritmo.png

 


 

Feel free to check out the promo too

 


 

 

What I specifically wanted to open for discussion is the strategy used to program the game. I used a helper program.

 

The helper program was created in Flex 4. It is used to create the level data for the game.

 

mo_ritmo_helper.png

 

Basically it provides a simple button interface in which I can click buttons that correspond to specific arrows being dropped at specific times (channel positions) in the As3 sound. It does this all by calculations according to the sound length and bpm which I provide.

 

An XML is generated that my game then can download from my server dynamically and read into a playable level!

 

This XML is savable and reloadable into the same program to allow for editing as well.

 

I would really like to create a version of this game with Phaser for HTML 5 and possible later a version for iOS and Android with Cocos2d. 

 

I wonder if anyone has done anything similar to this kind of project and has implemented a 'hold' feature in their rhythm game. In case anyone is wondering, this would mean that instead of striking and releasing keys/beats directly, the user would have to hold one or more keys until the end of a certain length (note duration) and then receive points or lose points based on the accuracy of that. This is another feature I'd like subsequent versions of the game to have, so if anyone is interested in talking about the coding strategy for that, it would be awesome!

 

Like I said if anyone wants to discuss how this is done, as it pertains to the music I figured this is the place to do it! Or feel free to just try out the game and tell me what you think!

 

Bideo Wego
Link to comment
Share on other sites

I did work on something that's a bit similar once. I have to say that the screenshot for the helper tool above looks way more complicated than what we did.

 

In our case the game was meant to be played with an xbox controller, so you could only press those 4 buttons (not too different to what you're doing here).

 

However, this is how we did it (it's quite simple): we had a guy who would listen to the song, and press buttons on the controller as the song was playing. This was done to generate some timing for the button events. Then we did a fourier transform of the song, and wrote an algorithm that would move the events slightly, so they would perfectly match peaks in the various components of the fourier transform (being aligned with a kick, or a clap, or whatever). It worked quite well.

 

Your game looks promising, though I have to say that if the interface was a bit more colourful I'd probably like it more.

Link to comment
Share on other sites

Coming from a videomapping community, this can also be done in After Effects. Search the youtube tutorials for something like "after effects synch to the music". Basically, you can make after effects generate keyframes based on any provided audio layer, and then export those keyframes to xml. AE is great for this, because you can fine tune the keyframes in a visual way, plus through binding the keyframes to a simple effect (like blip of flash) you can immediately see whether the result "looks and feels" right.

Link to comment
Share on other sites

  • 2 weeks later...

Hey! I'm glad to see some comments finally on my post! I really appreciate the thoughts! Although, from what I've already done vs. what I'm hearing here, I'm prone to add features/tweak my existing project and methods used rather than explore mapping to peaks in the audio. I'll explain a bit:

 

Because the xml generating program works with EXACT millisecond times as they correspond to beat positions in a measure, it is incredibly precise and as such there is no need to map anything from the audio it self. The audio playback in this program is simply there as a reference so I can place 'beat events' knowing exactly where they occur with the sound in the mp3.

 

As to discuss the UI of the game, yes I agree with Gio:

 

 

 

Your game looks promising, though I have to say that if the interface was a bit more colourful I'd probably like it more.

 

This was my first publicly released game, I'm anxious to improve it AND to write a version in Phaser! I'm brainstorming ways to improve the UI as we speak.

 

All together, I'm excited about the game's ability to be EASILY cross platform because of the core assets (mp3, xml) being completely language independent. 

 

As of right now the game only implements 'tapping' the beats, but I'm interested in implementing 'holding' for varied lengths as well. I'd be interested in hearing any experiences or ideas you all have had dealing with this issue. The obvious would be there has to be some sort of timer counting the length of time held. But the OCD in me wishes to program this feature elegantly and fit it into my helper program.

 

Good talk!

- Bideo Wego

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...