Pushing a sokoban object in a level with no sokoban fields can automatically win the level

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

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

Pushing a sokoban object in a level with no sokoban fields can automatically win the level

Post by ncrecc »

If "exit level with all fields solved" is enabled for the sokoban elements, pushing a sokoban object in a level that does not have any sokoban fields will cause you to instantly win the level.

Normally this wouldn't matter, but this makes it impossible to create a specific type of puzzle where you have to spawn a sokoban field somehow (by Yam-Yam or Magic Ball) and then push the sokoban object onto the field to win the level. Here's an example level that is ruined by this behavior:












The Yam-Yams contain one in the middle, but due to this bug it doesn't matter because you can just push the sokoban objects while there are no fields spawned to instantly win.

(I would argue there should also be some setting so that, if the above level had an exit door placed in it, the exit door would not open until all sokoban objects are on sokoban fields. In fact, the above level can also be cheated since, even if this specific bug were fixed, you would only have to spawn one sokoban field instead of both of them to win - perhaps there should be a separate "exit level with all objects solved" setting?)
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Pushing a sokoban object in a level with no sokoban fields can automatically win the level

Post by Holger »

Thanks a lot for reporting this misbehaviour -- apparently I did not consider levels with a different number of Sokoban fields and objects on the playfield (be it at the start of a game, or during the game where new Sokoban fields or objects could have been dynamically created).

I've fixed this now by using separate counters for Sokoban fields and Sokoban objects, auto-solving a Sokoban style level (or opening a closed exit door) not before both counters have reached zero.

The corresponding option in the level editor for the Sokoban style elements is now called "exit level if all tasks solved" (meaning that all Sokoban fields have to be filled, and all Sokoban objects have to be pushed to Sokoban fields).

This should make levels like the one presented here work as expected.

The bugfix will be released with the next version of R'n'D.
Post Reply