Lightcycles race across a grid and each leaves a wall behind it. Hit any wall and you die. The game is from the 1982 Tron film. Mine has a speed mechanic that rewards risky riding and bots that pick a direction for a reason. You play against a pack of them, one per 700 cells of arena up to 25. Controls are WASD or arrows on desktop and swipe on a phone.
Wall riding
The speed boost is the design idea. Whenever any wall or another cycle's trail is within 3 cells of you in any of the four cardinal directions, your cycle accelerates toward 1.7 times base speed, ramping over about six ticks so the change doesn't jolt. Base speed is one cell every 80 ms. Your own trail doesn't count, because the cell directly behind you is always your own fresh wall and you'd be boosting permanently. So threading along existing walls is fast and one mistake from death. The cycle pulses at 6 Hz while boosted. The bots use the same rule, which means they can outrun you in a corridor.
Picking a direction
The bots use the standard Voronoi heuristic for this game. For each direction that doesn't kill it immediately, the bot asks how many cells it could reach before anyone else if everyone raced outward from where they are. It answers with a multi-source breadth-first search: the bot's candidate next cell and every other living cycle's current cell go into one queue at the same time, the search expands one ring per step, and each open cell is marked for whoever gets there first. The score for that direction is the count of cells the bot claimed. It picks the highest, prefers to keep going straight on a tie, and then commits to that direction for 3 ticks so it doesn't dither. The fill visits every cell at most once, so it's linear in the arena size, and the claimed buffer and queue are preallocated typed arrays that get reused. The bot is seeded at the cell it's about to move into while the opponents are seeded where they stand, so its territory estimate runs a cell optimistic.
It looks one ply ahead. It rarely traps itself and will cut you off when it has the space advantage, but it has no idea that a corridor it's entering will close behind it three moves from now.
Death and debris
When a bot dies its trail stays on the board as an obstacle for two seconds, then vanishes the instant the bot respawns somewhere else. While you survive, the arena keeps filling with other people's walls. Your score is the number of seconds you survived, added up across games, with your longest run tracked separately.