AI x SFC Player

Posts · · 繁體中文 · 简体中文 · 日本語

Xiangqi Pack by AI: banqi, xiangqi, xiangqi mahjong and a soldier's story, in your browser

This time the idea was to use the pieces of xiangqi (Chinese chess) as characters for a series of board games, and to put them all in one game file where you pick a game at start, hence the name “pack”. The pieces are round wooden discs with a character on them, and also a face: they say hello when turned up, say a line when they take, and “go back to camp for a rest” when taken.

Xiangqi Pack (象棋大補帖) is a game for a retro TV game console format; the whole game file is 2 MB. Inside:

EntryWhat’s there
The hallBanqi, xiangqi and xiangqi mahjong; the computer at three strengths (easy, normal, hard); banqi and xiangqi also for two players
Story“The Little Soldier Grows Up”, six chapters, each using one of the games as its level
ToysPiece of the day: draw a piece, get a word of encouragement
Language中文, English, 日本語, 한국어, Tiếng Việt, switched with left / right on the title menu; the characters on the pieces stay the same

The rules are traditional games; the code, the computer players, the graphics, the characters and four songs were made by an AI. The AI worked about 210 minutes, about US$58 at API prices.

It is also our first game in more than one language: Chinese, English, Japanese, Korean and Vietnamese, switched with left / right on the title menu, and the text and fonts on screen change with it. The translations were done by the AI too.

Play it in your browser: aixsfc.app/player/?load=xiangqi. It is free to play; to share it, send your friends this address.

The title, banqi, xiangqi, xiangqi mahjong (the computer plays every side in these three), the opening of the story's chapter 1, and the piece of the day (sound on). Picture and sound straight from the player's emulator.

How to play

The title: Xiangqi Pack, with four bobbing pieces
The title: the hall, the story, the toys; left / right on the last row changes the language.
Banqi: a 4×8 board, the black chariot speaking as it turns up
Banqi: each kind of piece says a line the first time it turns up.
Xiangqi: the river, and the thinking seconds by each name
Xiangqi: by each name, how many seconds this move has taken.
Xiangqi mahjong: you and three computers, the wall in the middle
Xiangqi mahjong: you against three computers; a set and a pair wins.
The story: chapter 1, the recruits' camp
The story, chapter 1.
The little soldier: wow, everyone is so big, I'm the smallest
The smallest soldier arrives at the recruits' camp. The other five chapters are yours to play.
Piece of the day: today you are the chariot
Piece of the day: encouragement only, no good or bad luck.

How the computer plays

Each game’s computer was first written as a JavaScript reference program, played against itself many times to set the strengths, then written again in the console’s assembly language following it.

Banqi: easy takes something at random seven times in ten when it can; normal scores each move (what it takes, whether it can be taken back); hard picks the best 8 moves and looks one turn deeper. The reference against itself, 300 games (taking turns to start):

MatchWonLostDrawn
Normal vs easy30000
Hard vs easy29901
Hard vs normal9952149

The many draws are banqi as it is: both sides play carefully, and 50 turns without a flip or a take is a draw.

Xiangqi: the first move is picked at random from 8 common openings (central cannon, horse, elephant, the pawn opening); after that every move gets a quick look (one move, the captures after it, and whether it threatens a big piece), and the best few lines are read two moves deeper, captures followed to the end. Easy reads 2 lines, normal 5, hard all of them. 20 games each:

MatchWonLostDrawn
Normal vs easy1208
Hard vs normal1460
Hard vs easy1730

On the console, easy and normal take up to about 2 seconds a move, hard usually 2–4 seconds and at most about 7. So by both names the screen shows how many seconds this move has taken, and you can see the other side is thinking.

Xiangqi mahjong: easy discards at random; normal discards the piece that leaves the most kinds of winning pieces; hard also counts how many of each are still unseen. 4000 hands: at a table of three easy players, a normal or hard player wins about 34–36%, each easy one about 5%. Normal and hard come out about the same; luck counts for a lot in this game.

How we checked it

How the AI built it

Cost

AI working timeabout 210 minutes
ModelClaude Opus 5.5, about 440 replies
AI output tokensabout 550,000
Total tokens processedabout 190 million (mostly cache reads)
Estimated costabout US$58 (at Anthropic API prices of November 2026; subscriptions are billed differently)
Other costsnone: the font is openly licensed, everything else was made for this game

Versions

VersionWhat changed
1.261108.7The language moves to the last row of the title menu, switched at once with left / right
1.261108.6Languages: 中文, English, 日本語, 한국어, Tiếng Việt, saved; the saved game is read back at start
1.261108.5The story “The Little Soldier Grows Up”, six chapters
1.261108.4Xiangqi mahjong
1.261108.3Xiangqi: each side’s seconds on this move by its name
1.261108.2Xiangqi’s computer redone: common openings at random, captures followed to the end, strength as “how many lines it reads”
1.261108.1Xiangqi: against the computer at three strengths, two players
1.261108.0The hall menu; quick presses no longer missed
1.261107.1Banqi: a red general that vanished when turned up; a main menu item too wide for its box
1.261107.0First version: banqi (against the computer, two players), piece of the day

Not done yet

For parents and teachers

To make your own game with AI, run npx https://aixsfc.app/skill/aixsfc.tgz in an empty folder, then start claude; see the home page.

Sources and licences