Installation and Setup:
-
Clone the repository:
git clone https://github.com/dkazenoff/ai-catan.git
-
Install python 3.6 or greater:
sudo apt-get install python3.6
-
Run main.py by switching into sub directory:
cd ai-catan/code python3 main.py
Running Linear Regression Program using Sklearn (not necessary for running main.py):
-
Install pip:
sudo apt install python3-pip
-
Install pandas, NumPy, Sklearn and TensorFlow:
sudo pip install pandas sudo python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose sudo pip install -U scikit-learn sudo pip install --upgrade tensorflow
-
Modify test.py by switching into sub directory:
cd ai-catan/code/lregression open test.py on Line 9, modify "data" variable by inputting the appropriate csv file
-
Run test.py:
python3 test.py
This program explores several uses of AI for playing Settlers of Catan. Does initial settlement location really determine who will win in the end? How much is this a skill-based game, and how much can be attributed to randomness or pure luck? Let's find out.
By utilizing a trained multiple linear regression model to choose settlement locations, and a rule-based option selector for playing out the game, 3 computers can compete in a full match against each other.
Uses for this program:
- Run thousands of simulations quickly to collect training data for your own research (with output to outputdata.csv)
- Plug in personalized board coordinates to see which locations our computer(s) would find most optimal
- View a single match progression on a visualized board position print-out to output.txt
- Resource Collecting
- Building roads, settlements, and cities
- Trading in to the bank (only 4 for 1 trades) if it benefits the player
- Robber gets placed if 7 is rolled; players containing > 7 cards must discard half their deck
- Trading with other players
- Ports
- Development cards
- Rewards for longest road / largest army
- pandas
- NumPy
- Sklearn
- My Settlers of Catan Games on Kaggle provided by Lumin - for initial training set. Subsequent training taken from our own simulations
- Settlers of Catan Analysis by Peter Keep - used initially for finding primary resource values