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 or (asymptotically 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.

IMPORTANT: The effects of hit type rate buffs on skills with guaranteed critical/direct hits is currently not implemented.

ALSO IMPORTANT: Everything here is assuming level 90. There is currently no easy way to handle lower levels.

Getting started

Basic usage

Variability can be computed using either the Rotation class or one of the role classes (currently only Healer 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, 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: list of probability lists, in order [p_NH, p_CH, p_DH, p_CDH].
  • 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: list of buffs present. A 10% buff should is represented as [1.10]. No buffs can be represented at [1] or None.
  • 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, 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: list of probability lists, in order [p_NH, p_CH, p_DH, p_CDH]
  • l_c: int, damage multiplier for a critical hit. Value should be in the thousands (1250 -> 125% crit buff).
  • buffs: list of buffs present. A 10% buff should is represented as [1.10]. No buffs can be represented at [1] or None.
  • damage_type: str saying the type of damage, {'direct', 'magic-dot', 'physical-dot', 'auto'}
  • 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 >= 1.2.4
  • scipy >= 1.6.3

These are just the versions it was developed with. Specific versions haven't been tested, but ffxiv_stats will probably work with lower versions since fairly basic functionalities are used.

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.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ffxiv_stats-0.4.0-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ffxiv_stats-0.4.0.tar.gz
Algorithm Hash digest
SHA256 bbc9e93ccecf3beefa3925d5073d1cc9f38e3370626a63b1e18b5e73b26f35a6
MD5 a56ddd06d89b7ed6041535b06920997f
BLAKE2b-256 b992df9ac36c3d042ec90664b3c49132778897cb01a8f4de9108cff7e6858a62

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ffxiv_stats-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for ffxiv_stats-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca3747fdfc3e6e1dad6a9b9d2b0ca820d2cd48266f43c0ea1e06cda7e3940421
MD5 248d2a7b43f6aa8067e1cc017ae422c2
BLAKE2b-256 0e2a7be677052f1504cc0c4a8befda04632e1f3788f838e86285497059fe0ef5

See more details on using hashes here.

Supported by

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