Skip to main content

Mathematical Functions & Optimization Calculations for OSRS

Project description

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:

1. Applications

These application provide useful functionalities for end users. Once installed, they can be run using the command: python -m [Module Location].

Application Module Location Description
Optimize osrsmath.apps.optimize.main What is the most efficient equipment to wear when fighting a given opponent?

The optimize app.

2. Library

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.

3. Documentation

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.

Installing

User

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).

  1. To install Python simply visit the download page.
  2. Once it is installed, open a terminal (MacOS/Linux) or command prompt (Windows).
  3. Type the command pip3 install --upgrade pip then pip3 install osrsmath to install this program.
  4. Then type python3 -m osrsmath.apps.[app_name].main to run an application. For example, replace [app_name] with optimize to 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!

Developer

  1. Open a terminal/command prompt.
  2. Make sure you have python3.6+ installed (type python --version)
  3. Make sure pip3 is installed (type pip3 --version).
  4. Update pip pip3 install --upgrade pip
  5. Update setuptools pip3 install --upgrade setuptools

To install the apps, or to use as a library:

  1. pip3 install osrsmath

To develop the code:

  1. Download the github source code, unzip it and place it anywhere.
  2. Open a terminal in that directory (which contains setup.py).
  3. Run 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), and Windows 10 (v1909)

Developing

Packaging:

These are instructions for creating app executables:

  1. Type pip3 install PyInstaller
  2. On MacOS, python<=3.6.3 is required since PyInstaller on macos isn't supported after that. On Windows, the app store version of Python (3.8) doesn't work.
  3. Navigate to the Application folder of the app you want to create an executable for.
  4. Type python3 package.py.
  5. 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:

  1. https://github.com/pyinstaller/pyinstaller/wiki/Recipe-OSX-Code-Signing
  2. https://stackoverflow.com/questions/16845169/error-when-trying-to-obtain-a-certificate-the-specified-item-could-not-be-found
  3. https://apple.stackexchange.com/questions/254380/why-am-i-getting-an-invalid-active-developer-path-when-attempting-to-use-git-a

GUI Development:

These are instructions for creating & modifying the GUI design:

  1. Use QT designer.
  2. Create or modify a .ui file in QT designer.
  3. Run python -m osrsmath.apps.GUI.shared.util make to compile them.

Documentation

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 pdflatex main.tex. 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

Tests

The unittest module is used for testing. Navigate to the tests directory and run the command python3 -m unittest

Authors

If you are interested in contributing, check out the issues section on GitHub.

License

This open-source project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Code

  • osrsbox - Provides Data files
  • dijkstar - Implements the dijkstra Algorithm

Knowledge

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osrsmath-0.0.3.2.tar.gz (367.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

osrsmath-0.0.3.2-py3-none-any.whl (397.1 kB view details)

Uploaded Python 3

File details

Details for the file osrsmath-0.0.3.2.tar.gz.

File metadata

  • Download URL: osrsmath-0.0.3.2.tar.gz
  • Upload date:
  • Size: 367.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.3

File hashes

Hashes for osrsmath-0.0.3.2.tar.gz
Algorithm Hash digest
SHA256 fa5033f233b8b5a2c4bd9e1d11feca389b58553ae2022bb64475b1d3b3607e50
MD5 5a000480031d616877eb3e4d7a1ac174
BLAKE2b-256 f7e5d0750c9848921ecbb34c25c55adeb39665a2013a179bf2599aa1a4f982de

See more details on using hashes here.

File details

Details for the file osrsmath-0.0.3.2-py3-none-any.whl.

File metadata

  • Download URL: osrsmath-0.0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 397.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.3

File hashes

Hashes for osrsmath-0.0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 861f0ba1d08a2e3f25adfbf3df5ba9e0c1c31915844d15bd84861d0275e935fb
MD5 39ba7c5137f4f1b1640bb4d8b830a356
BLAKE2b-256 454c37632964ab096a42b3b5e67ef8d20536f79e7b5aebc5770da33a82a167ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page