Closed truchi closed 2 years ago
I wrote some code to benchmark the AIs against each other, which you can find in benchmarkagents.rs You can tweak the numbers and run it to play a number of matches between all pairs of AIs.
eg. with the settings as is, and running it with the command
RUST_LOG=error cargo run --release --bin benchmarkagents --features="agent benchmark"
Which runs 200 matches, with a maximum game length of 250 turns, 100ms per turn and running 14 matches at once. The results are:
Alphabeta win 57
Minimax win 36
Greedy win 29
HybridMonteCarlo win 70
PureMonteCarlo win 2
You can check the mapping from easy
/medium
/hard
in onitamalib/src/gamemodes/singleplayer.rs
But it's:
PureMonteCarlo
Alphabeta
HybridMonteCarlo
For resources, I spent a fair amount of time reading the Chess Programming Wiki (https://www.chessprogramming.org/Alpha-Beta) as well as the Wikipedia page for AlphaBeta pruning.
Though I had come across some of these when I was at University for a first year assignment, so it involved a lot of just remembering what I'd learnt then from discussions.
I started on a project to make the board game engine generic enough to easily use with more games, but then became to busy, so don't think I'm likely to spend too much time in the next while on this.
I've kicked off the benchmark with much longer turns and will comment with the results when it finishes, but would encourage you to have a crack at tinkering with implementing an agent of your own and comparing it!
Interestingly, allowing 5 seconds per turn, narrowed the gap between Alphabeta and Alphabeta+MonteCarlo
PureMonteCarlo win 4
HybridMonteCarlo win 67
Greedy win 23
Minimax win 36
Alphabeta win 63
Wow great!
Did some agent on my own. Minimax with simple metrics, plus genetic algorithm to find the weights :) Was fun but I need to improve the code a lot. Will share when I'll have time to get back to it.
Thanks!
Closing this for now, but if you do end up implementing Genetic Algorithms or similar I'd love to hear your results!
Hey bro,
Can I ask what were the technical resources you used to implement the AI algos? Also I'm very interested to know how did you rank your AIs? Did they battle against each other? What are your findings?
I want to make AIs fight to death on this game (in Rust), started reading your code! Playing with friend on your website gave us the idea :)
Thanks
PS: Do you plan to implement the extensions?