Mathematical Functions & Optimization Calculations for OSRS
The Mathematics and Optimization of OSRS
The purpose of this project is to accurately model Old School Runescape mechanics in order to optimize or analyze game play. This game is played over long periods of time (months or years) and so players are often seeking the most optimal route to their desired accomplishments. In particular, combat is a particularly rewarding application, as very complex problems that were previously unsolved for decades can now be.
If you're interested, you can join the discord to discuss anything!
There are three components to this project:
These application provide useful functionalities for end users. Once installed, they can be run using the command:
python -m [Module Location].
||What is the most efficient equipment to wear when fighting a given opponent?|
For developers, they can use the basic functionalities (like modeling combat or potion boosts) to build their own applications. The code is available on PyPi, and can be installed using
pip3 install osrsmath. Within their own code the can import functionalities using
import osrsmath.[module_of_interest]. Download the source, and check out the documentation for the modules at
OSRSmath/osrsmath/docs/html/osrsmath/index.html to see what can be done.
Coherent and comprehensive documentation doesn't really exist regarding the math behind osrs. This project provides a document that attempts to fill this gap. It also documents its source code, which can be viewed by downloading the source and navigating to
osrsmath/docs/html/osrsmath/index.html. In future, it would be nice to host this online.
This application was written in the programming language
Python, which has two major version.
python3 is the version used here, more specifically any version greater than
3.6.3 should work (the latest is best).
- To install
Pythonsimply visit the download page.
- Once it is installed, open a terminal (MacOS/Linux) or command prompt (Windows).
- Type the command
pip3 install --upgrade pipthen
pip3 install osrsmathto install this program.
- Then type
python3 -m osrsmath.apps.[app_name].mainto run an application. For example, replace
optimizeto run the optimize application.
You might also consider trying the executables directly, although there are currently installation issues, particularly on MacOS so this isn't currently recommended. To do this, navigate to GitHub releases and download the latest version (Asset) for your system. Unzip, and run!
- Open a terminal/command prompt.
- Make sure you have
- Make sure
pip3is installed (type
- Update pip
pip3 install --upgrade pip
- Update setuptools
pip3 install --upgrade setuptools
To install the apps, or to use as a library:
pip3 install osrsmath
To develop the code:
- Download the github source code, unzip it and place it anywhere.
- Open a terminal in that directory (which contains setup.py).
pip3 install -e .
Run the desired application with:
python3 -m osrsmath.apps.[app_name].main. Linux may require
sudo apt-get install python3-pyqt5
These installation methods have been tested on:
Ubuntu 20.04 (using wsl1 on windows),
MacOS (Catalina 15.15.5),
Windows 10 (v1909)
These are instructions for creating app executables:
pip3 install PyInstaller
- On MacOS,
python<=3.6.3is required since PyInstaller on macos isn't supported after that. On Windows, the app store version of Python (3.8) doesn't work.
- Navigate to the
Applicationfolder of the app you want to create an executable for.
- Symbolic links should then be created to
dist/main/main[.exe], the should be named osrsmath-[app_name].
On MacOS, the application has to be signed. I don't know the Mac ecosystem very well, however these websites helped me:
These are instructions for creating & modifying the GUI design:
- Use QT designer.
- Create or modify a
.uifile in QT designer.
python -m osrsmath.apps.GUI.shared.util maketo compile them.
To compile the latex documents a latex compiler needs to be installed. MiKTeX is a good cross-platform option. Alternatively, on linux you could simply type
sudo apt-get install texlive-full.
The central document can be compiled with
The html documentation uses
pdoc3 which can be installed with
pip3 install pdoc3. Then the documentation can be compiled by naviating to the top directory (containing
setup.py) and type:
pdoc --html osrsmath -o osrsmath/docs/html -c latex_math=True --force python osrsmath/docs/compile.py
unittest module is used for testing. Navigate to the
tests directory and run the command
python3 -m unittest
- Nawar Ismail - Palfore
If you are interested in contributing, check out the issues section on GitHub.
This open-source project is licensed under the MIT License - see the LICENSE file for details.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for osrsmath-0.0.3.3-py3-none-any.whl