ffxiv-acerola / ffxiv_stats

Apache License 2.0
1 stars 0 forks source link

ffxiv_stats

Introduction

ffxiv_stats is a Python package to compute statistics relating to damage variability in Final Fantasy XIV. Variability from hit types (critical, direct, critical-direct) and random +/- 5% rolls are considered. Either moments (mean, variance, and skewness) or damage distributions can be calculated. Both methods are exact and do not rely on sampling.

IMPORTANT: This package is still in the early stages of development and still some sharp edges. It is perfectly usable in its current state, but there is is effectively no error checking/handling. There are also no safety rails; if you try to model a rotation that is impossible in-game, you will still get mathematically correct values. Garbage in = garbage out. Also, be aware that class and method names changes are likely.

Getting started

Basic usage

Variability can be computed using either the Rotation class or one of the role classes (currently only Healer and Tank is supported, other roles have not been verified yet). The Rotation class computes variability when d2 values are known. The role classes inherits the Rotation class and converts potencies to d2 values based on supplied stats. Each role class varies in how it assigns main stats, traits, attack modifier, etc.

Using the Rotation class

The rotation is supplied as a Pandas DataFrame with columns and types:

Using a role class

Using a role class is recommended to go from potencies to d2 values given various stats. Attributes like main_stat, trait, etc are automatically set to the corresponding values of each role. Rotations are attached using the attach_rotation() method, which inherits the Rotation class. However, the rotation_df argument is similar to the above dataframe, but does have slightly different columns

Instead of a d2 column, potency, damage_type, and main-stat-add are used together with player stats to compute and add a d2 column (along with the is-dot column).

Examples

Check out examples/ for some basic usages.

Installation

ffxiv_stats can be installed from source using flit. While in the root directory, use the command

flit install

Alternatively, the package can also be installed with pip.

pip install ffxiv_stats

Requirements

The usual scientific computing stack is used:

Aside from pandas, specific versions haven't been tested, but ffxiv_stats will probably work with lower versions since fairly basic functionalities are used. There are some typing updates present in pandas 2.0.0 which do not have backwards compatibility.