RobotShamBo aims to explore the capabilities of neuro-evolution applied to the classic game of Rock-Paper-Scissors. This project employs various forms of neural networks to model intelligent agents and observes how they evolve to play the game more optimally.
This project uses an implementation of Iocaine Powder, the winning solution of the first edition of the international RoShamBo competition. The neural networks are evaluated using their performance against Iocaine Powder, and steadily learn to outperform it.
One idea I am experimenting with is that the rewards for winning with Rock, Paper, or Scissors are configurable, and do not have to be equal. So far, it appears that injecting some form of asymmetry in the rewards might help the population escape from the Nash equilibrium strategy of always choosing randomly. This is because if one player chooses the pure random strategy, the other player can beat it by always playing the choice with the highest reward. And that in turn can be countered by whatever beats that choice, etc.. etc.. by removing a simple and stable behavior that (originally) could not be exploited, that dead end attractor is removed from the fitness landscape.
Clone the repository:
git clone https://github.com/evolvingstuff/RobotShamBo.git
Navigate to the project directory and install the required packages:
cd RobotShamBo
pip install -r requirements.txt
To run the main program (the evolutionary loop):
python main.py
To play against the evolved champion in a web app:
python simulate_web_app.py
and navigate to http://localhost:8080/.
- Evolutionary Algorithms: Use evolutionary algorithms (currently configured with SNES) to evolve optimal decision-making strategies.
- Neural Networks: Utilize various architectures (currently LSTM, but plan to add Transformers, CNNs, etc..)
- Simulation web app: Interactive mode to play against the evolved champion in the browser.
- Visualizion tools: Chart fitness over time and parameter distributions.
I have a number of ideas for future features and experiments, described in project ideas.
- EvoTorch: This project relies on the EvoTorch library for various evolutionary algorithms in Torch.
- License: Apache License 2.0. You can view the full license details in the EvoTorch repository.
- Repository: EvoTorch GitHub
This project is licensed under the MIT License. See the LICENSE file for details.
- Iocaine Powder Algorithm Implementation: This project makes use of the Iocaine Powder algorithm as found here, by David Bau. This is, in turn, an adaptation of the original code/algorithm, written by Dan Egnor. I have made modifications to fit the requirements of the RobotShamBo project.
- Images generated by DALL-E 3