This is the story of how the Quoridor AI on this site was built. At first we only wanted to beat a 'hard' AI we had written a while back,
but along the way the target moved to the strong engines published on GitHub.
Part 1
Beating the algorithm AI
Mid-September to September 26, 2026
Starting point: the 'hard' AI
There was no grand plan at the start. A web Quoridor game we'd made earlier had an AI on 'hard' difficulty, and the idea was simple: let's beat that thing first.
hard is a traditional search algorithm. It looks a few moves ahead and scores positions with rules a person wrote (say, the difference between my remaining distance and the opponent's).
Job one was to get a neural network AI to figure out, on its own, how to beat it.
First try: reinforcement learning alone never won a game
We built eighteen versions, v1 through v18, with reinforcement learning (PPO).
We tweaked the rewards, built a ladder that climbed one step at a time from easy opponents, and even started from a model that imitated hard's moves.
Against hard? 0 to 2 wins out of 40. That was it.
When we went back through the logs and games, it turned out to be stuck in three places.
The "forced moves" we'd added to help training were overriding 50-75% of the AI's moves. It was barely learning from its own play at all.
Nothing filtered out illegal moves, so a lot of training went into the AI picking moves it couldn't even play.
And too little of each game actually made it into the learning updates.
Eighteen versions of fixes, and still only 0-2 wins in 40 games against hard. Honestly, at this point we just wanted to sit down and give up.
Second try: a candidate-move policy network
So we switched tactics. Instead of choosing from all 136 possible moves, the AI only got every pawn move plus "the 8 walls that slow the opponent down the most" as candidates,
and a small neural network scored each one. Illegal moves never make the candidate list, so they're gone by design.
The board as the candidate-move policy network sees it (move 10 of a real game, orange to move). The light dots are squares the pawn can reach, and the dashed walls are the 8 walls that lengthen the opponent's path the most. The AI chooses only from these.
Training came in two stages. First it learned to copy a searcher that reads 3 moves ahead, just to get a starting point; then it played hard directly and learned by reinforcement from wins and losses alone.
We'd tried pure reinforcement learning from scratch, and it played 2,528 games without winning once. That starting point wasn't optional.
Trained against
hard, 3 moves deep
hard, 5 moves deep
3 moves deep only
98.3%
58.0%
5 moves deep only
70.3%
84.0%
Alternating 3 and 5
97.7%
91.5%
Here's the funny part. Train only against the 5-move version, and its win rate against the 3-move version, which it used to beat, sank to 70%. Tune for one opponent and you lose your grip on another.
This was the first time we saw it. It would not be the last.
Swept by the public engines
With hard behind us, we went looking for the Quoridor AIs published on GitHub. Our own rules engine refereed every game.
We clearly beat a school class tournament winner and several search engines. The two engines that pair a neural network with search, though, flattened us.
22 games, 22 losses each against Sigma and sugi. Its first real sparring session, and it got knocked out cold.
In the games we lost, the opponents used almost all of their walls. We used 6 to 8.
We'd limited the candidates to "walls that slow the opponent down right now", so defensive walls, or walls aimed a few moves ahead, were never even on the table.
So we flipped the whole idea around. No more scoring formulas written by a person: we went with the AlphaZero approach,
where the search reads out the moves the neural network suggests and checks them. Algorithm AIs like hard stayed on only as sparring partners, and the next targets were Sigma and sugi.
An AI that learns by playing itself: Kyu-Ridor (V1)
September 26 to October 5, 2026
Starting over, the AlphaZero way
The backbone of the new AI is one neural network answering two questions at once: "which moves look good here?" (the policy) and
"who's winning this position?" (the value). When it actually plays, it uses the network as a guide to read ahead through hundreds of lines (the search), then plays the move it looked at the most.
It learns from games against itself. Each training round plays about 1,000 new games,
and the network is taught what the search concluded in those games and who actually won. If the new model beats the current best at least 55% of the time, it takes over.
At first we rented cloud GPUs; a little later we moved everything to a workstation at home (one graphics card), running 20-30 minutes per round.
An AI caged by a human
Around this time we opened the web game so people could play it, and, well, the developer beat it without much trouble.
Over moves 10-18 the developer put up walls one at a time around the AI's pawn to build a cage, then shut the door on move 20. The AI's remaining distance jumped from 6 squares to 16.
Move 20 of a real game, recreated as is. The walls with blue stripes are the ones the human placed. The orange character (the AI) is trapped inside them.
Move 19. The AI's (orange) shortest path is 6 squares, shown by the dotted line.Move 20. The human closes the entrance with one wall (20), and the AI's shortest path goes from 6 squares to 16.
How to read the diagrams:AIHumanOpponent engine · The colored bands above and below the board mark each pawn's goal row, and the number on a wall is the move on which it was placed.
The more frustrating part was how the AI read the position. The entire time the cage was going up, it thought it was "almost certainly winning".
Playing only against itself, it had almost never seen anyone quietly build a cage over several moves. It simply never got the chance to learn that danger.
The good news: a model trained a bit longer spotted the same danger 2-4 moves earlier, and in later games where someone tried to cage it, it sometimes broke out by putting up walls of its own.
Games lost by one square
Going back over the losses to Sigma one by one, 10 of the 17 were by a single square. It was running out of calculation in the final race, where both sides trade walls on the way to the goal.
So we left the model alone and only raised how far it reads per move, from 200 simulations to 800.
Same model
200 simulations per move
800 simulations
vs Sigma (20 games)
3 wins
17 wins
3 wins became 17. Same model. That's why the AI in this web game normally reads a quick 200 simulations, then switches to 800 once both pawns get close to their goal.
We also gave the network more to look at. Besides the board itself, we added maps showing "how many squares at most can one wall of mine add to the opponent's path right now?" and
"how many squares at most can one of the opponent's walls add to mine?"
We don't learn the opponent's moves
Playing only against itself tends to give an AI tunnel vision. So we also mixed real games against Sigma into training.
But we never fed in Sigma's moves as the right answers. From those games, our AI learned only what its own search concluded and who won.
Learn how to beat the opponent, don't copy it. That rule hasn't changed since.
V1 'Kyu-Ridor'
The model from the 70th training round became the first official version: about 75,000 self-play games and about 23 hours of training on the workstation.
Opponent
V1 result
SigmaQuoridor
60 wins in 60 games
sugi (1,000 nodes)
0 wins in 20 games
V1 Kyu-Ridor, the first model to beat Sigma both moving first and moving second.
The same Sigma that had gone 22-0 against us now lost every game, whether we moved first or second. sugi, on the other hand... still not a single win.
While wrapping up V1 we noticed something odd. The training data was full of games with exactly the same sequence of moves.
13-30% of the self-play games were duplicates, and one game showed up 373 times. The AI was so sure about its first few moves that even with added randomness, the games never branched.
Learn the same game over and over, get even more sure of it, play the same game again... a vicious circle. That story continues in Part 3.
The more it played sugiyama2718, the more it forgot Sigma
To beat sugi, we poured lots of games against sugi into training. The wins against sugi didn't budge, but the results against Sigma fell apart first. A 60-for-60 record dropped at one point to 5 wins in 20.
Tracing through the logs, we found several problems piling up at once.
86% of the games against sugi were losses, and the same lost game was fed in up to 122 times. The only lesson on offer was "you lose".
Instead of learning "this position is bad", the AI's sense of the position learned "if sugi plays on from here, I lose". The same shape won in self-play and lost against sugi, so of course its judgment got tangled.
In a position that's already lost, every move leads to the same result, so the search's conclusion is basically random. Positions like that made up 37% of the training targets.
The stretch when it was so busy studying sugi that it forgot how to play Sigma.
Cleaning the data and a handicap ladder: V2 'QuoRim'
So we started with what it was learning from. Out went identical games, identical positions, moves from positions where the result was already decided, and positions that bounced back and forth within one game.
We also turned sugi's search down from 1,000 to 300, making it an opponent we could beat about 40% of the time. Think handicap games in Go: play someone you can actually beat, and learn from the games you win.
The network itself stayed the same; only the training material changed. Three rounds of that, and it finally beat sugi for the first time.
Measure
V1
V2 QuoRim
sugi 1,000 nodes (20 games)
0 wins
5 wins
Head-to-head vs V1 (400 games)
—
71.8%
The gap with sugiyama2718 was in the games where we moved first
When we gave both sides the same amount of search, something interesting showed up. Moving second, we were even with sugi; almost all of the gap came from games where we moved first.
Digging further, most of those losses came from one early sequence: on our fourth move we put a wall in a particular spot, sugi answered it, and from there our win rate was 9%.
And yet our AI thought it was ahead in that position. Go figure.
Move 8 of a real game between V2 (orange, moving first) and sugi (gray). 7 is the wall from our fourth move, and 8 is sugi's answering wall. We lost most of the games that went this way.Move 34 of the same game. sugi used its last three walls in a row on moves 30, 32 and 34, stretching our path to 9 squares (sugi's was 8). We still had 3 walls, but there was no spot left that would lengthen sugi's path by even one square, so we lost by one square with walls still in hand.
sugi's exact endgame calculation, on the other hand, wasn't what decided games. Going through every loss, there wasn't a single game where we were ahead by the time sugi started its endgame calculation.
The game had already been decided in the middle, while there were still walls left to play.
Practice one side and you forget the other
Drilling just that weak sequence pushed our win rate against sugi when moving first up to 60%. But now the second-player games fell apart, and the record against Sigma slid to 9 wins in 20. Fix one thing, break another. Classic whack-a-mole.
So we made separate sets of games against sugi, one where we only moved first and one where we only moved second, mixed them 6:4, and trained on them together with Sigma games.
QuoRim-3
Measure
V1
V2
QuoRim-3
Head-to-head vs previous model (400 games)
—
71.8%
88.2%
SigmaQuoridor (20 games)
60/60
16/20
19/20
sugi 1,000 nodes
0/20
14/60
11/40
QuoRim-3 beat V2 88.2% of the time and nearly recovered its record against Sigma. Against sugi, 28%. Yes, still a long way to go.
QuoRim-3 was the AI you played on this site until November 26.
QuoRim-3, the AI on this site until November 26.
Once QuoRim-3 was done, we had a feeling it had weaknesses that engine-vs-engine games would never reveal. So we decided to take on challengers directly.
We opened a separate page for challenging the AI, and someone far stronger than we expected showed up. That's Part 4.
On October 24 we opened a challenge page against QuoRim-3. You pick a nickname, agree to have the game recorded, choose to move first or second, and you're playing.
The AI is QuoRim-3 at 800 simulations per move, and if a person wins, a verification code made with a key only the server knows appears on the screen.
The first week, not a single challenge came in from outside. Crickets. People only started showing up after we posted again in a few communities on November 1.
And the first recorded "human win"? Not actually a human win. Someone opened two games at once and copied the AI's moves from one board to the other,
so in effect the AI was playing itself, and the two games were identical up to move 43.
35 straight wins, then Yepa
On the morning of November 6, about an hour after we posted in a community, someone called 'Yepa' showed up. Until then, the AI had won all 35 regular games.
Yepa kept at it without a break until around 3 p.m., and won twice that day alone.
The first win took 51 moves and 3 minutes 43 seconds. Yepa blocked the passage the AI was using to swing right and head down with 4 walls, pushing its remaining distance from 5 squares to 12,
and used all 10 walls.
Taking this game apart, we found a bigger hole. In any given position, the AI always played the same move. Which meant anyone could win just by replaying these 51 moves.
So that same day we rushed out a fix: for the first 30 moves, it now picks at random among moves that are about equally good.
Move 27, one wall
Yepa came back after the fix too, and the second win was a brand-new game, not a replay; only the first 6 moves matched. 43 moves, 4 minutes 29 seconds.
On move 18 the AI rated the position +0.96 (the closer to 1, the surer it is of winning), and on move 26 it was still at +0.95. This even though a vertical wall on move 25 had already stretched the AI's remaining distance from 6 squares to 10.
On move 27 Yepa put up one vertical wall at the very end of column a, and only then did the AI's evaluation flip to −0.89. Apparently, the AI saw it as just another wall.
While the AI worked its way 10 squares out of the trap, Yepa strolled straight along the left edge to the goal.
Move 27, right after Yepa (blue) placed the vertical wall (27) at the end of column a. The dotted line is the 10-square path the AI (orange) has to take to get out.Move 43, the final position. Yepa has used all 10 walls, and the AI's pawn is still making its way out of the lower left.
Up to the fifth win
Yepa won three more times on November 7 and 8. In one of those games, the AI moved its pawn toward the left edge on move 20. At that point the AI was ahead, 3 squares to go against Yepa's 5.
Then Yepa closed off the edge bit by bit with a few walls, and on move 33 used a last wall to stretch the AI's path from 2 squares to 8. When we later had QuoRim-3 analyze that move-20 position at 4,000 simulations, it was split almost evenly between the move it actually played and another one.
The final position of Yepa's winning game on November 7, recreated in 3D. The walls with blue stripes are Yepa's.
The fifth win, early on the morning of November 8, matched this game for the first 23 moves. We had changed the AI to mix up its moves, but in those positions there was really only one good move as far as it could see, so there was nothing to mix in.
Remembering a winning line and playing it again: that was something we'd never once seen from an engine.
Was it really a human?
When a person wins, the first thing we check is whether they had another AI running on the side and copied its moves. For each move the person played, we work out what sugi and Sigma would have played and look at the match rate,
and we also look at how much the time per move varies. Yepa's match rate with sugi was around 70%, close to ordinary players (64%) and far from sugi itself (90%).
Thinking times ran anywhere from under a second to long thinks of over 57 seconds. These weren't moves copied from an engine. Yepa found them.
Closing the challenge
By November 8 the challenge had ended at 72 games: 64 wins for the AI and 8 for humans. 5 of those 8 were Yepa's.
The games humans won became training material. Not by having the AI learn the human moves, though: we took about 200 positions from the middle of those games, had the AI play them out against itself, and learned from the results.
The model trained that way raised the AI's win rate in those positions from 27.6% to 38.4%, but its results against sugi and Sigma wobbled, so it didn't get to replace QuoRim-3.
The positions from the game where the AI went to the edge on move 20 haven't been won by any model even once so far.
We closed challenge mode on November 9, and the site is now a regular game anyone can play right away. Regular games also mix in roughly equal moves early on.
Thanks to Yepa, we got our first real look at where the AI is confidently wrong. We'll write the next post when a model comes along that can get past these games.
Quoridor AI comparison: QuoRim-3, sugiyama2718, SigmaQuoridor
November 17, 2026
Let's just have all three play each other
“Now, kill each other.”Internet meme parody
So far we had measured our AI against two open-source engines. Both are on GitHub, and both pair a neural network with search, just like ours.
Then it hit us: we had never actually put those two engines against each other. So we had all three AIs play every pairing. Our own rules engine refereed every game, and the first move alternated game by game.
The engines ran with sugiyama2718's defaults and with the settings SigmaQuoridor's author used in tournaments. Both engines add a little randomness when choosing moves.
Played normally? sugiyama2718 comes out on top
Match
Games
First-named AI
sugiyama2718 vs Sigma
40
34-6 (85%)
QuoRim-3 vs Sigma
20
19-1 (95%)
QuoRim-3 vs sugiyama2718
40
15-25 (38%)
Sigma lost badly to both, and sugiyama2718 beat QuoRim-3 too. Line them up and you get sugiyama2718, QuoRim-3, Sigma.
The funny part: QuoRim-3 beats Sigma more often (95%) than sugiyama2718 does (85%). So the ranking isn't quite a neat straight line.
Different games, same openings
sugiyama2718 won all 20 games it played first against Sigma. Follow them to the end and all 20 are different, but up to move 8 there were only five lines.
Even with a bit of randomness, sugiyama2718 plays almost the same opening moves, quietly steering the game into territory it knows.
The 40 games between QuoRim-3 and sugiyama2718 looked the same. Of the 20 games where QuoRim-3 moved second, 11 were identical for the first 20 moves, and QuoRim-3 won only 2 of those.
We did play 40 games, but really we had measured a handful of positions over and over.
So what if we mix up the opening?
So we replayed everything with each game starting on 1 to 4 random pawn moves (counted over both sides). That way nobody gets to follow a favorite opening, and every game tests real skill from a different position.
First-named AI wins
Normal
Random start
sugiyama2718 vs Sigma
85%
65%
QuoRim-3 vs Sigma
95%
83%
QuoRim-3 vs sugiyama2718
38%
53%
Games played: 40, 20 and 40 with normal starts; 40, 40 and 80 with random starts.
And just like that, the gap between QuoRim-3 and sugiyama2718 vanished: 42-38 over 80 games, with QuoRim-3 slightly ahead.
In other words, much of sugiyama2718's edge over QuoRim-3 came from its well-polished opening play. Against Sigma, too, sugiyama2718 dropped from 85% to 65%.
QuoRim-3 also dropped against Sigma, from 95% to 83%, but it still beats Sigma more often than sugiyama2718 does (65%).
How much is moving first worth?
In the 40 normal games where the two engines took turns moving first, the first player won 26 (65%). In the 40 random-start games it won exactly 20 (50%).
A lot of what we thought of as "the first-move advantage" seems to come from the first player getting to steer the game into an opening it knows well.
To sum up
From the usual opening, sugiyama2718 is the strongest. QuoRim-3 scores 38% against sugiyama2718 and 95% against SigmaQuoridor.
With varied openings, QuoRim-3 and sugiyama2718 are about even, and both are clearly stronger than SigmaQuoridor. Against Sigma, QuoRim-3 (83%) does better than sugiyama2718 (65%).
Engine-vs-engine results depend heavily on opening lines. When measuring an engine over a few dozen games, first check that the games actually reach different positions.
From here on, we measure the next model with random-start games. The candidate in training now beats sugiyama2718 71% of the time under these conditions (57 of 80).
Once it passes 90%, it will go live on this site as QuoRim-4.
On November 26, this site's AI changed from QuoRim-3 to QuoRim-4. Let's start with the report card. For once, there are a few numbers worth showing off.
Measure
QuoRim-3
QuoRim-4
sugiyama2718, 80 games, random openings
53%
86%
sugiyama2718, 88 games from book openings
43%
56%
SigmaQuoridor, 40 games, random openings
83%
90%*
Head-to-head vs QuoRim-3, 100 games
—
85%
"Random openings" means every game starts with 1 to 4 random pawn moves (counted over both sides). The 100 head-to-head games used the site's "Normal" setting (200 search simulations per move); in the rest our AI used 800, Sigma 400 and sugiyama2718 1,000 nodes. * One of the 40 games ended in a Sigma engine error and is left out (35 wins in 39).
Getting here was not exactly a smooth ride.
The student who got worse the more it studied
The next candidate at the end of Part 5 beat sugiyama2718 71% of the time with random openings. Hoping to push it toward 90%, we retrained it six times, and all six came out weaker. The more it studied, the worse its grades got.
The problem was the textbook. sugiyama2718 plays nearly the same opening moves, so 31% of the 7,350 games collected so far were identical from start to finish.
It was like a stack of workbooks where nearly one in three was a photocopy of the same problems. The AI seemed to be fitting those few lines rather than learning Quoridor.
So we changed the textbook. The training games now also start with 1 to 4 random moves, which cut identical games from 31% to under 4%. And for the first time, a retrained model beat the one before it (71% to 80%).
Thinking longer does not produce the answer
We also tried a shortcut that needs no training: doubling the search from 800 to 1,600 simulations per move. It backfired. The win rate against sugiyama2718 fell from 84% to 74%.
Give an AI that misreads the position more time, and it seemed to follow its misreading further and more confidently. A wrong answer does not become right because you stare at it longer. What needed fixing was the judgment, not the thinking time.
Meeting opening theory
Namuwiki documents 12 Quoridor openings and their replies, mostly as diagrams. We turned each diagram into a move sequence, added the mirror images for 44 positions in all, and had our models play sugiyama2718 from there.
The results stung. A model that won 80% with random openings dropped to 55% from the book openings, and QuoRim-3 fell from 53% to 43%.
The reason was simple. Our random openings only moved pawns, but in the book openings walls are on the board from the start. Our AI had barely ever been in an early wall fight.
A position from the "Gap" opening. After three steps each, both sides start placing horizontal walls. Orange walls are our AI's, gray walls the engine's.
Out of curiosity we also counted how you actually play on this site. In 74% of 141 finished games, the person placed their first wall within their first four moves. And every one of the 13 games won by outside visitors had its first wall on the fourth move.
You were already playing the early wall fight. Only the AI hadn't noticed.
So we took the 44 book positions, added 112 opening positions from games on this site (42 of them from games people won), and used those 156 positions as starting points for training.
We did not have the AI memorize the book moves or people's moves as right answers. It played on from each position by itself and learned only from its own search and who won. We borrow positions, not moves; that rule has not changed.
Focus on one opponent, forget the others, again
What happened in Part 3 happened again. A model trained only on games against sugiyama2718 held its score against sugiyama2718, but when we put it up against the older QuoRim-3, it lost, scoring 47%.
The fix was the same as before. Mixing in the AI's self-play games kept its strength against sugiyama2718 and beat QuoRim-3 78% of the time. QuoRim-4 is that recipe plus games from the opening positions.
The memorized winning line stops working
In QuoRim-3's last week on the site, people started winning again. On November 23 a person won three games moving second, and the second and third games followed the earlier winning game move for move, up to moves 24 and 39.
Because the AI kept answering that position the same way, walking the same path won again. Early on November 25 a different visitor won moving first.
We replayed all 13 games people had won with QuoRim-4. In 7 of them it sidestepped the decisive wall by choosing a different move just before it. QuoRim-3 managed that in 1.
The November 23 line in particular splits off at QuoRim-4's fourth move. The memorized plan now goes off track right at the start.
Move 7 of the November 23 games, with the AI (orange) to move. In all three games QuoRim-3 placed the horizontal wall marked 3; QuoRim-4 picks the one marked 4. The memorized line breaks here. Dotted lines are each pawn's shortest path to its goal row.
A little short of the promised 90%
In Part 5 we boldly promised to release QuoRim-4 once it beat sugiyama2718 more than 90% of the time. It came in at 86%. To be honest, that falls a little short.
We released it anyway, for good reasons. It is ahead of QuoRim-3 on all four measures we took, and it sidesteps a little over half of the holes people found. Most of all, at the "Normal" setting you play against, it beats QuoRim-3 85% of the time. We decided a better opponent now beats a perfect one later.
The final position of a game that started from the "Gap" opening. Every earlier model lost from this position; QuoRim-4 beat sugiyama2718. Both sides used all ten walls in a long, hard-fought game.
Two goals come next: 90% against sugiyama2718, and raising that 56% from book openings.
If you beat QuoRim-4, feel free to brag. That game will be the most valuable lesson the next model gets.
Quoridor.run is a hobby project built and run by a single independent developer in Korea. There are no ads and no sign-up.
The AI was trained on one home workstation (a single graphics card) and rented cloud GPUs, and the game server also runs on one machine at home.
The site is not affiliated with Gigamic, the publisher of Quoridor.
Training uses both self-play games and games against other engines. But we never copy the moves of people or other engines as right answers; our AI learns only from its own search results and who won.
The character and tree models used in the game and in this post's 3D images are from Kenney (Mini Characters, Nature Kit), and the wood texture is from ambientCG (Wood049), all CC0 (public domain).