Skip to content

Palfore/OSRSmath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Mathematical Optimization of OSRS

Project Overview

Discover the secrets hidden deep within the intricate complexity of the renowned video game Old School Runescape (OSRS). This project is dedicated to exploring the Massively Multiplayer Online (MMO) Role-Playing Game (RPG) with a totally different perspective. Join us on a tough but rewarding journey as we dive deep into the Mathematics of OldSchool Runescape. Whether it is modeling the game mechanics, optimizing player decisions, or creating powerful visuals, there is something interesting for everyone.


Video games serve as large bodies of complex problems that are heuristically solved by human players. Since this is a game that is played over months, years, and now literally decades, players have devised optimal strategies for nearly every piece of content in this iconic video game. "The Butterfly Technique", "Red-X'ing", and "Tick Manipulation" are all techniques developed by players manipulating the programming of the game to complete content in a way that the developers didn't directly intend or foresee in their implementations.

These developments by players effectively match technological advancements, in the sense that they enable players to perform a task either quicker or with less resources. Players often refer to these new strategies as "new tech". By studying these problems exactly, whether through simulation or mathematical derivation, this project aims to give our clueless adventurer a chance to understand their universe.

Furthermore, this project is connected to the broader concept of Game Theory. For example, we modeled the player's progression through their combat skills (Attack and Strength) as a square grid where players start in one corner, say at level (60, 60), and the question is how does the player get to (99, 99) as fast as possible? After modelling the governing combat equations, Dijkstra's shortest path algorithm was used to obtain an exact solution: the order the player should train their skills.

Content Directory

If you are looking for content please consider these:

a) You can check out the Runescape Universe Interactive Visualization of all the quests.
  1. See Acknowledgements below for the community progress on this.
b) You can also check out these reddit posts:
  1. A Physicist's Guide to Re-balancing Combat - Damage Distributions (3.4k upvotes)
  2. I made a "Quest Tree" for OSRS (1.1k upvotes)
  3. Mathematical Model of Wintertodt & Time to 99 (~450 upvotes)
  4. Mathematically Optimal Order to Train Melee Combat (~350 upvotes)
  5. The Mathematics of OSRS Combat (~50 upvotes)
  6. New Interactive Quest Visualizer (OSRS)
c) You can watch the Video Series if you would prefer watching a video.
d) You can join the Discord to discuss anything!
e) You can read the Mathematical Solutions (pdf/Latex) if you want more detail.
f) You can see more on the OSRSmath page on My Website.

Please note that a simplification of the remaining information is pending...

There are three components to this project:

1. Applications

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

Application Module Location Description
Optimize osrsmath.apps.optimize (Currently disabled) What is the most efficient equipment to wear when fighting a given opponent?
Wintertodt osrsmath.firemaking.wintertodt How many kills are required to reach a given firemaking level?

The optimize app.

2. Library

For developers, they can use the basic functionalities 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

Documentation doesn't really exist regarding the math behind osrs. This project aims to provide a document that attempts to fill this gap.

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). The pip library is outdated and might not have all the features.

  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] to run an application. For example, replace [app_name] with optimize to run the optimize application.

Developer

  1. Download the github source code, unzip it, and place it anywhere.
  2. Open a terminal in that directory (which contains setup.py).
  3. Make sure pip is Run pip3 install -e .

GUI Development:

These are instructions for creating & modifying the graphical interface in the apps:

  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.

Linux may require sudo apt-get install python3-pyqt5

Documentation

To compile the latex document 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.

Tests

The unittest module is used for testing. Navigate to the tests directory and run the command python3 -m unittest. If you are knowledgeable about combat game mechanics (max hit & accuracy calculations, tick manipulation, etc), and you are interested consider joining the discord to help out with tests/validation.

Authors

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

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 Dijkstra's Algorithm in Python

Knowledge

Here is a non-exhaustive link of resources/references used.

Combat

Quest Tree