How RayVane's light puzzles are designed and checked
Devlog · December 2026
One beam, one shot
RayVane is a light-reflection puzzle for Android. You drag to aim a beam of light. When you let go, the beam travels across the board, bounces off walls, mirrors, rails and bumpers, and lights every numbered lamp it touches. The level is won when all of the lamps are lit by that one shot. There is no timer and no second chance within a shot: you aim, you release, you watch, and you try again.
That simplicity helps us as designers. If the beam is deterministic, we can ask the computer whether a level can be won at all, and by how much room for error. This note explains how a level is described, how the beam is simulated, and how we prove that a level is fair before a player sees it.
What a level is made of
A level is a small list of objects on a portrait board. The board is 9 units wide and 14.5 units tall. The launcher sits at the bottom centre, and you can aim it anywhere from 70 degrees to the left of straight up to 70 degrees to the right. The beam can bounce up to six times, and it can travel at most 100 units. Those limits keep every shot finite.
The objects on the board are few. There are numbered lamps, which are circles of a fixed size that the beam must touch. There are rails, the walls along the sides of the board, which reflect the beam. And there are bumpers, flat reflecting segments placed inside the board, which reflect the beam from either side. Later levels add a prism, which in the engine ends the incoming beam and sends out two new beams, one to each side of the original direction.
A beam that behaves the same everywhere
The simulator that traces the beam is written in plain C# using double-precision numbers, with no dependence on the game engine. That matters for one reason: the same angle must always give the same result, on every phone and at every frame rate. The simulator is a pure function from a level and an angle to a path.
It also has clear rules for awkward cases, and each rule has a test. A beam that just grazes the edge of a lamp counts as lighting it. If a lamp and a wall are hit at the same moment, the lamp is lit before the bounce. A bumper reflects from both of its sides. A shot ends when every lamp is lit, when it leaves the board, when it uses up its bounces, or when it runs out of distance, and the simulator records which of these happened. A test also checks mirror symmetry: a level and its left-right mirror image must give mirrored paths.
Checking that a level is valid
Before a level is solved, it is validated. The validator rejects a level if its identifier is empty or repeated, if the board bounds make no sense, if the launcher is outside the board, if the aim range is invalid, or if the reference answer lies outside the aim range. It also rejects a level whose lamps overlap each other or the launcher, whose lamps lie outside the board, or whose reflector cuts through a lamp. Each rule has a test that feeds in a deliberately broken level.
These checks catch real mistakes. When you place pieces by hand, it is easy to leave a lamp half inside a wall or on top of the launcher, and a rule that says no is faster than a playtester noticing.
Sweeping every angle
Validity says a level is well formed. It does not say the level can be won. For that we use an angle-sweep solver. It tries every aim angle from the lowest to the highest in steps of one hundredth of a degree, runs the simulator for each one, and records which angles light every lamp. Where the result flips from a miss to a win or back, it refines the edge by repeated halving, so that the edges of each winning range are found precisely, not rounded to the step size.
The output is a list of winning windows: ranges of angles, in degrees, that win. The width of a window is a direct measure of how much precision the level asks from the player. A window of 8 degrees is generous, and a window of 2 degrees needs a steady finger. Because the windows are measured, we can set a floor and enforce it.
A sweep samples at a fixed step, so in principle it could miss a window thinner than the step. The windows we require are far wider than the step, so this does not affect levels.
The first ten levels as a worked example
The original ten levels were checked this way. The first, called First Light, is a straight shot with no bounces and a winning window of about 7.9 degrees. The levels that follow add a side wall, then the opposite wall, then two bounces, then a bumper inside the board, and so on, ending with a level called Final Skyline that needs three bounces and has a window of about 2.7 degrees.
For each of those levels the test suite checks the result in several ways. The reference answer must win. The number of bounces and the order of the surfaces hit must match what we designed. Every lamp must be lit. The winning window must be at least 1.5 degrees on the first eight levels and at least 1.0 degree on the last two. And a few chosen wrong angles, three per level, must really miss, so that a level cannot be won by accident. Each level also has a stored golden trace, a list of the exact points the beam passes through. If a change to the simulator ever moves a path, the test notices.
Daily Shot: generating levels without hand design
The Daily Shot is a fresh puzzle every day, and nobody sets it up by hand. A generator builds it from the date, so every device gets the same level on the same day. It picks an aim, places up to two bumpers on the path, and then places two to five lamps along the traced path. After that, the same angle-sweep solver checks the result, and the level is accepted only if a winning window of at least 3 degrees exists.
The generator uses its own seeded random numbers and not the platform default, so the sequence is identical on every device. If an attempt fails, it tries the next seed, up to 400 times, and then falls back to a hand-made layout. The week has a shape: Monday uses two or three lamps with no bumpers and a wide total window, and the weekend uses four or five lamps with bumpers and a narrower one.
Limits and what we would like to improve
A window tells you how precisely you must aim, but not how hard it is to work out where to aim. A level can have a generous window and still be a real puzzle, and the reverse is also true. Windows are a safety net, not a full measure of difficulty. The game is Android only for now. If you find a level that seems impossible, or an angle that should have won and did not, write to aviisr@aviisrgames.com with the level and your device.
You can find the game, with its store link and what it includes, on the RayVane page.