Knight Chess: A Chess Variant with Extended Board and Enhanced Knight Dynamics

Romi Nur Ismanto
Independent AI Research Lab, Jakarta, Indonesia
rominur@gmail.com
February 2025

Abstract

We present Knight Chess, a chess variant that modifies the classical game through two fundamental changes: extending the standard 8×8 board to an 8×9 configuration and replacing three randomly selected pawns per side with additional knights, yielding five knights per player. These modifications fundamentally alter positional strategy, tactical complexity, and the balance between short-range and long-range piece interactions. The game is implemented as a web application featuring an AI opponent powered by the Minimax algorithm with alpha-beta pruning, supporting search depths up to 5 plies across three difficulty levels. The system incorporates a 10-minute countdown timer per player, a token-based economy for rewarding victories, and a competitive leaderboard. Built on Next.js with TypeScript and deployed on Vercel, Knight Chess demonstrates how classical game tree search algorithms remain effective for chess variant AI when combined with domain-specific evaluation functions tuned to the altered piece dynamics of the extended board.

Keywords: chess variant, knight dynamics, minimax algorithm, alpha-beta pruning, game tree search, extended board, web-based game, Next.js, gamification

1. Introduction

Chess has been a subject of intense study in artificial intelligence since Shannon's foundational work on programming a chess-playing computer (Shannon, 1950). While standard chess has been explored exhaustively—culminating in superhuman engines such as Stockfish and AlphaZero—chess variants offer fertile ground for investigating how rule modifications affect strategic depth, computational complexity, and AI design.

The knight is arguably the most distinctive piece in chess. Unlike all other pieces, the knight moves in a non-linear L-shaped pattern and is the only piece capable of jumping over others. In standard chess, each side begins with two knights, and their influence is often considered secondary to bishops, rooks, and queens in the endgame. However, increasing the number of knights fundamentally changes the strategic landscape: fork threats multiply, positional control becomes less predictable, and the interplay between knights and other pieces shifts the balance of tactical versus positional play.

Knight Chess explores this hypothesis through two coordinated rule changes. First, the board is extended from 8×8 to 8×9, adding one additional row that provides strategic depth and allows pieces more room to maneuver during the opening phase. Second, three pawns per side are randomly replaced by knights at the start of each game, giving each player five knights instead of the standard two. The random replacement ensures that no two games begin with the same configuration, introducing a layer of variability that demands adaptive opening strategy.

The key contributions of this work are:

2. Game Design

2.1 Board Extension

The Knight Chess board consists of 8 columns (files a–h) and 9 rows (ranks 1–9), adding one extra rank compared to the standard 8×8 board. The additional rank is inserted between the pawns and the back rank on each side, providing a buffer zone that changes the opening dynamics of the game. Pawns for White begin on rank 3 (instead of rank 2) and pawns for Black begin on rank 7 (instead of rank 7 on a standard board, now rank 7 on the 9-rank board), while back-rank pieces occupy ranks 1–2 and ranks 8–9 respectively.

The extended board has several strategic implications. First, it increases the number of moves required for pawns to reach the promotion rank, making pawn advancement a longer-term commitment. Second, it provides knights with more squares to occupy in the center, amplifying their tactical influence. Third, it slightly delays piece contact between the two sides, leading to richer middlegame positions as both players have additional time to develop their pieces.

2.2 Knight Replacement Mechanics

At the start of each game, three pawns per side are randomly selected and replaced with knights. Combined with the two standard knights already present in the initial setup, each player commands five knights. The random selection ensures positional variety: in some games, the additional knights may cluster on one wing, while in others they are distributed evenly across the board.

This randomized replacement mechanism serves multiple purposes:

2.3 Rules and Win Conditions

Knight Chess follows standard chess rules with the following modifications:

3. AI Engine

3.1 Minimax Algorithm with Alpha-Beta Pruning

The AI opponent employs the Minimax algorithm (Von Neumann, 1928) with alpha-beta pruning (Knuth & Moore, 1975) to search the game tree. Minimax is a recursive algorithm that evaluates all possible game states to a given depth, assuming both players play optimally. The maximizing player (AI) selects moves that maximize the evaluation score, while the minimizing player (human) is assumed to select moves that minimize it.

Alpha-beta pruning significantly reduces the number of nodes evaluated by eliminating branches that cannot influence the final decision. When a branch is provably worse than an already-explored alternative, the entire subtree is pruned. In the best case, alpha-beta pruning reduces the effective branching factor from b to b1/2, allowing the search to reach approximately twice the depth within the same computational budget.

The core search procedure can be expressed as follows:

function minimax(node, depth, alpha, beta, maximizingPlayer):
    if depth == 0 or node is terminal:
        return evaluate(node)

    if maximizingPlayer:
        maxEval = -infinity
        for each child of node:
            eval = minimax(child, depth - 1, alpha, beta, false)
            maxEval = max(maxEval, eval)
            alpha = max(alpha, eval)
            if beta <= alpha:
                break   // beta cutoff
        return maxEval

    else:
        minEval = +infinity
        for each child of node:
            eval = minimax(child, depth - 1, alpha, beta, true)
            minEval = min(minEval, eval)
            beta = min(beta, eval)
            if beta <= alpha:
                break   // alpha cutoff
        return minEval

3.2 Evaluation Function

The evaluation function is the critical component that guides the AI's decision-making. For Knight Chess, the evaluation function considers the following factors:

Material valuation: Each piece type is assigned a base value reflecting its relative strength. Given the altered piece composition in Knight Chess, the knight's value is adjusted upward to reflect its increased tactical importance when five are present on the board.

Table 1: Piece values used in the evaluation function
Piece Value Notes
Pawn 100 Base unit; fewer per side than standard chess
Knight 350 Elevated from standard ~320 due to increased presence
Bishop 330 Standard valuation
Rook 500 Standard valuation
Queen 900 Standard valuation
King 20000 Effectively infinite; ensures checkmate detection

Positional scoring: Piece-square tables assign bonuses or penalties based on board position. Knights receive higher bonuses for central squares on the 8×9 board, reflecting their increased value when controlling the expanded center. The piece-square tables are adapted from standard chess tables but rescaled for the 9-rank board geometry.

Mobility: The number of legal moves available to each side is incorporated as a secondary evaluation factor. Higher mobility generally indicates better piece coordination and more tactical opportunities.

King safety: Proximity of enemy pieces (especially knights) to the king is penalized. With five knights capable of delivering forks from multiple directions, king safety evaluation is weighted more heavily than in standard chess engines.

The composite evaluation function is:

E(s) = w1 · Material + w2 · Position + w3 · Mobility + w4 · KingSafety

3.3 Difficulty Levels and Search Depth

Knight Chess offers three difficulty levels that control the AI's search depth. Deeper search allows the AI to anticipate more moves ahead, resulting in stronger play at the cost of increased computation time.

Table 2: AI difficulty levels and search configuration
Difficulty Search Depth Approximate Nodes Evaluated Behavior
Easy 2 plies ~1,000–3,000 Responds to immediate threats; limited tactical awareness
Medium 3 plies ~10,000–50,000 Recognizes basic tactics; moderate positional play
Difficult 5 plies ~200,000–1,000,000 Deep tactical calculation; strong positional understanding

The branching factor in Knight Chess is notably higher than in standard chess due to the presence of five knights per side. In standard chess, the average branching factor is approximately 35; in Knight Chess, the additional knight moves increase this to an estimated 42–50 in typical middlegame positions. Alpha-beta pruning mitigates this increase, but the effective search time at depth 5 remains a significant computational task, requiring careful optimization.

4. System Architecture

4.1 Frontend Architecture

The application is built on Next.js, a React-based framework that provides server-side rendering, file-system routing, and API routes within a unified project structure. The user interface is implemented with TypeScript for type safety and Tailwind CSS for responsive styling.

The game board is rendered as a responsive grid component that adapts the 8×9 layout to various screen sizes. Each square is an interactive element supporting click-based piece selection and move execution with visual highlights for legal moves, last move indication, and check alerts.

4.2 Game State Management

The game state is managed through React state hooks and encapsulates the following data:

4.3 AI Web Worker

The Minimax search is computationally intensive, particularly at depth 5. To prevent the UI from freezing during AI computation, the search algorithm runs in a dedicated Web Worker thread. This architecture separates the AI computation from the main rendering thread, ensuring that the game interface remains responsive while the AI evaluates positions.

The communication flow between the main thread and the AI worker follows a message-passing protocol:

Main Thread (Game State) → postMessage → Web Worker (Minimax Search) → postMessage → Main Thread (Apply Move)

When it is the AI's turn, the current board state and difficulty setting are serialized and sent to the worker. The worker executes the Minimax search, identifies the optimal move, and returns it to the main thread, which then applies the move to the board and updates the UI.

4.4 Authentication

User authentication is handled by NextAuth.js, which supports multiple authentication providers including Google OAuth and email-based sign-in. Authenticated sessions enable persistent player profiles, token balances, and leaderboard participation. Unauthenticated users can play against the AI but do not accumulate tokens or appear on the leaderboard.

5. Gamification

5.1 Token Economy

Knight Chess implements a token-based reward system to incentivize continued play and improvement. Players earn tokens by winning games against the AI, with the reward amount scaled by difficulty level:

Table 3: Token rewards by difficulty level
Difficulty Tokens per Win Rationale
Easy 10 Low reward reflecting lower challenge
Medium 25 Moderate reward for balanced play
Difficult 50 High reward for defeating the strongest AI

The token system provides a persistent measure of player achievement. Tokens accumulate across sessions and serve as a proxy for overall skill progression. This mechanism draws on established gamification research demonstrating that tangible progress indicators increase player retention and motivation (Deterding et al., 2011).

5.2 Leaderboard System

A global leaderboard ranks all authenticated players by their total token count. The leaderboard serves as a social comparison mechanism, encouraging competitive play and providing a visible ranking that rewards consistent high-level performance. The leaderboard updates in real time as games conclude, providing immediate feedback on rank changes.

The leaderboard design follows best practices from competitive gaming platforms: displaying player name, total tokens, number of wins, and current rank. This transparency allows players to set concrete improvement goals and track their progress relative to the broader community.

6. Implementation Details

6.1 Technology Stack

Table 4: Core technology stack
Component Technology Purpose
Framework Next.js React-based fullstack framework with SSR and API routes
Language TypeScript Type-safe JavaScript for robust game logic
Styling Tailwind CSS Utility-first CSS framework for responsive UI
Authentication NextAuth.js OAuth and session management
AI Engine Minimax + Alpha-Beta (TypeScript) Game tree search in Web Worker
Deployment Vercel Serverless hosting with edge functions
State Management React Hooks Local game state with context providers
Timer Browser setInterval Per-player 10-minute countdown

6.2 Performance Considerations

The primary performance challenge is the AI search at depth 5. On a modern browser running on a mid-range device, the Minimax search with alpha-beta pruning at depth 5 completes within 2–8 seconds for typical middlegame positions. Several optimizations contribute to this performance:

6.3 Deployment

Knight Chess is deployed on Vercel's edge network, providing global low-latency access. The application is accessible at https://knight-chess.vercel.app. The serverless architecture handles authentication, leaderboard queries, and token management through Next.js API routes, while all game logic and AI computation execute client-side in the browser.

The source code is publicly available at https://github.com/romizone/knight-chess.

7. Conclusion and Future Work

Knight Chess demonstrates that targeted modifications to classical chess rules—specifically, board extension and knight proliferation—can produce a variant with meaningfully different strategic properties while remaining computationally tractable for traditional game tree search algorithms. The 8×9 board and five-knight configuration increase the average branching factor by approximately 20–40% compared to standard chess, creating richer tactical positions dominated by non-linear piece movement patterns.

The Minimax engine with alpha-beta pruning provides a competent AI opponent across three difficulty levels, with the depth-5 search at the Difficult setting offering a genuine challenge to experienced players. The Web Worker architecture ensures that this computational intensity does not compromise the user experience.

The gamification layer—combining timed play, token rewards, and a leaderboard—adds a competitive dimension that encourages sustained engagement. These elements are lightweight by design, avoiding the complexity of full ELO rating systems while still providing meaningful progress indicators.

Future directions include:

References

  1. Shannon, C.E. (1950). Programming a Computer for Playing Chess. Philosophical Magazine, 41(314), pp. 256–275.
  2. Von Neumann, J. (1928). Zur Theorie der Gesellschaftsspiele. Mathematische Annalen, 100(1), pp. 295–320.
  3. Knuth, D.E. & Moore, R.W. (1975). An Analysis of Alpha-Beta Pruning. Artificial Intelligence, 6(4), pp. 293–326.
  4. Silver, D., Hubert, T., Schrittwieser, J., et al. (2018). A General Reinforcement Learning Algorithm that Masters Chess, Shogi, and Go Through Self-Play. Science, 362(6419), pp. 1140–1144.
  5. Campbell, M., Hoane, A.J., & Hsu, F. (2002). Deep Blue. Artificial Intelligence, 134(1–2), pp. 57–83.
  6. Deterding, S., Dixon, D., Khaled, R., & Nacke, L. (2011). From Game Design Elements to Gamefulness: Defining "Gamification". Proceedings of the 15th International Academic MindTrek Conference, pp. 9–15.
  7. Pritchard, D.B. (2007). The Classified Encyclopedia of Chess Variants. John Beasley.
  8. Next.js Documentation (2024). The React Framework for the Web. https://nextjs.org/docs
  9. Vercel (2024). Vercel: Develop. Preview. Ship. https://vercel.com