PuzzleScriptMIS is a development tool for puzzle games that contains a level editor, a test mode, a solver and uniquely a transformer for PuzzleScript. The transformer functions as a new way for puzzle designers to find or refine levels for puzzle games.
How the transformer works:
Designers can specify transformation rules according to which a current level design is transformed. The transformation rules follow a similar syntax to PuzzleScript and should be very easy to pick up for anyone familiar with PuzzleScript. It extends the language by introducing the keyword choose.
choose 1 [Player | No Obstacle] -> [|Player]
This chooses, with equal probability, any match of [Player | No Obstacle] (provided there is one) and replaces it with [] according to the normal rules of PuzzleScript. Notice that this can lead to multiple possible subsequent transformations. For example, the following level could be transformed into two different choices:
The final outcomes are then ranked according to their difficulty and presented to the designer. In this very simple example, the level where the player is moved to the right is considered slightly more difficult than the level where the player is moved to the right. The difficulty metric is based on the number of states the fastest solver requires in order to find the solution, and does not always match human judgement. The transformer works best if the ratio of interesting levels is high in the search space and the levels need a moderately low number of steps to be solved. The following are example use cases of using a transformer for designing Sokoban puzzle games, but the techniques apply to other puzzle games.
Use case: Inspiration
In the following example, the designer restricts the transformer to only create 4x4 Sokoban levels with 4 crates and targets and no walls. The transformer takes as an input an initially empty 4x4 level and transforms it according to the following rule.
choose 1 [] -> [Player]
choose 4 [No Crate][No Target] -> [Crate][Target]
Use case: Make it solvable when stuck
In the user study, most designers got stuck at some point when designing a level by introducing or removing an object which made the level unsolvable. Surprisingly, instead of figuring out a way to make the design solvable again, they posed this as a problem to the transformer. The transformer did generic operations on the level as follows:
( move players and crates around )
choose 20 [Player | No Obstacle] -> []
or [Crate | No Obstacle] -> []
( randomly remove or add 10 walls with prob. 0.4 )
choose 5 option 0.5 [Wall] -> []
choose 5 option 0.5 [No Obstacle] -> [Wall]
( remove one crate/target pair if it exists and add one )
choose 1 [Crate][Target] -> [][]
choose 1 [No Wall No Player No Crate][No Wall No Player No Target] -> [Crate][Target]
Use case: Polish
The transformer can be used to polish certain things at the end, like finding the most difficult starting position of the player in a Sokoban level. Also, an often reoccurring problem is to know when to stop designing a level. The transformer can give you a level of confidence if it cannot find any simple transformations that would make the level significantly more interesting.
choose 1 [Player][No Wall No Crate] -> [][Player]
Use case: Backward design
The idea is to start with a solved level and transform the level using only valid moves (in reverse). For Sokoban you would write transform rules that pull the boxes instead of pushing them.
(add a placeholder to all crates)
[Crate] -> [Crate Placeholder]
(move the player around and let him push crates)
choose 50 [Player | No Obstacle] -> []
or [Player | Crate | No Obstacle] -> []
(replace crates with targets and placeholders with crates)
[Crate] -> [Target]
[Placeholder] -> [Crate]