Log 3 - Visual Inspiration + Making a Picross Solver
Pico² is releasing on Feb 9th 2025! Follow on itch.io for updates!
See the Pico² Design Document!
I settled on two key visual inspirations for Pico² from games I’ve played:
- Monument Valley is a puzzle game for PC and Mobile, where you navigate M.C. Escher-esque environments.
- The game uses simple but often striking colours with vibrant highlights.
- I like the serene atmosphere.
- Firewatch is an exploration narrative game for PC and console, where you traverse and learn about an American national park as a fire lookout.
- I like the infusion of striking colour in natural environments, and how it often uses a monochrome palette within a scene.
- It evokes sunsets and sunrises, and the serenity and beauty of open wilderness.
Monument Valley (2014) by ustwo
Firewatch (2016) by Campo Santo
I might add more inspirations later - I have ideas for levels belonging to worlds with distinct settings, but it all depends on how much space I have to work with in memory.
Next, I had to figure out how to generate random puzzles. Through some experiments in Python, I designed a simple algorithm which solves any given puzzle; it’s probably not very fast, but it can evaluate 100 15x15 puzzles in less than 15 seconds, so it’s good enough for my case.
This was really daunting to get into since initially I had no idea where to start; I found some Python implementations, but they used some Object Oriented features, so I decided to write one from scratch given the token restriction and limited Lua features in PICO-8. I also found some papers on the subject, but the notation became a little too confusing.
In the end, I just started by building up the steps I would take as a player.
- First, I check for rows with big numbers; they’re most likely to have some fill-able information.
- Then I build around these, extending filled sections wherever I can to open options, and filling in crosses.
- This eventually sprawls out until there are plenty of options to tackle.
In a more algorithm-friendly approach:
- First, I check for rows that can be filled fully - for example, where the hint is just the row length, so every space is filled.
- For rows where this isn’t possible, check every possible permutation of the hints given (taking into account the information already filled). If there is a value that appears in every permutation in the same position, then we can fill it.
- This is illustrated in the code block below.
- Keep repeating the previous step until the puzzle is either solved, or no options remain available, revealing that the puzzle either is or isn’t solvable without needing to guess.
# Example: 3 valid permutations remain.
# [1 1 1 2 2]
# [2 1 1 1 2]
# [2 2 1 1 1]
# ↑
Regardless of which permutation ends up being right, we know the middle value (with the arrow) is always 1, so we can confidently fill it and hope it gives more information for the surrounding rows and columns.
For a more comprehensive overview, see the design document (link also at the top of the post!) for a pseudocode breakdown (under Random Generation Algorithm Design), and see the full Python notebook on GitHub.
In this example, the code generated a 15x15 puzzle (top), then managed to solve it (bottom) in 4 iterations of the process described above.
2
1 1 1 2
1 2 1 2 1 1 1 3 2 3 1 1
4 3 1 1 1 2 2 1 1 3 1 3 2 1 2
2 1 7 2 1 2 1 2 2 3 1 5 4 1 2
2 1 1 2 1 5 1 1 2 4 3 2 1 1 1
1 1 1 1 2 █ ░ █ ░ ░ █ ░ ░ █ ░ ░ █ █ ░ ░
1 2 1 1 ░ ░ ░ ░ █ ░ ░ ░ █ █ ░ █ ░ █ ░
4 1 7 █ █ █ █ ░ █ ░ █ █ █ █ █ █ █ ░
3 2 1 2 1 1 █ █ █ ░ █ █ ░ █ ░ █ █ ░ █ ░ █
1 3 1 3 █ ░ █ █ █ ░ ░ ░ █ ░ ░ █ █ █ ░
3 1 2 █ █ █ ░ ░ ░ ░ █ ░ ░ █ █ ░ ░ ░
3 1 2 1 ░ █ █ █ ░ █ ░ ░ ░ ░ ░ █ █ ░ █
3 3 1 4 ░ █ █ █ ░ █ █ █ ░ █ ░ █ █ █ █
1 1 1 1 1 █ ░ █ ░ █ ░ ░ ░ ░ █ ░ █ ░ ░ ░
2 6 1 █ █ ░ ░ ░ █ █ █ █ █ █ ░ █ ░ ░
3 1 2 1 ░ ░ ░ ░ █ █ █ ░ █ ░ ░ █ █ ░ █
1 1 1 1 1 2 1 █ ░ ░ █ ░ █ ░ █ ░ █ ░ █ █ ░ █
4 6 2 █ █ █ █ ░ █ █ █ █ █ █ ░ █ █ ░
1 3 ░ ░ ░ ░ ░ █ ░ ░ █ █ █ ░ ░ ░ ░
1 2 2 3 ░ ░ ░ ░ █ ░ █ █ ░ █ █ ░ █ █ █
-- SOLVED! in 4 iterations --
2
1 1 1 2
1 2 1 2 1 1 1 3 2 3 1 1
4 3 1 1 1 2 2 1 1 3 1 3 2 1 2
2 1 7 2 1 2 1 2 2 3 1 5 4 1 2
2 1 1 2 1 5 1 1 2 4 3 2 1 1 1
1 1 1 1 2 █ X █ X X █ X X █ X X █ █ X X
1 2 1 1 X X X X █ X X X █ █ X █ X █ X
4 1 7 █ █ █ █ X █ X █ █ █ █ █ █ █ X
3 2 1 2 1 1 █ █ █ X █ █ X █ X █ █ X █ X █
1 3 1 3 █ X █ █ █ X X X █ X X █ █ █ X
3 1 2 █ █ █ X X X X █ X X █ █ X X X
3 1 2 1 X █ █ █ X █ X X X X X █ █ X █
3 3 1 4 X █ █ █ X █ █ █ X █ X █ █ █ █
1 1 1 1 1 █ X █ X █ X X X X █ X █ X X X
2 6 1 █ █ X X X █ █ █ █ █ █ X █ X X
3 1 2 1 X X X X █ █ █ X █ X X █ █ X █
1 1 1 1 1 2 1 █ X X █ X █ X █ X █ X █ █ X █
4 6 2 █ █ █ █ X █ █ █ █ █ █ X █ █ X
1 3 X X X X X █ X X █ █ █ X X X X
1 2 2 3 X X X X █ X █ █ X █ █ X █ █ █
In this example, the puzzle is not solvable; note the pattern in the bottom corner, where the player would have to guess which is valid.
-- not solved... no options after 4 iterations --
1 1 2 1
5 1 5 4 1 2 4 1 1
1 7 4 1 2 2 1 2 1 1 1 4 2
2 1 2 1 1 1 4 5 3 2 4 2 2 1 1
1 3 1 1 6 1 1 5 1 1 5 1 2 1 2
1 2 1 2 2 █ X X X █ █ X █ X █ █ X █ █ X
1 3 1 1 1 1 █ X █ █ █ X █ X X █ X █ X X █
2 1 2 2 █ █ X █ X █ █ X X X X █ █ X X
4 3 1 1 █ █ █ █ X █ █ █ X X X X █ X █
2 1 3 5 █ █ X █ X █ █ █ X X █ █ █ █ █
3 1 1 2 2 X █ █ █ X █ X █ X █ █ X █ █ X
2 1 1 1 X █ █ X X X X █ X X █ X X █ X
5 1 3 1 █ █ █ █ █ X X █ X █ █ █ X █ X
2 1 2 2 X █ █ X X █ X X █ █ X █ █ X X
2 2 1 X X X X █ █ X █ █ X █ X X X X
5 2 1 2 █ █ █ █ █ X X █ █ X █ X █ █ X
1 1 2 1 2 1 1 █ X █ X █ █ X █ X █ █ X █ X █
1 2 5 X █ X █ █ X █ █ █ █ █ X X X X
2 1 1 1 1 1 ░ █ ░ X █ X X █ X X █ X █ X █
2 2 1 4 ░ █ ░ X █ █ X X X █ X █ █ █ █
Hence, guessing will never be necessary!
However, I’m currently unsure if this approach will generate puzzles for which there may be more than one solution. In my very very limited testing, of the 100 or so solvable puzzles that were generated, the solver produced a solution identical to the original random puzzle.
This uncertainty isn’t ideal, but it seems rare enough that it (hopefully 🤞) won’t be a problem; either way, personally I don’t mind puzzles with multiple solutions!
Next, I’m drawing up a full requirements list. Stay tuned!
Follow on Twitter @wsasaki01 Follow on Bluesky at wsasaki.bsky.social
Pico²
Relaxing Picross game for PICO-8
Status | In development |
Author | wsasaki01 |
Genre | Puzzle |
Tags | PICO-8 |
Languages | English |
Accessibility | Configurable controls, Interactive tutorial |
More posts
- Log 2 - Concepting6 days ago
- Log 1 - Setting Out12 days ago
Leave a comment
Log in with itch.io to leave a comment.