Xor Constellation

2025-05-27 : previous : next : index


"Xor Constellation" is a puzzle game for the Playdate console.


https://uguu-org.itch.io/xor-constellation

Background

Before playing my game, you can try playing Sum Ten by Kenta Cho. In Sum Ten, the goal is to sum a series of numbers that add up to integer multiples of 10. Two observations emerge once you have played it enough:

Getting really good at Sum Ten is possibly training my brain for something, although like most games, it's probably a non-transferable skill that isn't useful anywhere else. Still, it felt good to be developing some skill.

Sum Ten is among the collection of elegantly simple one button games, and this elegant interface may be best described as brutalist. On the input side, you can expand the path by one of two directions purely by timing of the key press. There is no undo. Instead, there is this relentless scrolling that accelerates as game progresses, conveying a sense of impending doom. On the output side, it's just all single digit numbers drawn with large pixels on a rectangular grid. It's brutal.

I can't honestly recommend Sum Ten to other people because it's hard to say that it's actually fun, but I did spend a lot of time playing it for some reason. I wonder if I kept playing it because the frustrating interface gave me the illusion that I could score higher if I just tried a bit harder. Well, rather than playing that game, I thought I would make my own game without the brutalist interface.

Core

The core mechanic of the game is similar to "Sum Ten" in that it's connecting a series of numbers through a common operator. But rather than making another game about addition, I made a game about bitwise XOR. Since I went with XOR, it also made sense that the values would be hexadecimal digits instead of decimal. XOR has the same associative and commutative properties as addition, so my expectation is that it will have the same pattern matching experience.

Having settled on XOR, I designed the rest of the game for accessibility:

With the design in place, the first thing I implemented was the hexagonal grid that lazily grows as targets come into view, and next was the grid generation system and some basic controls, which completes the core mechanic.

Now I have a playable game, the rest are refinements.

Refinements

Before I even started implementing grids, I set out to draw digits that would be legible on playdate's screen. This is accomplished by starting with a monospaced font and fill the pixels one by one to make sure they are exactly where I wanted them. For people who are not fast with converting hexadecimal to binary, I also included dots below each digit to show the bit pattern.

Asking players to memorize bit patterns is probably too much, so I also added a small display in the corner of the screen that shows intermediate and final XOR results. Unlike Sum Ten where you have to mentally add the numbers as you go, in this game you can just look at the bits on screen and the computer has already done all the math for you, so the focus is more on pattern matching rather than mental arithmetic.

Initially, I thought the hexadecimal digits would appear on computer chips, and this game would be about connecting those chips on a printed circuit board. Graphically it didn't work out because the chips and connections take up too much space, and it becomes a more difficult game if player can't see too many steps ahead. Instead, the numbers are simply drawn as floating in space with a thin straight line connecting them. Since I am not tied to the rigid layout of a circuit board, I made the numbers drift to give a bit of motion to the connecting lines.

Since the grid generator requires finding two solutions, I added hint lines to make those solutions visible. It's helpful to me for debugging, and helpful for players to know that solutions exist. Since the solutions are available, I also added autoplay modes (activated with the usual sequence), which were useful for fuzz testing and also attract mode. The most tricky part of the project is the grid generation part, so I added fuzz tests specifically for grid generation.

When creating new targets, the targets are assigned values from a list of values that are appropriate for the selected difficulty level. Notably, this list is weighted such that zeroes appear more often than other values. Zero-value targets are special because they provide an extra level of flexibility by allowing player to reach an extra set of targets without affecting current XOR result. I made sure that zeroes appear with roughly the same probability regardless of difficulty level, and also draw the zero targets with special sprites for variety.

The first two special zero-value sprites I drew were mendako Bocchi and Kita. It's just a random thing that I did, both also appeared in Magero. But having done it, I made them special within the scoring system:

Then, having made a special bonus system with Bocchi and Kita, I built the rest of the game around them -- the game is named after "If I Could be a Constellation" (星座になれたら), the background sounds are chords from that song, background comes with parallax stars, and game ends when all stars disappear at dawn. itch.io's cover image also contain Bocchi and Kita if you look hard enough.

Release

After ~2 weeks of making and refining this game, I have added pretty much everything I wanted to add, so I released the package and announced it to the usual places:

Reddit always tells it like it is, and what they are saying is most people don't know what bitwise-XOR means (´・ω・`) ショボーン

Oh well. I think this is why we have indie games, since a big company who has done market research might not have made this game. For the few people in the software industry who do appreciate the XOR operator, I hope you enjoy this game :)


Previous (2025-04-30): A beginner's guide to water slide decals
Next (2025-08-21): "Fiasco" by Stanisław Lem

Index

uguu...