Valkyrie Dev Blog #6 – The Arrows!

Hi. This may very well be the last dev blog in which I talk about arrow scrolling. The reason for that? I’ve finally got it working!

This week has been huge in terms of advancements in the codebase. I am incredibly pleased with how things have progressed lately, because now the arrows sync up and scroll with the music. This should in theory work with any StepMania simfile, although I’ve yet to do extensive testing.

So I actually had the issue mostly solved on Tuesday afternoon, but it still wasn’t working. First discovery was that StepMania considers a quarter note to be 1.00 beats instead of the 0.25 beats I had assumed, eighth notes are actually 0.50 beats instead of 0.125, etc. Simple solution – just multiply all beat offsets by 4. It feels a bit cheap, but it’s really the only way to do it.

So after that, all arrows were generating with the exact same time offsets as what the StepMania song editor showed for the notes, but for some reason, it still was not in sync. I was utterly stumped, so I turned to an online forum for help.

The issue? Apparently my timer code was wrong! The arrows were, in fact, perfectly in sync with my timer…it’s just that my timer wasn’t in sync with real seconds. After a bit of shuffling around of the code and a small change to how it counted time, I went to test and…it worked!

So right now arrows scroll properly, even in songs with BPM changes. I still need to make some tweaks to how BPM changes are handled, though. Right now, all arrows scroll at the same, constant speed. Since I’m using time offsets, they end up at the receptors at the right time, but the scrolling speed really should speed up or slow down to reflect BPM changes. The second thing I need to implement is Stops, where the arrows need to pause for a small amount of time. There are a couple of challenges with this, but it shouldn’t be anything I can’t handle.

And with that, I’d say arrow generation and scrolling is abut 80-90% completely implemented. This is a core mechanic of the game, so it’s pretty huge progress. And now I can finally move on to the other aspects, such as allowing you to actually press the buttons to score points. Expect more progress soon!

You May Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *