Page 1 of 1

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

Posted: Sat Oct 27, 2018 8:58 pm
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?)

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

Posted: Sun Oct 28, 2018 11:58 pm
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.