log in or register to remove this ad

 

5E New Interactive DPR Visualization Tool

Esker

Hero
I made a thing:


I was inspired by the discussion with @Elfcrusher and @Fenris-77 the other day about D&D data visualization, so I thought I'd use it as an opportunity to figure out how to make an interactive tool... and got a little carried away.

I just started working on this Tuesday night, so it's bound to be buggy, probably with some math errors, and not everything in the UI is necessarily implemented in the back-end, but so far it includes:

Updated Feature List as of 6/5/20:
  • Comparison of two builds side-by-side (to be expanded to add arbitrarily many), graphing DPR by enemy AC
  • Up to three classes per build
  • Selection of fighting styles, many popular damage feats and options (PAM, GWM, CBE, SS, Elven Accuracy, Martial Adept, Booming Blade)
  • Automatic calculation of attack modifiers, damage modifiers, number of attacks, availability of bonus action attacks, etc., based on character and class levels and options (e.g., archery or dueling style)
  • Slider governing how often you expect to have advantage, either on all your attacks or on the first attack each turn*
  • Automatic compatibility checks between weapon configuration and fighting styles, and automatic removal of extra attack when booming blade is selected
  • Automatic inclusion of once-per-turn abilities such as sneak attack, with the to-hit chance factored in (NEW: toggle to control whether to "crit-fish" with these abilities)
  • NEW: Automatic prompting to select a subclass when the class level allows it (currently only Champion or Battlemaster, but more to be added)
  • Auto-inclusion of limited use "apply on hit" abilities, such as divine smite and battlemaster superiority dice (currently assumes you hit often enough to use all your available uses)
  • Inclusion of damage bonuses per hit from features like improved divine smite. NEW: Add custom accuracy or damage bonuses per hit (to model things like Bless, Magic Weapons, etc.)
  • NEW: Graph damage broken down by "at will", "crits", "resource use"
  • NEW: Optionally show tables showing extensive individual elements of calculations
Planned future calculator features:
  • More class/subclass options
  • Proper accounting for bonus action economy and spell slot/other resource use as relates to features like rage activation, hex, hunter's mark, shadow blade, etc.
  • Proper tracking of expected number of uses of resources like smites, superiority dice, etc., in cases where this is less than the number of resources granted due to having too few hits to apply them on
  • Reaction attacks (will probably add a slider to let you specify what percentage of the time you think you can make one, possibly with a customizable bonus included on selection of feats like PAM and Sentinel)
  • Precision attack
  • Haste
  • Option for adding generic custom limited use resources expressed in terms of damage/accuracy added, frequency of application, number of uses, and refresh period
Planned future UI improvements:
  • Ability to add arbitrarily many new builds to the same graph, with a "show/hide" button for the cluster of input options for each one
  • "Save" and "share" builds by outputting a unique alphanumeric sequence that can be input later to restore options
*Note: The "% of time with advantage" slider has you pick two values. The smaller is the % of the time when something gives you advantage on all your attacks (e.g., greater invisibility or a restrained enemy); the bigger is the % of the time when something gives you advantage on your 1st attack (e.g., the help action from a familiar). The second % is inclusive of the 1st which is why it has to be bigger.

Let me know what you think, whether you find errors --- as I said I'm sure there are plenty!, and what features and interface changes you think would be most useful. Mostly this is a fun/procrastination tool for me, but it's also a good excuse to learn more interactive data vis. If you think there's an error, it would be helpful if you could take a look at the "debug" tables to see if you can locate the source; but even if you aren't inclined to do that, let me know what inputs you have set and what values or comparisons don't seem to be working correctly.
 
Last edited:

log in or register to remove this ad


Fenris-77

Small God of the Dozens
Supporter
Holy crizzap dude, when you say you got carried away you weren't kidding. That is shiny, I love it. Is there any chance you could program in an easter egg to display a rude pop-up if someone selects Gnome Paladin? Asking for a friend...
 

You aren't granting Blade bards extra attack at level 6 I think.

A "debug" view that lists your inputs would make this easier to figure out what is going on.

BM maneuvers, Swords/Whispers bards dice, and Paladin smites are mechanically similar. They are damage you can apply after you hit. You can set them to "crit fish" or "dump", and a refresh frequency (long rest/short rest).

Crit fishing on sneak attack? When you can apply it on either attack (ie, if ally within 5' or you have perma-advantage), a simple rule of thumb is that if your (future cumulative) miss chance(s) (this round) are less than your (future, cumulative) crit chance(s) (this round), you should hold the sneak attack for your later attacks.

Swift Quiver is also worth modelling; it is one of the things that makes a Bard 11 strong. And holy weapon. GWM crit bonus attacks. Barbarian frenzy bonus attacks.

You can reduce your load by adding a "Extra attacks bonus action" with "not first round"/"cost bonus action to activate on [short rest][combat] basis" toggle (or a different slider for first round). Holy Weapon and Paladin improved smite can be modeled as "extra damage dice per hit".

Having it auto-populate those is great, but simply exposing them is good.
 

CodeFlayer

Explorer
Nice work! I don't see the modeling engine in the js, is there a back end and if so what language did you choose to use? I'm curious about such things. It looks quite useful. A caster version would be just as interesting.
 

dnd4vr

The Smurfiest Wizard Ever!
Very nice work, but such a tool is not viable IMO as there are too many other factors to calculate in. After testing it for a while, it seems a good for the options you've included.
 

Esker

Hero
You aren't granting Blade bards extra attack at level 6 I think.
Good catch; turns out I was labeling them two different ways so the interface wasn't passing the level in those classes along. Fixed now.

A "debug" view that lists your inputs would make this easier to figure out what is going on.
Also an excellent idea. Added a basic value table that you can display by selecting a checkbox under "Display Options > Debugging".

BM maneuvers, Swords/Whispers bards dice, and Paladin smites are mechanically similar. They are damage you can apply after you hit. You can set them to "crit fish" or "dump", and a refresh frequency (long rest/short rest).
Yeah, that should be doable. I'd also like to incorporate precision attack, which works fundamentally differently than those others, but synergizes so well with the power attack feats.

Swift Quiver is also worth modelling; it is one of the things that makes a Bard 11 strong.
That should be fairly easy --- I'll probably add that when I get to ranger stuff generally, since several of those features involve adding extra attacks a certain number of times per day.

And holy weapon. GWM crit bonus attacks. Barbarian frenzy bonus attacks.
Yeah, I'm currently working on breaking out the damage components more finely (right now, crit damage is folded in to each attack, but it'd be better I think to be able to break it out, which would also make it fairly easy to implement Cleave.

You can reduce your load by adding a "Extra attacks bonus action" with "not first round"/"cost bonus action to activate on [short rest][combat] basis" toggle (or a different slider for first round). Holy Weapon and Paladin improved smite can be modeled as "extra damage dice per hit".
Improved smite is there already, actually; it just turns on if you have 11+ Paladin levels.

Taking "bonus action activated" effects into account properly is on my to-do list.
 

Esker

Hero
Nice work! I don't see the modeling engine in the js, is there a back end and if so what language did you choose to use? I'm curious about such things. It looks quite useful. A caster version would be just as interesting.
The back-end is implemented in R with the help of the Shiny engine to handle the interactive elements. I'll probably stick the source code on GitHub at some point.

I do want to include some "gish" options (other than booming blade), like Hunter's Mark, Hex, Haste, Shadow Blade, etc.; I'm already tracking spell slots for smites and calculating actions and bonus actions used for attacking per day, so some of the groundwork is there to keep the resource-use element "fair" in those comparisons.
 


dnd4vr

The Smurfiest Wizard Ever!
The back-end is implemented in R with the help of the Shiny engine to handle the interactive elements. I'll probably stick the source code on GitHub at some point.

I do want to include some "gish" options (other than booming blade), like Hunter's Mark, Hex, Haste, Shadow Blade, etc.; I'm already tracking spell slots for smites and calculating actions and bonus actions used for attacking per day, so some of the groundwork is there to keep the resource-use element "fair" in those comparisons.
Those are some of the things I was talking about.

My favorite DPR build is a Rogue/Sorcerer who can do about 75-80 damage to two targets nearly every round (depending on your adventuring day) at level 20, or something like 90-100 to a single target.
 



In my simple one I didn't include any limited use abilities, but one thing I considered was "combats between short/long rests", and "average rounds per combat". That's the best way (I think?) to model the value of things like Action Surge, Superiority Dice, Rage, etc., esp. compared to zero-resource abilities like Sneak Attack.

On a related note, I like what you've done with the Advantage slider.
 

The back-end is implemented in R with the help of the Shiny engine to handle the interactive elements. I'll probably stick the source code on GitHub at some point.
Unless I'm not looking for the right thing, I don't see any .js files that aren't existing libraries, some of which I'm not familiar with. But it looks like all the computation is happening server side, which is returning an image of the graph. So Shiny receives the form data, and then calls functions you wrote in R?
 

Esker

Hero
Unless I'm not looking for the right thing, I don't see any .js files that aren't existing libraries, some of which I'm not familiar with. But it looks like all the computation is happening server side, which is returning an image of the graph. So Shiny receives the form data, and then calls functions you wrote in R?
Yeah, essentially the Shiny code consists of a UI piece which defines the layout, input fields, input element format (e.g., text box, slider, dropdown, checkboxes, etc.), and output elements, and maps each field to a field in an R data frame, and a server piece which creates the output frame by calling R functions that are designated as "reactive" if they need to be dynamically updated when the input frame changes.

It's pretty neat, and I don’t need to touch any Javascript (which is good, since I'm a stats guy, not a web developer).
 

In my simple one I didn't include any limited use abilities, but one thing I considered was "combats between short/long rests", and "average rounds per combat". That's the best way (I think?) to model the value of things like Action Surge, Superiority Dice, Rage, etc., esp. compared to zero-resource abilities like Sneak Attack.
I just realized that's all in there. I had my window kinda small and didn't scroll down, I guess.
 


Lapasta

Explorer
That is great, thanks!
One think I'm not understanding is smite calculation for Paladins. I understood that you average the smites for the amount of combat rounds, but by changing Paladin levels I see no change on damage, neither by changing # of combat rounds per day. Also, when I add a second class, the spell slots for the second class doesn't seem to change the smite as well.
Besides that, I loved the tool.
With it I could see that Ranger with hand x-bow keeps good until high levels. Cool!
 

Esker

Hero
That is great, thanks!
One think I'm not understanding is smite calculation for Paladins. I understood that you average the smites for the amount of combat rounds, but by changing Paladin levels I see no change on damage, neither by changing # of combat rounds per day. Also, when I add a second class, the spell slots for the second class doesn't seem to change the smite as well.
Besides that, I loved the tool.
With it I could see that Ranger with hand x-bow keeps good until high levels. Cool!
Thanks for the feedback! I'm looking at it now and adding paladin levels does change the damage for me, though it's more visible if the # of rounds per day is set to a small number (note that right now I'm not doing any checking that you actually have enough hits to use all your dice, so for small numbers of rounds and/or high enemy AC the tool will currently overstate paladin damage). I'm also able to add class levels in a full caster and see the damage output go up...

I'm curious what settings you are using and whether the behavior you're seeing is a bug (entirely possible) or whether there's something else happening. Note that if you are using the right-hand settings you need to uncheck "mirror" in each set of checkboxes if you want those settings to be used; otherwise they are ignored and it just copies the settings for that section from the left-hand build (I thought this would make it easier to make focused comparisons between two similar builds).

It would also be helpful to know what the output of the debug table is: you should see "divine_smite TRUE" toward the bottom, and the total number of d8s usable for smiting per day under "smite_dice".
 

Esker

Hero
With it I could see that Ranger with hand x-bow keeps good until high levels. Cool!
Also, there is no modeling yet of any ranger resources (like spells) or subclass features, so they will look weaker than they actually are.
 

Mythological Figures & Maleficent Monsters

Advertisement2

Advertisement4

Top