Skip to content

Commit

Permalink
d4 tools update for season 3
Browse files Browse the repository at this point in the history
  • Loading branch information
fquirin committed Jan 23, 2024
1 parent 898e744 commit cf9c14c
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 5 deletions.
73 changes: 73 additions & 0 deletions apps/d4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# D4 Tools

Lightweight, clutter-free, web-based, open-source tools for Diablo 4 to calculate stats like damage or defense.

### Common features

- Super lightweight design with no external dependencies (<100kb total size)
- Store calculators in your browser cache (localStorage) and export as JSON files
- Open multiple calculators side by side
- Disable properties temporarily (to quickly see changes)
- Drag & drop sorting
- Responsive design for large (desktop) and small (mobile) screens
- Light/dark mode

## Damage Calculator

The D4 Damage Calculator is a useful tool to assess your build, evaluate your damage and find ways to optimize it.
It **combines all D4 damage buckets** like weapon damage, main stat (str, dex, int, wil), additive damage ([+]%), multiplicative damage ([x]%) and more to **calculate your total damage** per hit.
In addition it supports **critical hit**, **vulnerable** effect and **overpower** damage (including HP and fortify).
To compare different variants of your build and test changes you can **open multiple calculators** next to each other and easily **store, load and export the data** (as JSON files).

URL: https://bytemind-de.github.io/apps/d4/damage.html

**Typical questions** to answer with this calculator:
- _What is the total damage per hit I can expect when using skill A with a fully charged aspect B and overpower + critical hit?_
- _What is better with my current gear, +50% critical damage or 80 more strength?_

### Ideas to improve it

- Implement weapon speed and DPS
- Add predefined properties (skills, passives, glyphs, paragon nodes etc.) for the user to select
- Read the data from your actual account via some Blizzard API (d4armory seems to be able to do it, but how???)

### Known bugs / quirks

- To get correct values we need to apply an approx. 66% global damage reduction for monsters. This value seems to be independent of world tier, but I haven't really tested it with low-level characters.

### Screenshots

<p align="center">
<img src="screenshots/d4-damage-calc-s2-1.png" alt="Damage Calculator S2" width="320px"/>
</p>


## Defense Calculator

The D4 Defense Calculator is a tool to evaluate your defense and determine your **"effective" life against certain attacks**.
It will also **calculate your armor required to reach the 85% DR cap** against a specific monster level.

URL: https://bytemind-de.github.io/apps/d4/defense.html

**Typical questions** to answer with this calculator:
- _What is my 'effective' life when defending vs bleeding enemies that do physical damage in close range?_
- _What is better with my current gear, 4% more life from a ruby or 3% damage reduction from a sapphire?_

### Ideas to improve it

- Add damage groups to be able to calculate defense for multiple attack types at the same time (close, distant, fire, poison, etc.)
- Simplify handling of rubies and paragon nodes (% life), so you don't have to enter every single one

### Known bugs / quirks

- There might be slight rounding errors in the result, because the game often doesn't give you the full values (e.g. Doombringer is actually 41.44% life not 41.4% etc.)

### Credits

- Armor cap calculation is based on [SkyLineOW's findings](https://www.reddit.com/r/Diablo/comments/152gd9u/i_mostly_cracked_the_d4_armor_formula_and_made_a/)

### Screenshots

<p align="center">
<img src="screenshots/d4-defense-calc-s2-1.png" alt="Defense Calculator S2 Beta" width="320px"/>
</p>
4 changes: 2 additions & 2 deletions apps/d4/damage.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

<script>
var d4cType = "dmgcalc"; //TODO: this is added to the storage key and can in theory be in conflict with calc name
var d4cVersion = "0.10.0";
var d4season = "2";
var d4cVersion = "0.11.0";
var d4season = "3";
</script>
</head>
<body>
Expand Down
6 changes: 4 additions & 2 deletions apps/d4/damage.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,10 @@ function buildCalculator(containerEle, options){
//Overpower attacks gain +2% damage per 1% of your Base Life that you have in bonus life above your Base Life.
//Overpower attacks gain +2% damage per 1% of your Base Life you have in Fortify.
//discussion: https://us.forums.blizzard.com/en/d4/t/new-formula-for-overpower-damage-in-120/128302/40
overpowerAddDmgPercentLife = (maxLifeEle.value - baseLifeEle.value)/baseLifeEle.value * 100 * 2;
overpowerAddDmgPercentFortify = isFortified.checked? ((maxLifeEle.value/baseLifeEle.value) * 100 * 2) : 0.0;
//Changes for season 3: damage per 1% reduced from 2% to 1% for both bonus and fortified life
let dmgPer1pct = 1.0;
overpowerAddDmgPercentLife = (maxLifeEle.value - baseLifeEle.value)/baseLifeEle.value * 100 * dmgPer1pct;
overpowerAddDmgPercentFortify = isFortified.checked? ((maxLifeEle.value/baseLifeEle.value) * 100 * dmgPer1pct) : 0.0;
let bonusLifeFactor = overpowerAddDmgPercentLife/100;
let fortifyFactor = overpowerAddDmgPercentFortify/100;
overpowerAddBaseDamage = addModBaseDamage * thisFactorAdd;
Expand Down
2 changes: 1 addition & 1 deletion apps/d4/defense.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<script>
var d4cType = "defcalc"; //TODO: this is added to the storage key and can in theory be in conflict with calc name
var d4cVersion = "0.1.0";
var d4season = "2";
var d4season = "3";
</script>
</head>
<body>
Expand Down
Binary file added apps/d4/screenshots/d4-damage-calc-s2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/d4/screenshots/d4-defense-calc-s2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cf9c14c

Please sign in to comment.