This repository is dedicated to the technical analysis of The Royal Game of Ur. We use AI agents over a wide range of skill levels to help us answer questions about strategy in The Royal Game of Ur, including questions such as:
-
🍀 How much of the game is luck?
-
🐇 Does playing first give you an advantage?
If you find these questions interesting like we do, or if you just like cool AI designed to solve probability-heavy games, then you are in the right place!
Introduction to the game: The Royal Game of Ur is an ancient Sumerian board game discovered by Sir Leonard Woolley in a tomb in ancient Ur in 1922. The game dates back to over 4000 years ago, and is considered by many to be the oldest board game in the world!
You can learn the rules of the game at https://royalur.net/rules, or play the game over at https://royalur.net!
If you're interested in The Royal Game of Ur, we have a Discord and a Reddit that you might want to check out! These are both good places to talk about the game, its strategies, and see cool board recreations that people have made! The Discord is also a great place to find strong opponents to challenge! (Other than our own AI's of course!)
If you'd like to learn more about questions such as:
-
🍀 How much of the game is luck?
-
🐇 Does playing first give you an advantage?
Then check out our list of insights that we have found out about The Royal Game of Ur in docs/Insights.md!
If you'd like to analyse your own positions, just open the RoyalUrAnalysis.jar file, and it will open a window where you can input a game position. You can then click Analyse and it will analyse the position using the same AI used for the royalur.net Panda difficulty! In the future, we plan to add support for analysing the positions using more AI's as well.
In the window simply click any details you want to change about the position, and they will toggle between their possible states.
We currently have a small set of agents designed to play The Royal Game of Ur, and each takes a slightly different approach to picking their moves!
Agent | Description |
---|---|
Random | Picks a random move, every time! |
First-Move | Picks the least advanced piece to move. |
Last-Move | Picks the most advanced piece to move. |
Greedy | Prioritises taking pieces, and moving onto rosettes. |
Expectimax | Does a statistical analysis to determine the best move. |
Panda | A cheaper variant of expectimax that skips checking some rolls. |
If you'd like to delve deeper into each agent, how they function, and more statistics about each of them, then check out docs/Agents.md for more information!
If you'd like to challenge the Panda Agent, the website RoyalUr.net has the Extreme difficulty, which uses the RoyalUrAnalysis Panda Agent under the hood!
RoyalUrAnalysis requires the Java JDK and Apache Maven to build. Java version 17 is known to be supported, although earlier versions may also work. Maven can be easily installed on Windows using chocolatey: choco install maven
.
Once the dependencies are installed, run mvn install
at the root of the project. This will build the CLI into target/CLI.jar
. RoyalUrAnalysis may then be ran using java -jar target/CLI.jar
.
RoyalUrAnalysis has a WASM build target and JavaScript API that allows you to use its AI's from the web! Check out the documentation for RoyalUrAnalysis on the web in WebSupport.md.