Stepmania source
I’ve been digging through the Stepmania source. I want to add step timing – if you’re off, instead of simply saying ‘perfect’, ‘great’, etc., it will tell you how far off you were.
The StepMania source is quite daunting! There’s like 200 files in there, and they’re not sorted into directories at all – they’re all just dumped into the same flat folder. I have no idea where the entry point is, but I sucked it all into XCode and started browsing through looking for where I could make this change.
I have some ideas, anyway. The code is really quite nice – comments are kinda sparse, but it’s well written stylistically and seems to be well-designed.
Anyway, I found an important line in Player.cpp–
// The offset from the actual step in
seconds:
const float fNoteOffset = (fStepSeconds - fMusicSeconds) / GAMESTATE->m_SongOptions.m_fMusicRate; // account for music rate
Yay! This is exactly what I needed! So if I just want to log it, that’s great and it would probably work. But I want to do better than that. It’d be great to display the timings as you were playing. This is quite a bit harder and I don’t know how I’m going to do it yet. But it will happen. Oh, you’ll see.