Setting the rules of Negaeri Shogi by playing AI against AI: one change that worked, six that broke

日本語版

Development log of Negaeri Shogi / September 2026

Negaeri Shogi is a shogi-style game on a 6×6 board played a bit like Othello. Pieces you sandwich defect to your side and are promoted at the same time. If the new moves of a promoted piece create another sandwich, the flips continue. That is a chain.

The rules come down to about ten numbers. I did not set them by feel. I ran dozens of AI-vs-AI games per candidate and measured. Only one change really worked; most of the others broke the game. I keep the ways they broke here.

The numbers come from the measurement log in the game’s README (as of 13 September 2026). They are AI-vs-AI results. Balance between human players has not been verified enough yet.

What I measured, and how

The AI is a home-made alpha-beta search. I made depth-3 AIs play each other and counted:

Candidates were compared at 40 games each; final numbers use 100 games. Anyone can re-run it with the README commands (npm run report, npm run sweep).

The first rules barely did anything

At first a sandwich only worked along the directions a piece can move in shogi. In AI-vs-AI games, only 2% of drops caused a flip. Games lasted 16 moves and the first player won 71%. A flipping game where almost nothing flipped.

StageDrops that flipAvg. movesFirst player wins
Start (move directions only, empty board)2%1671%
All 8 directions8%——
Formation start position—29—
Pieces next to the king are safe42%5133%
One extra pawn in hand for the first player42%6147%
Board edge counts as the end of a sandwich81%5359%

The first player’s win rate jumps 71%, 33%, 47%, 59% because each rule change moved the advantage somewhere else. Every change needed a fresh measurement.

The change that mattered: the edge is an anchor

If a run of enemy pieces ends at the edge of the board, it counts as sandwiched. Pieces pushed against the edge defect together. This took flipping drops from 42% to 81%. Compared with other ideas at 40 games each:

IdeaFlips per moveGames with a 3+ chainLead changes
Before0.7615%7.0
Edge as anchor2.5185%7.4
+ dropped piece is promoted too3.0680%9.9
Dropped piece promoted, alone0.7213%5.0
Chain limit of 30.718%5.8
Piece-count result at 60 moves0.693%4.8

Promoting the dropped piece too adds flips, but lead changes rise to 9.9 and the lead flips nearly every move, which thins out the shogi side of the game. I left it out (one setting turns it on).

What I tried and dropped

IdeaWhat happened
Off-direction sandwiches reach only 1 squareGames with a 3+ chain fell from 95% to 13%. The reach of a sandwich was the engine of chains.
5×5 boardFlips per move rose from 2.88 to 5.99, but the first player won 70%. Games were short (35 moves).
Remove the king guardGames ended in 17 moves on average and the first player won 95%. Guards defect at once and the king is left bare.
Chain limit of 8Almost identical (2.86 vs 2.88 flips per move). The limit of 5 hardly mattered.
Dropped piece promoted by a big flipMore flips, but 9.9 lead changes: it flips every move.
Piece-count result at 60 movesGames with a 3+ chain fell to 3%.

The most useful row was “a limit of 8 changes nothing.” Raising the limit sounds like it should add chains. Measured, the result barely moved, so the limit of 5 was not doing much. I was about to tune a number that did not matter.

Pieces next to your king never defect

In this game a piece next to your own king does not defect. Removing that rule is the third row above: 17 moves on average and a 95% first-player win. Guards defected in a single move and the king was taken early. It is one plain sentence in the rules, and the game does not work without it.

Current numbers (100 AI-vs-AI games, depth 3)

MeasureValue
Average length52.7 moves
Board fill61%
Drops that flip81%
Flips per move3.08
Games with a 3+ chain87%
Games with a 4+ chain38%
Average lead changes10.4
Games with no lead change0%
Games where the loser led at some point98%
Point at which the result is decided81% of the way through
First player’s win rate61%

The board changes hands again and again and stays close to the end, yet it is not luck: a depth-3 AI beat a depth-2 AI in 20 of 24 games (as first or second player). 98% of games end by taking the king, so sandwiching stays a means and the shogi goal stays the goal.

Still unsolved: the first player’s edge

In the final measurement the first player won 61% (59% in an earlier, separate measurement). That is 11 points from 50%. I tried five handicap setups and found none clearly better.

HandicapFirst player wins
None33%
One extra pawn in the first player’s hand (current)61%
One extra pawn on the first player’s side of the board38%
Move one of the first player’s board pawns into hand64%
Extra pawn in hand for the first player and extra pawn on the board for the second27%

Pieces come in whole units, and the same “one pawn” is worth very different amounts depending on where it is placed: a point-symmetric addition moved the result by +5 points in one case and −34 in the other. Adding up small pieces cannot tune it to 50%.

In online play, matchmaking gives the first move to the lower-rated player, which partly cancels the gap. That is not a fix. Games between humans are still to be checked.

What I learned

Half the changes that felt like good ideas broke the game when I measured them.

This is the English version of the original Japanese article. Numbers come from the README measurement log (13 September 2026). Negaeri Shogi is free to play in the browser.

More in English