not a beautiful or unique snowflake (nothings) wrote,
not a beautiful or unique snowflake

I was trying to design a particular style of level for Chromatron 4, and after trying several times to do it by hand and ending up with something not very interesting, I decided to code up a simple Chromatorn level solver that I could use to interactively probe whether certain changes would open up bad solutions.

The program only allows mirrors, reflectors, and one laser. There can be any number of targets, and they can be black (must-avoid) targets or regular targets. (This is despite the fact that the situation I cared about has only one target.) No splitters or more complex pieces are allowed. Double-benders are not yet handled.

It runs very fast for levels with a few mirrors and not many places to put them, or not many mirrors and a few places to put them. It does not run at all fast for complex levels, e.g. a wide-open level with 8 benders and one reflector--I stopped it after about two minutes. In this case it might still be fast enough to batch run it overnight or whatever to analyze levels before shipping, as opposed to using it as an interactive level design tool, but I don't know how long it'll actually run. (Note that it finds all possible solutions, so it basically always explores all possible positions. There is no early-out because it's fairly hard to conservatively estimate whether or not you can hit all the remaining targets with a given number of pieces. I may try to add that, though, but my attempts to design such culling logic have met with little success so far.)

I tested, among other things, the level "Amazing" from Chromatron 3, which is a pac-man-esque maze with only reflectors (90-degree turns). I'd worked hard on that level trying to create a unique solution. The solver (at interactive speeds, in this case, since there are so few plausible paths) finds 6 solutions, including ones that don't do the trick I'd intended--I intended the beam has to be deflected twice before hitting its first target--on the other hand, it also found a solution where the beam is deflected three times before hitting its first target. In fact, all of the solutions that aren't my intended one require, somewhere in the path, a sequence of three mirrors with no intervening targets; which is I suppose why playtesters didn't find any of them. (And also because I didn't spend enough time playtesting.)
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.