Dominoes Engine Project

Repository

Overview

Dominoes has a long cultural footprint in Puerto Rico, and it’s a game I grew up playing with my family. Its mix of simple mechanics and surprisingly deep strategic play made it a natural candidate for experimentation within HotHand Systems. This project explores whether a software agent can learn to navigate the same deduction, suit‑tracking, and tactical decision‑making that skilled human players rely on in competitive two‑player dominoes.

This project investigates multiple AI strategies, ranging from random baselines to multi‑parameter heuristic models capable of making informed decisions based on board state, suit frequency, opponent behavior, and forced plays.

Rules

Dominoes is played across the Caribbean and Latin America with many regional rule variations. For this project, the engine is built around the Straight Dominoes ruleset, which provides a consistent foundation for simulation and agent evaluation. A full reference to the rules can be found here: Straight Dominoes Rules.

In this implementation, each player begins with seven dominoes. The opening move is determined by the highest double in either hand; if no doubles are present, the highest‑value tile sets the lead. Players alternate turns by placing a domino on either end of the layout, matching the exposed suit. When a player cannot make a legal move, they draw from the boneyard until a playable tile appears, or pass if no tiles remain.

At the end of a round, the winning player scores the total pip value of the opponent’s remaining dominoes. Certain outcomes award additional points:


  • Chuchazo — winning with the double blank (+100 points)
  • Capicú — winning with a domino playable on either end (+100 points)

Libraries Used

Pandas, Pygame, PyGAD

Simulation Data

Dominoes AI Winrate Report

This dataset summarizes head‑to‑head performance across the various AI agents developed for the project. The evaluation begins with a random baseline model and progresses through increasingly structured heuristics designed to account for suit frequency, forced‑play scenarios, and inferred opponent behavior.

Models

Random

This baseline agent selects any legal move uniformly at random. It provides a control reference for evaluating the effectiveness of more structured decision‑making strategies.


HighestFirst

This heuristic prioritizes higher‑value dominoes to minimize potential scoring loss in the event of a defeat. Despite having some semblenece of strategy, it curiously performs worse than Random.


CommonSuit

This model introduces suit‑frequency awareness, scoring moves based on how many matching suits remain in the player’s hand after a play. It represents the first step toward a more deliberate, state‑informed strategy.


CommonSuitV2

A significantly more advanced heuristic incorporating multiple weighted factors, including suit frequency, recent opponent passes, forced‑play scenarios, and special‑case handling for the double blank. It is currently the strongest-performing agent in the evaluation set.