Add toggle for RnD-like controls in BD engine

Got a cool idea that should be in R'n'D? Let's hear it!

Moderators: Flumminator, Zomis

Post Reply
ncrecc
Posts: 285
Joined: Thu Jul 12, 2018 12:59 am

Add toggle for RnD-like controls in BD engine

Post by ncrecc »

People who primarily play RnD and EM levels and are not used to the control scheme of BD may appreciate an option in the Game Engines menu that makes the BD levels use the same control scheme as RnD levels.

----

In RnD (and EM), holding two perpendicular directions at once has some very useful behavior. Aside from allowing you to move "diagonally" by alternating directions every other step, it also allows you to turn around corners in advance, since "diagonal" moves made against walls (non-interactable solid tiles) simply result in running parallel to the wall.

In the BD engine (assuming you're in a level that doesn't permit true diagonal movement -- more on that later), holding two perpendicular directions at once simply ignores the vertical direction and prioritizes the horizontal direction. This similarly allows you to make tight turns, but in a different way.

The two movement styles can feel drastically different at times, with BD usually coming out as less lenient. Let's consider some examples.

Scenario 1
tight_turn_2.png
tight_turn_2.png (9.42 KiB) Viewed 235 times
If this scenario occurs in an RnD level, I can just hold Down and Right, which will make Rockford move down and automatically start moving right as soon as he can.
If this occurs in a BD level, however, I need to hold Down until I reach the corner, then start holding Right. If I hold Right any sooner, Rockford will waste a move pushing against the boulders and be crushed.

Scenario 2
tight_turn_small.png
tight_turn_small.png (10.85 KiB) Viewed 235 times
In this scenario, I can hold Up and Right, then release Right once I reach tile B so I start purely moving Up. However, if it's an RnD level, I have some additional leniency to stop holding Right, since if I'm still holding Up and Right by the time Rockford reaches tile B, he will initiate a "diagonal" movement and step upward first, during which I can stop holding Right. In BD, I have no additional leniency; if I'm still holding Right when Rockford finishes stepping onto tile B, he will continue moving right and die.

Scenario 3
tight_turn_3.png
tight_turn_3.png (16.11 KiB) Viewed 235 times
Getting through this scenario is actually simpler in BD than in RnD, if not a bit less lenient. In RnD, I'd have to alternate directions twice: once at B, and once at C, with the turn at C having a shorter wall and thus a narrower margin to start holding the direction of the turn. However, in BD, since horizontal directions override vertical directions, this entire sequence requires a very simple set of inputs: hold Up, start holding Right at B, then stop holding Right at C.

These examples are of course constructed, but the situations therein come up a lot when actually playing levels. When enabled, the option I propose would make the above 3 scenarios play exactly like they do in the RnD engine.

----

There are two ways this option could be implemented. Their advantages and disadvantages mainly involve behavior with multiple Rockfords and accuracy to GDash.

Implementation 1: Change the engine logic

Change the BD engine logic so that Rockford responds differently to the controls if the "RnD-like controls" option is on (and note whether it was enabled when writing/loading replays).

This has the advantage of feeling smoother in levels with multiple Rockfords, as each Rockford will respond separately to the state of the controls based on his surrounding tiles. However, it also allows for maneuvers that are plainly impossible in GDash. For example:
impossible_level.png
impossible_level.png (5.46 KiB) Viewed 235 times
This level is only possible with RnD-like controls enabled. If they are enabled, you can simply hold Down and Right. The player in the vertical corridor will move down toward the diamond at the same time the player in the horizontal corridor moves right toward the exit.
If RnD-like controls are not enabled -- e.g. as is always the case in GDash -- this level is impossible, since the two Rockfords cannot move in separate directions.

Implementation 2: Spoofed input

Keep the underlying engine logic the same, but add a layer that interprets the player's input based on the state of whichever Rockford is currently in focus (i.e. the first one), and show the engine different inputs than what the player actually pressed.

E.g. if the level is in the state of Scenario 1 above, and the player holds Down and Right, the game should check whether there are solid non-interactable tiles to the bottom or right of Rockford, determine that there is one to the right (going by how the RnD engine works -- a boulder can be pushed, but it's not interactable on touch like a switch, so Rockford will move past it) and not to the bottom, and tell the engine that the player is only holding Down.

(This is a simplification; refer to the actual RnD engine logic for diagonal inputs. E.g. if the tile below Rockford is solid and the tile to the right of Rockford is a rock, a Down-Right input should result in Rockford pushing the rock, not remaining still.)

Similarly, in the situation that Rockford is in open space (pictured below), if the player holds Down and Right, the game should tell the engine that the player is only holding Down on the first step, then that they're only holding Right, etc. so that they move in a diagonal zig-zag like if it were an RnD level.
open_space.png
open_space.png (6.51 KiB) Viewed 235 times
The advantage to this approach would be that nothing becomes possible in RnD that was not possible in GDash. The main disadvantage would be that behavior of multiple Rockfords in a level might be somewhat unpredictable to players, as their diagonal zig-zag movement would be seemingly obstructed if the first Rockford is in a corridor, or they might bump into walls in a corridor if the first Rockford is in open space.

----

On true diagonal movement

In BD levels with actual diagonal movement enabled (like Crazy Dream 1), the behavior for holding two perpendicular directions is immediately obvious: they move diagonally, and are blocked if they'd move into a diagonal tile. But I have a suggestion for what "RnD-like controls" could mean in a level with diagonal movement enabled: Rockford could be redirected to move parallel to walls he'd otherwise move at a 45-degree angle to, much like how faux-diagonal movement against walls works in the RnD engine.

To demonstrate how this should work, let's look at a diagram.
diagonal_diagram.png
diagonal_diagram.png (1.71 KiB) Viewed 235 times
If the level has diagonal movement enabled, and RnD-like controls are enabled by the player, then if A is a solid tile, B is a solid non-interactable tile, C is a walkable or diggable tile (consider whether it's a door that the player has the right key for), and Rockford is moving diagonally toward B, then he should move toward C instead.

Note that, as written, Rockford would not trigger A if it is an interactable tile. E.g. in this situation, with Rockford moving down-right, he would move toward C without triggering the creature direction switch:
a_interactable.png
a_interactable.png (1.34 KiB) Viewed 235 times
I don't consider this being much of an issue, since if this is in the middle of a horizontal corridor that the player is holding Down and Right to move through, then Rockford will already have triggered A diagonally from the tile to the top-left of it (not shown in this diagram).

However, for maximum convenience and resemblance to RnD movement, you might want to consider having Rockford move toward C if both A and C are solid, but C is interactable and A is not. E.g.:
c_interactable.png
c_interactable.png (1.06 KiB) Viewed 235 times
In this situation, a player used to RnD movement might expect to hit the creature direction switch when moving down-right and reaching this corner.

(If A and C are both interactable, i.e. there's two different switches Rockford can possibly hit, then the situation is ambiguous and Rockford should keep moving toward B.)

Like with the case for faux-diagonal movement, this can be implemented by either changing the engine logic or by spoofing inputs that yield the same result.
User avatar
Holger
Site Admin
Posts: 4253
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Add toggle for RnD-like controls in BD engine

Post by Holger »

Definitely a good idea! (Indeed I was also already thinking about it when playing around with the native BD engine.)

This is in fact a feature that is also still missing from the native Supaplex engine, while I have already added it to the native Emerald Mine engine. (The reason being mainly the fact that both the SP and BD engine came with already existing, native tapes that would break when changing the logic of movement precedence. But this can easily be worked around, of course, by simply replaying native tapes without this feature, while using it for all newly recorded tapes.)

I think this movement behavior should really be added to all engines! And although it may make playing levels a bit easier (and especially much more convenient), it does not really introduce "incorrect" engine behavior, as it is technically still possible to play all native levels as before (by only pressing the key that would have precedence), and it could also be made configurable (although I am not sure if an option for the old behavior is really needed -- but yes, the die-hard BD players will probably want to have it ;-) ).
Post Reply