Giter Site home page Giter Site logo

palfore / osrsmath Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 0.0 77.1 MB

Mathematical modeling and optimization of the game Old School Runescape.

License: MIT License

Python 44.93% CSS 0.83% TeX 5.19% HTML 48.44% JavaScript 0.62%
runescape osrs-combat optimization mathematics old-school-runescape modeling game-theory markov-chain probability solver

osrsmath's People

Contributors

palfore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

osrsmath's Issues

Only one special equipment is allowed at a time.

The current implementation doesn't support stacking special equipment bonuses.
A possible solution would be to implement these as a class that supports addition.
However, an even better solution would be to add them as normal equipment bonuses.

Allow equipment slots to be ignored during optimization

Especially when fighting bosses, not every piece of equipment should be optimized for offensive. Players might often replace offensive gear with defensive (eg: bandos chestplate swapped for karil's top).

Perhaps checkboxes to enable/disable optimization may be allowed.
In addition since they might choose something with offensive bonuses, they should also be allowed to set that equipment slot to a particular item.

The dropdowns in the optimization panel output can be made editable for this reason.

Several modules still need documentation

Here is a list of modules that need documentation.
Follow the google style guide, or checkout model.successful_hits.py for an example.

  • model.boosts
  • model.experience
  • model.damage (although this might need a redesign)
  • model.player (although this might need a redesign)
  • model.monsters (although this might need a redesign)

Calculating skilling probabilities

When skilling outside of a guild, the probability of success is determined by two variables: low and high. The probability then is (N+1)/(255+1), where N=low*(99-lvl)/98+high*(lvl-1)/98 and each division is integer division and so rounds down. This has been shown experimentally by the wiki team and confirmed by jmods. Note, the term for inside of guilds is N=(low*(99-lvl)+high*(lvl-1))/98. The effect of probability-altering equipment is to change the N value. For instance, if N is the term for the success probability of harpoon fishing with a normal harpoon, then floor(1.35*N) is the corresponding value for a crystal harpoon, which has a 35% boost.

This is different from what is currently in the code and disagrees with assumption 4. (Love the project, by the way!)

Determine how to model duels

Determine how to structure the code to model the autonomous combat between two fighters (player or monster).

Here are some considerations:

  • A fighter does not have a max hit or accuracy without their opponent (i.e. it depends on the opponent).
  • A monster can have multiple attacks (eg: A dragon can use dragonfire & melee).
  • A fighter cannot have multiple attacks, since this would require an active switch (i.e. not autnonomous) or come from a single attack (think proc chance).

To treat these on equal footing, a fighter should have attacks registered to it. Those attacks should get joined when a damage distribution is needed. This would mean that all the special effects, like bolts, should be separated from their normal attack and both a registered to a fighter with respective probabilities.

Thus, the current state is that attacks should be the base unit.

Add results/insight to official wiki

Similar to how Issue #3 references results on the wiki, perhaps some of the take aways could be added to the relevant sections of the wiki. This would obviously omit technical details.

Add mage and range support

Currently only melee is supported by model.damage and apps.optimize. This involves not only the damage calculations, but also the requirements like crossbows needs bolts, ammo can be worn but a range weapon might not use it (eg: crystal bow and any arrows).

Tests are out of date

A large number of the unit tests are failing due to being out of date (eg: code signature changes)
Run these with python -m unittest while in the test directory.

Experience per hit is hard-coded in places

The experience per hit is normally 4, however some monsters give bonus xp. The optimize app accepts a multiplier, but certain places in the code hard code the 4, this should be updated so it uses the users input.

Progress bar and other GUI issues

The progress bar seems to not update properly on mac and windows.
On mac changing font size is slow, which is okay.
However, changing the font on linux/windows the first time may cause a sudden font-size reduction. This is likely related to system-default incorrectly being read by the application when first loaded.

This likely requires knowledge with PySide2 and PyInstaller.

Combat Calculations are Uncertain

Calculating max hits and accuracies gets very complicated and I don't have the game knowledge to carry this out.
Either the dps calculator people of the wiki team may be able to provide insight.
Test cases for PvP and PvM setups would be very helpful!

"NameError: name 'get_opponents' is not defined" when running osrs.path via command line

OS: Windows 10
Python Version: 3.8.5

Description:
Installed osrsmath via pip and tried to run the osrs.path command as stated in the instructions on PyPi: https://pypi.org/project/osrsmath/0.0.1/

The following error is output:

C:\Users\marcu>py -m osrsmath.apps.path
Traceback (most recent call last):
  File "C:\Users\marcu\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 194, in _run_module_as_main
  File "C:\Users\marcu\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 87, in _run_code
  File "C:\Users\marcu\AppData\Local\Programs\Python\Python38-32\lib\site-packages\osrsmath\apps\path\__main__.py", line 60, in <module>
NameError: name 'get_opponents' is not defined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.