Use tabletopgames.ai’s open source TAG and PyTAG frameworks to apply Statistical Forward Planning and Deep Reinforcement Learning to two board games of our own design. On an all-green, all-open source, all-AWS stack!
A chameleon playing chess in a train car, as a metaphor of SUSE AI applied to games


Results: Infrastructure Achievements

We successfully built and automated a containerized stack to support our AI experiments. This included:

A screenshot of k9s and nvtop showing PyTAG running in Kubernetes with GPU acceleration

./deploy.sh and voilà - Kubernetes running PyTAG (k9s, above) with GPU acceleration (nvtop, below)

Results: Game Design Insights

Our project focused on modeling and analyzing two card games of our own design within the TAG framework:

  • Game Modeling: We implemented models for Dario's "Bamboo" and Silvio's "Totoro" and "R3" games, enabling AI agents to play thousands of games ...in minutes!
  • AI-driven optimization: By analyzing statistical data on moves, strategies, and outcomes, we iteratively tweaked the game mechanics and rules to achieve better balance and player engagement.
  • Advanced analytics: Leveraging AI agents with Monte Carlo Tree Search (MCTS) and random action selection, we compared performance metrics to identify optimal strategies and uncover opportunities for game refinement .

Cards from the three games

A family picture of our card games in progress. From the top: Bamboo, Totoro, R3

Results: Learning, Collaboration, and Innovation

Beyond technical accomplishments, the project showcased innovative approaches to coding, learning, and teamwork:

  • "Trio programming" with AI assistance: Our "trio programming" approach—two developers and GitHub Copilot—was a standout success, especially in handling slightly-repetitive but not-quite-exactly-copypaste tasks. Java as a language tends to be verbose and we found it to be fitting particularly well.
  • AI tools for reporting and documentation: We extensively used AI chatbots to streamline writing and reporting. (Including writing this report! ...but this note was added manually during edit!)
  • GPU compute expertise: Overcoming challenges with CUDA drivers and cloud infrastructure deepened our understanding of GPU-accelerated workloads in the open-source ecosystem.
  • Game design as a learning platform: By blending AI techniques with creative game design, we learned not only about AI strategies but also about making games fun, engaging, and balanced.

Last but not least we had a lot of fun! ...and this was definitely not a chatbot generated line!

The Context: AI + Board Games

Board games have long been fertile ground for AI innovation, pushing the boundaries of capabilities such as strategy, adaptability, and real-time decision-making - from Deep Blue's chess mastery to AlphaZero’s domination of Go. Games aren’t just fun: they’re complex, dynamic problems that often mirror real-world challenges, making them interesting from an engineering perspective.

As avid board gamers, aspiring board game designers, and engineers with careers in open source infrastructure, we’re excited to dive into the latest AI techniques first-hand.

Our goal is to develop an all-open-source, all-green AWS-based stack powered by some serious hardware to drive our board game experiments forward!

Our Motivation

We believe hands-on experimentation is the best teacher.

Combining our engineering backgrounds with our passion for board games, we’ll explore AI in a way that’s both challenging and creatively rewarding. Our ultimate goal? To hack an AI agent that’s as strategic and adaptable as a real human opponent (if not better!) — and to leverage it to design even better games... for humans to play!

Silvio Moioli & Dario Leidi

This project is part of:

Hack Week 24

Activity

  • 10 months ago: mbologna liked this project.
  • 10 months ago: PSuarezHernandez liked this project.
  • 10 months ago: vliaskovitis joined this project.
  • 10 months ago: livdywan liked this project.
  • 10 months ago: vliaskovitis liked this project.
  • 10 months ago: aruiz liked this project.
  • 10 months ago: moio added keyword "games" to this project.
  • 10 months ago: moio added keyword "gamedesign" to this project.
  • 10 months ago: moio added keyword "boardgames" to this project.
  • 10 months ago: moio added keyword "terraform" to this project.
  • 10 months ago: moio added keyword "containers" to this project.
  • 10 months ago: moio added keyword "amazon" to this project.
  • 10 months ago: moio added keyword "aws" to this project.
  • 10 months ago: moio added keyword "sles" to this project.
  • 10 months ago: moio added keyword "ai" to this project.
  • 10 months ago: moio added keyword "suse" to this project.
  • 10 months ago: moio added keyword "deeplearning" to this project.
  • 10 months ago: moio added keyword "python" to this project.
  • 10 months ago: moio added keyword "java" to this project.
  • 10 months ago: moio added keyword "kubernetes" to this project.
  • 10 months ago: moio liked this project.
  • 10 months ago: dleidi joined this project.
  • 10 months ago: dleidi liked this project.
  • 10 months ago: moio started this project.
  • 10 months ago: moio originated this project.

  • Comments

    • moio
      10 months ago by moio | Reply

      Day 1: infrastructure work

      • Silvio: focused on creating AWS/RKE2 Tofu scripts to deploy the Kubernetes infrastructure
      • Dario: focused on containerizing the TAG framework (Java part)

      Results:

    • moio
      10 months ago by moio | Reply

      Day 2: modeling Bamboo

      • Silvio and Dario paired to implement a TAG model of Dario's card game "Bamboo"

      Results:

      • https://github.com/moio/TabletopGames/commit/d1430cd6173c51756cd6694e13f3a3f59f8ef0ce a first implementation of Bamboo was created and runs against an MCTS AI agent
      • metrics from some tens of executions have been analyzed and some bugs were fixed. We are still suspicious others lie behind the surface. More work tomorrow on finding out whether the metrics are actually correct or we have bugs
      • a problem was found in tofu-tag, CUDA does not seem to work correctly. More investigation needed

    • moio
      10 months ago by moio | Reply

      Day 3: refining

      • Silvio: worked around the CUDA problem in tofu-tag. Seems like an early bug in openSUSE and SLES, which hasn't made it to SLE Micro yet, was found and reported! All works now
      • Silvio: also worked a bit on TAG metrics for another simple game "Totoro". Approach seems to be working
      • Dario fixed an embarassing bug in yesterday's "Bamboo" implementation and started working on balance

      Next up: implement the next game!

    • moio
      10 months ago by moio | Reply

      Day 4: modeling R3

      • Silvio and Dario paired to refine a TAG model of Silvio's card game "Totoro" and came to the definition of a "hard mode" for the game by comparing play statistics of an AI (MCTS) against a player choosing actions at random
      • Silvio and Dario paired to implement a TAG model of Silvio's card game "R3" - much more complex than the previous ones, but still manageable. The first implementation works, more work is needed to extract the right metrics and balance

      Results:

      Manuals + pictures of the three games modeled so far are upcoming! Stay tuned.

    • moio
      10 months ago by moio | Reply

      Day 5: Kubernetes, drivers, CUDA, oh my!

      • Silvio and Dario paired with the objective to run PyTAG, CUDA-accelerated via PyTorch, on the infrastructure defined in day 1. We started on Dario's host, to align bits before adding AWS, Kubernetes and containerization into the mix - and found quite some Python packaging challenges before hitting a wall on hardware support (graphic card was a bit too old). Ultimately we tried again on AWS via tofu-tag and things worked!

      Results:

      • more commits on our fork of TAG - Java packaging bits to make Python packaging easier
      • more commits on our fork of PyTAG - Python packaging and container building (including GitHub Action automation)
      • final bits on tofu-tag to tie it all together.

      It was a great HackWeek and we had a lot of fun!

    Similar Projects

    Port some classic game to Linux by MDoucha

    Let's pick some old classic game, reverse engineer the data formats and game rules and write an open source engine for it from scratch. Some games from 1990s are simple enough that we could have a playable prototype by the end of the week.

    Write which games you'd like to hack on in the comments. Don't forget to check e.g. on Open Source Game Clones, Github and SourceForge whether the game is ported already.

    Hack Week 25 - TBD

    It's time to pick a game for the upcoming Hack Week. Discuss in the comments what game you'd like to hack!

    Hack Week 24 - Master of Orion II: Battle at Antares & Chaos Overlords

    Work on Master of Orion II continues but we can hack more than one game. Chaos Overlords is a dystopian, lighthearted, cyberpunk turn-based strategy game originally released in 1996 for Windows 95 and Mac OS. The player takes on the role of a Chaos Overlord, attempting to control a city. Gameplay involves hiring mercenary gangs and deploying them on an 8-by-8 grid of city sectors to generate income, occupy sectors and take over the city.

    How to ~~install & play~~ observe the decompilation progress:

    • Clone the Git repository
    • A playable reimplementation does not exist yet, but when it does, it will be linked in the repository mentioned above.

    Further work needed:

    • Analyze the remaining unknown data structures, most of which are related to the AI.
    • Decompile the AI completely. The strong AI is part of the appeal of the game. It cannot be left out.
    • Reimplement the game.

    Hack Week 20, 21, 22 & 23 - Master of Orion II: Battle at Antares

    Master of Orion II is one of the greatest turn-based 4X games of the 1990s. Explore the galaxy, colonize planets, research new technologies, fight space monsters and alien empires and in the end, become the ruler of the galaxy one way or another.

    How to install & play:

    • Clone the Git repository
    • Run ./bootstrap; ./configure; make && make install
    • Copy all *.LBX files from the original Master of Orion II to the installation data directory (/usr/local/share/openorion2 by default)
    • Run openorion2

    Further work needed:

    • Analyze the rest of the original savegame format and a few remaining data files.
    • Implement most of the game. The open source engine currently supports only loading saved games from the original version and viewing the galaxy map, fleet management and list of known planets.

    Hack Week 19 - Signus: The Artifact Wars

    Signus is a Czech turn-based strategy game similar to Panzer General or Battle Isle series. Originally published in 1998 and open-sourced by the original developers in 2003.

    How to install & play:

    • Clone the Git repository
    • Run ./bootstrap; ./configure; make && make install in both signus and signus-data directories.
    • Run signus

    Further work needed: