zenorogue / hyperrogue

A SDL roguelike in a non-euclidean world
GNU General Public License v2.0
577 stars 72 forks source link

Sandworm can path through boats, and "%The1 is confused!" #95

Open Quuxplusone opened 4 years ago

Quuxplusone commented 4 years ago

I don't fully understand what's going on here — I'm as confused as the poor sandworm is!

If you lead a sandworm into the Living Fjord, and then you get in a boat, you can be next to the sandworm's head and then step sideways (as if you were killing a Hedgehog Warrior), and the sandworm will wind up in the same cell as you. This seems to work only if you are in a boat. On land, "the sandworm would kill you there."

You can step off onto land:

Or, you can step off into water, which will move your boat, leaving the sandworm floating in the water. The sandworm will then explode on your next turn, unless you move your boat hedgehog-wise and allow the worm to step under you again. By repeatedly doing this, you can move the sandworm across a river using only one boat:

Or, if you have a lot of boats, the sandworm will happily path across them:

Finally, if instead of stepping off, you click your own cell instead, you get the message "You need to dismount the Sand Worm W!"

That is, the game thinks you're "riding" the sandworm, simply because it shares your cell. However, from the code, it seems like the only intended way to ride a sandworm is to use the Orb of Domination, right?

My suggested fix for the immediate issue is that sandworms should never path through boats at all; if you're in a boat, you should be safe from sandworms. However, it seems like there must be some other issue that causes the sandworm to move onto the player's own cell, in general, that might also be triggered by something other than boats. (I would guess that I could trigger the same bug in R'Lyeh by moving statues? I haven't tested that yet.)

Separately, I think it's strange that the message is "You need to dismount the Sand Worm W!" That "W" seems out of place. I can't figure out where it's coming from.

Separately, I've looked in the code at where the message "%The1 is confused!" is printed, and I think the message should be changed to "You have inexplicably cheated death!" or something along those lines. The current message implies that I've done something clever to the sandworm in-universe; but in the code, it's apparent that this is basically an assertion-failure and the whole game is in a bad state out-of-universe.

Quuxplusone commented 4 years ago

Here's another example of a sandworm getting confused. I don't know exactly how this happened, unfortunately, and wasn't able to reproduce it immediately.

A sandworm in the Land of Storms is pretty hilarious, by the way, because it's effectively immortal (not sure why) and basically just goes around electrocuting everything within one space of it forever, as long as you lead it next to a battery every so often.

zenorogue commented 4 years ago

In version 11.3, the system for checking move validity is rewritten, which should fix issues like this. Thanks!

emmiegit commented 3 years ago

If this issue was fixed, should it be closed?