gbadev
Game Boy Advance homebrew development forum
Member
Joined:
Posts: 16

Is it normal to spend hours on a single function? I don't feel like I've even gotten to the hard part of parsing human input into Morse code but it still took me ages to work through the function to take a sequence of Morse tokens and turn them into a string. I'm gonna assume that's normal at my skill level though. At least the puzzling through edge cases has been fun, and I think I've got the right approach. I think writing tests for this one is going to be a piece of cake, too (she said, in her (alleged) hubris).
Cheers!
Jayda

Member
Joined:
Posts: 16

This morning I started attempting to figure out how the 'tap it out' functionality I want can actually work. I want it to be dynamic based on whatever speed the user goes at, as long as it's somewhat consistent per letter. Checking every frame and keeping track of how many frames a button has been pressed is pretty easy stuff, but caused me to have to reckon with the fact that I don't have anywhere to store state yet- I just jumped right in to the Morse code functions because they were fun and interesting.

After some pondering and talking stuff through with my wife, I think I have a really neat layout for how the game state can flow, with a place to keep track of world stuff while in menus, and hopefully a decent bit of structure without being overwhelming. Sorry, that's kind of vague and floaty, but that's where I'm at right now. Gotta keep this mysterious, right? (It's just a bunch of enums and structs. That's all right now. There's going to be associated functions, too, like update and draw. And that's all computers are- just data and functions.) Now that I know where the state should be put, though, I think I get to start biting into more of the meat of how to parse human tippy taps into Morse code a computer can reliably read, which is pretty exciting! (To me, at least.)

Member
Joined:
Posts: 16

NewGirlJade wrote:

Is it normal to spend hours on a single function? I don't feel like I've even gotten to the hard part of parsing human input into Morse code but it still took me ages to work through the function to take a sequence of Morse tokens and turn them into a string. I'm gonna assume that's normal at my skill level though. At least the puzzling through edge cases has been fun, and I think I've got the right approach. I think writing tests for this one is going to be a piece of cake, too (she said, in her (alleged) hubris).
Cheers!
Jayda

I did start writing some tests for this one, and have a list of ones I want to do eventually, but it's been hard to focus and I poked at this enough to be pretty sure it's functioning correctly, so I'm moving on till I want to come back and finish. It's not ideal, but I'm being nice to myself and want to keep moving instead of getting stuck on testing.

Member
Joined:
Posts: 16

Took a mental health week- not doing too hot.

Member
Joined:
Posts: 16

We’re so back! Needed time to figure stuff out but I finally succeeded in picking up my laptop and getting things done. The secret was finding a way to reward myself for doing the thing without being able to beat myself up for not doing the thing. I settled on a little reward (making a tiny friend in one of the Linux analogues to mspaint) for every 30 minutes of programming I do- easy, fun, builds up over time, no streak to stress about, and no punishments for “failing”. I can just pick it up and start adding to the stack.

So anyway, programming updates: I figured out how to make a cascading timer, which I packed into a structure that can convert timer ticks into milliseconds and made some tests for. Perhaps not the most tasty thing, but I’m glad to have made progress finally and am excited to turn it into the next step of my evil plan: making an array of button events so I can eventually parse user Morse code input.

Little worried that I didn’t need a cascading timer at all, as I’m probably going to stop reading Morse code input after a second anyway, which is within the abilities of a single timer set to 1024 clock cycles per tick (maxes out at 2 and a bit seconds) and cascading means I’m limited to one timer at a time. I think it’ll be okay though. Having a 32 bit timer with 72 hours of runtime before overflowing seems overall more useful and extensible than a 2 second one.

Member
Joined:
Posts: 16

Technical note: I switched from tracking frames between button events to using a timer at the recommendation of my mentor. I’m still not fully convinced it’ll be easier in the long run but it has been instructive, which might have been their goal.

It does prevent me from needing to do a bunch of frames to ms conversion, and prevents me from trying to take shortcuts. We may, in time, see if that’s helpful or unhelpful.