This is
issue #47 on github: Basher/miner interact with blocker, pass through wall.
We're currently implementing physics changes in Lix, and there are two issues we need to come up with a solution for.
The first one is a glitch allowing a basher to pass through terrain without removing it. This also works for miners.
Have a wall to the left.
Basher standing in front of wall, facing right.
Basher bashes a swing, but doens't move yet.
To second lix in front of basher, assign blocker.
Blocker turns basher.
Basher walks through the wall on the left.
On first glance, moving the check that looks for terrain to determine if the basher continues into the same frame as the terrain removal looks like it might solve the issue. But if there's terrain on the other side of the blocker as well (i.e. blocker and basher are trapped between two walls), the glitch still works. It's a rather specific setup then though.
Another, move involved idea is not allowing the basher to move forward if it were to move into terrain. This however would allow to stall bashers using cubers.
Or only allow turning the basher in the frames after moving forward but before the stroke, and disallow moving forward when the basher is facing a blocker and is in its turning field? Then basher/blocker interaction becomes inconsistent and confusing.
None of these are really satisfying, so we were wondering if there were any other ideas.
The second issue is about lix trapped between two blockers. In this case we disallow any horizontal movement, and the lix turns around every single frame. Now imagine a basher trapped here. The basher cycle consists of an even number of frames, so the terrain check and terrain removal always occurs on the same side. So you can trap a basher between two blockers even if there's terrain on only one side. Same issue with the miner, but more visible (Imagine a miner on top of a cube where the cube is located between two blockers): It removes terrain always on the same side, leaving a pillar of cube on one side. Maybe less serious but same issue also with builder bricks, they are always on the same side.
Simplest fix would be having exactly one frame in their cycle where bashers/miner/diggers are unturnable. Then there's an odd number of turnable frames and so terrain checks and removal are alternatively executed on both sides. Introduces slightly inconsistent behaviour, but it's not that visible.
Other idea is: detecting if a lix is trapped between two blockers is already implemented. In that case just check for terrain/remove terrain on both sides. What about the builder though?
Any input and suggestions are welcome.