PathOfBuildingCommunity / PathOfBuildingCommunity/PathOfBuilding

Add support for average ailment stacks on capped ailments

Open
#6,298 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Lua
Stars
5.4k
Forks
2.4k
Avg merge
1d 12h
Merged PRs (30d)
26

Description

Check for duplicates
  • I've checked for duplicate issues by using the search function of the issue tracker
Is your feature request related to a problem?

Ingame due to the probabilistic nature of inflicting ailments (<100% chance) your number of stacks inflicted can change between any given number e.g. 0-1 stacks for an ignite build with low chance. But as stacks are truncated at one almost always average stacks are less than one. Factoring this will give chance to inflict ailments a better indication in dps for low values.

image
Stacks vs Chance

Describe the solution you'd like

Proper calculation of these average stacks that is at least reasonably accurate like the simulation is. Getting a direct formula might be possible if you consider the maximum stack counts separately but it is a hard probability problem to solve.

Describe alternatives you've considered

No response

Additional context

Script to generate graph beforehand

import random

max = 1000000
chance = 0.5
intervalTime = 1/33
attackTime = 0.75
duration = 4
cap = 2

f = open("out.txt", "w")

for j in range(0, 100):
    stacks = [ ]
    chance = j / 100
    lastAttackTime = 0
    time = 0
    average = 0
    print(chance)
    for i in range(0, max):
        if lastAttackTime <= time:
            lastAttackTime = time + attackTime
            if random.random() < chance: 
                stacks.append(time)

        for v in stacks:
            if v + duration < time:
                stacks.remove(v)

        averageStack = min(cap, len(stacks))

        average += averageStack

        time += intervalTime
    average /= max

    f.write("{:.6f}".format(average))
    f.write("\n")

f.close()

Sheet with data https://docs.google.com/spreadsheets/d/15rNcc18PqFRU2f9NCbd-T0WU2-d0_iGT1Tb99I9ca4c/edit?usp=sharing

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation file, test, or entry point is named. Start by locating the capped ailment stack calculation in the Path of Building code and compare it with the provided simulation; done means average stacks are calculated for capped ailments and produce reasonably accurate results across different infliction chances.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.