I’m currently working on a prototype for a bit of an unusual rhythm game.
Due to the fact I’d be handling mass amounts of songs, I’ve tried to resort to sound.PlaybackLoudness (though not perfect by any means) as a way of quickly “key framing” a song to find out when the music peaks, beats happen, etc. Then, using this info, syncing certain “game elements” (moving parts, GUI screens, lights) to the music.
The only problem (from what I’ve read on other dev-forum posts) is that PlaybackLoudness only reads a value when the sound is played on the client, not the server.
Which is a big issue for me as these “game elements” have a bit of random generation for their effects. In other words, when a “key frame” of a song plays- the synced element might not always be the same pattern for a light flash, or the same stable/repeatable effect. I rely on server → client replication to make sure these generated effects match across all players. As any sort of mismatch could badly mess up the game play.
If I can’t rely on server side scripts to generate “key frames” for these “elements” via the PlaybackLoudness though. That would mean I’d have to run it client side and get back any data I would need that way. (Right?)
Which brings up the confusing problem (to me) of bringing back this large amount of key frame data over the client-server boundary, and leaves me with these questions.
- What would be the best way to do that?
- How do I pick what client(s) to run the “key framing” script for the song on?
This is seriously important as the generated keyframes passing over from the client would be used to sync elements for every other player. If not done right the core game play would be toast.
- Is there any way to avoid these issues? (I mean am I going about this all the wrong way?)
Hopefully that’s a good enough explanation. Feel free to tackle this in any way you’d like, I’m honestly at a bit of a loss so any advice would be appreciated. Thanks in advance though to anybody who takes time to reply
If anything I tried to explain is confusing, please ask me questions and I’ll reply ASAP with more detail. I’d like to note I do have some code written, but I’ve chosen to leave it out for the moment and just have a more open discussion.