UI/Interactivity test...

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrew Davie

Since Boulder Dash was in my feed today, I've been thinking about it a bit.

One of the "frustrations" with the game for me has been the inconsistency, or poor responsiveness, of the joystick. You can, of course, "pre-move" and if you get used to that it's very playable. By this, I mean that the joystick is buffered, so you can press the joystick before it's your "turn", and the joystick will be actioned upon.

In theory this sounds good, but in practice it introduces "lag".  That is, you press and release a joystick direction, and nothing happens. And then something happens. It's only a few frames later but it feels rather odd. The other alternative is to simply ignore the joystick that's pressed when it's not your "turn" -- and in that case the controls feel unresponsive.  I pressed something - nothing happened!

As chatgpt says, "it's a classic aliasing / sampling problem in input handling.

Here's why it happens:
   •   Your game logic runs at ~15 Hz.
   •   The video refresh and joystick poll are at 60 Hz.
   •   You only check the joystick every 4th frame to line up with the slower logic tick.

The issue: a button press might be shorter than 4 frames (≤ 66 ms). If it occurs and is released entirely between your sampling points, you'll miss it. Or if it straddles the boundary, you detect it one logic tick later, which feels "laggy."
"

I've addressed this problem many times, and my solution involves a rather complex buffer of joystick moves and button presses, which 'straddles' the game frames and allows detection of joystick moves over a large frame range. But unfortunately, it still has the "lag" problem. 

The board is a 40x22 grid, and every single square in the grid is processed to perform an action. In the original Boulder Dash I developed a series of lists which contained "actionable objects" -- that is, objects that needed to do something every frame. It was rather impressive for 6502 code, and worked beautifully in reducing the amount of board squares that needed to be checked.  In this ARM implementation, I abandoned that as too complex, and I simply scan through ALL the 880 squares every game frame.  I can do this in about 4 TV frames, giving us our "game frame rate" of 15Hz.

That's all well and good, and regardless of the method used -- there's still that lag problem in the controls. Because the game itself runs at 15Hz and can't be faster... give or take.

So, on to the thought experiment, which I might play with shortly. That's where I run the game loop at 15Hz, and I run the joystick movement at 60Hz.  The idea is that while I'm processing through the 880 squares of the board, every single frame I check the joystick (and if required move the player).  That means there's going to be zero lag on the joystick/player interaction. But it screws with the "correct" game logic.  If, for example, you're due to die for sure because a boulder is falling on top of you this frame (the boulder above is processed before the player below, so the boulder falls, player dies).  But I can hack this, I think.

Every frame I check the player move. If there's a move I first check if there would be any interaction (i.e., a boulder would have killed you). If so, I ignore the joystick. Or not. I might just let you escape anyway. Once a player moves, though, I need to *delay* a subsequent movement so that the player movement/speed is at 15Hz overall. I'm just allowing that initial move to be at 60Hz resolution.

I'm quite curious to see how this would work. In 99% of gameplay situations it wouldn't make a difference to the actual gameplay outcome -- we'd just have super-responsive joystick and player movement. Yes, the player might move 3 frames too early -- but that's a one-off on the first move of a sequence. It might be un-noticeable; it might not.

I think it's worth some experimentation!

Bomberman94

I also think controls are essential for a good gaming experience.

By the way - may you consider changing the speed of movement? The speed in BD 2 official demo was a bit too fast (at least for me). Also getting faster in higher level is logical but less time, more boulders, design of caves and needing more diamonds to solve the cave was better IMO. ... just my thoughts.

Andrew Davie

Quote from: Bomberman94 on 27 Sep 2025, 05:30 PMI also think controls are essential for a good gaming experience.

By the way - may you consider changing the speed of movement? The speed in BD 2 official demo was a bit too fast (at least for me). Also getting faster in higher level is logical but less time, more boulders, design of caves and needing more diamonds to solve the cave was better IMO. ... just my thoughts.

Yes, all likely/possible. TY. BD is lower priority for me, however -- due to the constraints of satisfying BBG and limited release numbers.

Andrew Davie

I've made the change. It took 5 minutes. In my view, the results are an impressive improvement in responsiveness. I'll wait to get some feedback from others on the results. Awesome first impression though!