This algorithm is designed to be a customizable constraint solver for computing various permutations of NPC happiness in the video game Terraria. For more information, see the Terraria Wiki.
The algorithm makes the following assumptions by default:
Each of these assumptions can be tweaked by modifying the script. Look for lines that say o.add
to see the individual constraints that are being placed on the solver.
You should be able to run it on any standard linux distribution (including Windows Subsystem for Linux) by installing Python 3 and the Z3 Python 3 interface, and running python3 terraria.py
in the root of the repository. The results of the optimization algorithm are printed on the console.
To install these dependencies in Ubuntu 20.04, you can run:
sudo apt-get update
sudo apt-get install python3 z3 python3-z3
It is probably possible to install via Z3 for Windows and Python for Windows, but I have not tried it.