Xiangqi (Chinese Chess) Rules & Guide
1. Board Layout & Pieces
Pieces are placed on line intersections. General and Advisors are confined to the 3x3 Palace. Elephants move in a 2x2 field without crossing the river. Chariots move freely orthogonally. Soldiers march forward 1 square; once across the river, they can also move horizontally.
2. Blocking Rules & Cannons
Horses step one point orthogonally then one point diagonally; an adjacent piece in the orthogonal direction blocks the step ("blocking horse legs"). Elephants are blocked if the center point is occupied. Cannons capture by jumping over exactly one screen piece.
3. Flying Generals & Checks
Flying General Rule: Opposing Generals cannot face each other on the same vertical file without intermediate pieces. Checking requires immediate defense. Stalemate (no legal moves available) counts as a loss for the immobilized side.
4. AI & P2P Multiplayer
Features 2-Player mode, AI self-play, and 3 AI difficulties. Hard AI employs 3-ply Minimax depth search with Alpha-Beta pruning and tactical piece-weight evaluation.
🌐 Online Multiplayer (P2P) Guide
① Host a Room (Host Player)
Switch mode to "Online 2-Player (P2P)". The system automatically generates your Peer ID. Share this code with your friend. The host plays as Red (First Move).
② Join or Spectate
Enter your friend's Peer ID. Click "Connect" to play as Black (Second Move) with board perspective auto-flipped, or click "Spectate" to watch the live match in real time without interfering.
③ Undo & Rematch Requests
In P2P matches, clicking "Undo" or "Restart" sends a confirmation request to your opponent. The request takes effect only when accepted by both parties.
④ In-Game Chat & Resignation
Use the live chat sidebar to communicate with opponents and spectators. Click "Resign" anytime to concede the match gracefully.