Othello Tournament AI Engine in C

Competitive Othello (Reversi) artificial intelligence engine in C featuring 64-bit bitboards, iterative deepening Alpha-Beta search, Zobrist transposition tables, and genetic algorithm heuristic tuning.

A paired engineering project completed at Grenoble INP – Esisar (1er cycle / 2A, PXSI PX221-Info, CS221 C Systems & Algorithmics, December 2025 – January 2026) by Jamyson Vetter and Siméon Studer. Developed iteratively using an Agile SCRUM methodology across five incremental sprints (US1–US5) to compete on a real-time referee server during the Esisar AI tournament.

Architecture & Highlights

  • 64-Bit Bitboard Engine: Dual uint64_t bitboards (noir, blanc) represent the \(8 \times 8\) board directly in CPU registers. Legal move masks (coups_possibles) and directional disc captures across all 8 axes execute without board iteration via bitwise shifts, edge-wrap masks (NOT_A_FILE, NOT_H_FILE), and GCC hardware intrinsics (__builtin_popcountll, __builtin_ctzll) compiled with -O3 -march=native -flto.
  • Iterative Deepening Minimax & Alpha-Beta Pruning: Time-bounded depth-first Minimax search (minimax_hash_temporel, calibrated to a strict 14.1-second per-move server timeout budget) combining Alpha-Beta cutoffs with cached best-move ordering to maximize search depth dynamically across game stages.
  • Zobrist Hashing, Transposition Table & Opening Book: Incremental 64-bit XOR Zobrist hashing (ZOBRIST_TABLE[64][2], ZOBRIST_TOUR) indexes a \(2^{20}\)-entry (~1M entries) transposition table (TT_Entry) storing exact evaluations, lower/upper Alpha-Beta bounds, and best moves, paired with a Zobrist-keyed opening book (opening_book) handling early-game transpositions.
  • Genetic Algorithm Heuristic Tuning: Offline evolutionary training framework (algoGenetique_etu.c) evolving populations of 100 agents via tournament selection, uniform crossover, elitism, and variance-adaptive mutation to optimize phase-interpolated evaluation weights across 10 symmetric board-region masks (c0–c9 rewarding corners and penalizing X/C-squares), move mobility, and disc parity.
  • Agile SCRUM Sprints (US1–US5) & Referee Server Integration: Built incrementally from local 2-player mechanics (US1) and automated binary state-transition replay tests (US2 on savedGames_) to local Human-vs-AI play (US4) and networked tournament play (US3/US5 integrating the userNetwork.h / libothello.so referee API).

Technologies

C (C99, GCC Intrinsics, LTO) · 64-Bit Bitboards · Minimax & Alpha-Beta Pruning · Zobrist Hashing & Transposition Tables · Genetic Algorithms · Agile SCRUM (US1–US5)

Source Code & Documentation


← Back to Projects