@GoldenElf
on
Tractor (Card Game) AI
# Tractor (Card Game)
I created this desktop game because I wanted to have a simple game I could train an AI on and learn about machine learning techniques. I've finally finished the full game implementation that you can [download](https://github.com/GoldenElf58/tractor-ai/releases/latest) and play right now. Now I can begin training a machine learning model you'll eventually be able to play against.
## About Tractor
Tractor (AKA Upgrade/Shengji/升级) is a popular Chinese trick-taking card game where players score by capturing specific cards rather than winning tricks. Certain plays can also consist of multiple cards, making strategy more complex.
## About This Project
This project is a playable desktop implementation of Tractor supporting Windows, macOS, and Linux. The long-term goal is to train a machine learning model to play Tractor.
The initial plan was just to make a minimal working implementation of Tractor that an AI could interact with, but it evolved to become a fully playable desktop game with an interactive GUI. One thing that was surprisingly difficult to implement was handling Tractors and consecutive pairs. I had to redesign ho plays were represented to support plays with more card amount possibilities. I also had to implement helper functions for filtering and sorting cards based on specific criteria, making it much easier to handle the many edge cases involving consecutive pairs.
## Future Plans
Now that the core game is complete and playable, my next goal will be to create a machine learning model that learns to play Tractor through self-play. It'll also be an opportunity to explore reinforcement learning using frameworks like PyTorch on a much more complex problem than the small introductory projects I've done before.
- 5 devlogs
- 38h