Korean Translation by theo5970

**Original post (on /r/gamedev)**

Note: I wrote this post originally after I made the jam version of the game A Dance of Fire and Ice.

So let's start from the very beginning. How do you make a rhythm game? Well..

I've done rhythm games a few times, and in fact they're the only kinds of games I've seriously worked on and ever want to do. And when I first started I found there wasn't much documentation around for the general architecture of rhythm games. So, this is meant to be a quick and dirty technical guide to how I approach my game architecture, using our game ADOFAI as an example.

First, you might want to see this video for an explanation of the main mechanic of this game.

1. In a rhythm game, have a class that is used solely for keeping the beat.

In my games I call it the Conductor.

It should have an easy function/variable that gives the song position, to be used by everything that needs to be synced to the beat. In this game for example, the Conductor has a variable called songposition which is pretty much the cornerstone of everything in the game.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/c86b57c3-c75e-4ff8-bf7c-5b3179f9ca36/Untitled.png

The above are the variables in the Conductor class. Some are specific to my game, but the general ones that I always have are

[code] songposition = (float)(AudioSettings.dspTime – dsptimesong) * song.pitch – offset;[/code]

Aside: the song.pitch is an inbuilt variable in Unity that gives the speed the song is playing at. By incorporating it into my song position variable, I can change the playback speed and still keep everything in sync. This was used in my game to slow all the songs down 20% because I only realised after composing the music that it was too difficult.

Anyway, now that we have set up our Conductor, time to take care of the objects that need to sync to it!

2. Every object that needs to be in sync should do so using only the song position, and NOT anything else.

This means, NO timers, NO tweens. It won’t work consistently!