Francesco149 / cubecalc

maplestory cubing chances calculations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

this python script calculates average MapleStory cubing chances for various combinations of lines. it’s something I quickly put together mainly for myself and I don’t know for sure that my calculations are 100% accurate, I’m not an expert on statistics. if you don’t want to run it yourself you can see its output here

how does it work

I get the chances for all the lines I care about and I generate a line for “any other line I don’t care about” that has probability 1 - sum of the probability of all the other lines . I then generate all possible combinations of lines (including multiple primes) and remove impossible combinations such as 3l IED. I scan all these combinations for desired lines, such as 21 or more % stat. I calculate and sum the probability of all these matching combinations, remembering to apply the probability of prime 2nd/3rd line in case of multiple prime combinations.

is it accurate?

I don’t really know. the math makes sense in my head, but I don’t consider myself an expert on statistics and there’s probabily more efficient ways to do the same thing. if you think I’m wrong, let me know and explain why. I would like to have an accurate estimate.

the disclaimer lists all the assumptions made

suckhard’s calculator disagrees with your results

the discrepancies between this and suckhard’s calculator are mainly because suckhard doesn’t always take double/triple prime combinations into account. also “2l attack” on suckhard calculator means 18% or better.

I wrote this calculator in such a way that it figures out the line combinations by itself given any desired amount of whatever lines you’re looking for. this means I don’t have to manually figure out the calculation for each new line combo I want to calculate, and it’s hopefully less error prone as long as my combinations code is not wrong.

how to run it

method 1: manually install dependencies and run it

  • have python3 and numpy installed
  • run src/textfile.py . if you are on linux, you can do src/run.sh and it will also update the text

method 2: nix dev shell (this is what I use)

this method is more reliable as the nix environment has exactly the python and numpy versions that I used during development.

  • if you’re not on nixos, install the nix package manager https://nix.dev/tutorials/install-nix
  • run nix develop and then ./src/run.sh
  • this works on linux, macos, docker and windows WSL2

navigating the codebase

if you’re a developer and want to work on this calculator’s code, here’s an overview of where stuff is

  • all of the code is in the src/ directory
  • cubecalc.py is the core of the calculator. do not clutter this with unnecessary things like probability tables. keep as small as possible. it should be a module that you import and it should only focus on the probabilty calculations with no extra frills
  • textfile.py imports all the probabilities data, preprocesses it and generates the text that goes into cubechances.txt . once I have a proper UI, this will be more of a benchmark and a way to test if changes broke any calculation
  • /src/data contains various scrapers to extract the probability data from the KMS, TMS, etc websites. these scrapers are a one-off thing. they don’t need to be the nicest, most optimized code since once we have the data, we rarely update it. the probability data is formatted into a python object in a file like src/kms.py . scraping is mainly done through htmlq . the raw text extracted with htmlq is cached into text files which are committed into the repo (in case the website changes) and parsed by a script that converts it into a usable format
  • the nix package manager is used to manage dependencies and create a consistent development environment. you can modify flake.nix to add/remove dependencies. you can update dependencies by doing nix flake update. you can use nix develop to enter the development shell if you don’t use direnv (which would do that automatically when you cd into the project)

About

maplestory cubing chances calculations

License:The Unlicense


Languages

Language:C 76.2%Language:Python 22.8%Language:Shell 0.7%Language:Nix 0.3%