Skip to main content

Compute damage variability in the critically acclaimed MMORPG Final Fantasy XIV.

Project description

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:

  • action_name: str, unique name of an action. Unique action depends on buffs, p_i, and l_c present.
  • base_action: str, name of an action ignoring buffs. For example, Glare III with chain stratagem and Glare III with mug will have different action_names, but the same base_action. Used for grouping actions together.
  • n: int, number of hits.
  • p_n: probability of a normal hit.
  • p_c: probability of a critical hit.
  • p_d: probability of a direct hit.
  • p_cd: probability of a critical-direct hit.
  • d2: int, base damage value of action before any variability.
  • l_c: int, damage multiplier for a critical hit. Value should be in the thousands (1250 -> 125% crit buff).
  • buffs: Total buff strength, or a list of buffs. A 10% buff should be represented as 1.1. A 5% and 10% buff can be represented as either 1.155 or [1.05, 1.10], but the former is preferred. Saving a dataframe with array columns can be finnicky.
  • is_dot: boolean or 0/1, whether the action is a damage over time effect.

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

  • action_name: str, unique name of an action. Unique action depends on buffs, p_i, and l_c present.
  • base_action: str, name of an action ignoring buffs. For example, Glare III with chain stratagem and Glare III with mug will have different action_names, but the same base_action. Used for grouping actions together.
  • potency: int, potency of the action
  • n: int, number of hits for the action.
  • p_n: probability of a normal hit.
  • p_c: probability of a critical hit.
  • p_d: probability of a direct hit.
  • p_cd: probability of a critical-direct hit.
  • l_c: int, damage multiplier for a critical hit. Value should be in the thousands (1250 -> 125% crit buff).
  • buffs: Total buff strength, or a list of buffs. A 10% buff should be represented as 1.1. A 5% and 10% buff can be represented as either 1.155 or [1.05, 1.10], but the former is preferred. Saving a dataframe with array columns can be finnicky.
  • damage_type: str saying the type of damage, {'direct', 'magic-dot', 'physical-dot', 'auto', 'pet'}
  • main_stat_add: int, how much to add to the main stat (used to account for medication, if present) when computing d2

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:

  • numpy >= 1.20.2
  • matplotlib >= 3.4.2
  • pandas >= 2.0.0
  • scipy >= 1.6.3

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.

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

ffxiv_stats-0.4.7.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

ffxiv_stats-0.4.7-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file ffxiv_stats-0.4.7.tar.gz.

File metadata

  • Download URL: ffxiv_stats-0.4.7.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for ffxiv_stats-0.4.7.tar.gz
Algorithm Hash digest
SHA256 8a78bd6c16bcfedc54ebd688cdbb6875e999f73c5a370666638aba3240597a22
MD5 41165528b3a5583e946b548811261788
BLAKE2b-256 a2835b3400d8e6bf49cb7720ca6f6944e6b5da5cdbe754423d1bbd07a50f5da0

See more details on using hashes here.

File details

Details for the file ffxiv_stats-0.4.7-py3-none-any.whl.

File metadata

File hashes

Hashes for ffxiv_stats-0.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 85d856b2a7b43c776625c86feafaab48e5422d92fcff24228e606ab6a4d8af58
MD5 80f054b494c64225c4f4e083995e90da
BLAKE2b-256 7bae8c13e0e518b88ac3c2935d5fa7386284fbabf13992cd87d403ad1d8d3a89

See more details on using hashes here.

Supported by

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