Giter Site home page Giter Site logo

damonhook / aos-statshammer Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 7.0 7.59 MB

A tool for calculating and comparing damage outputs for Warhammer Age of Sigmar units.

Home Page: https://aos-statshammer.herokuapp.com/

License: MIT License

HTML 0.46% JavaScript 0.58% TypeScript 98.94% Shell 0.02%
warhammer aos age-of-sigmar mathhammer

aos-statshammer's Introduction

https://img.shields.io/github/v/release/damonhook/aos-statshammer.svg

Age of Sigmar Statshammer

A tool for calculating and comparing damage outputs for Warhammer Age of Sigmar units (also referred to as Mathhammer).

The production deploy of the tool is located at: https://aos-statshammer.herokuapp.com/

The tool works by adding a number of weapon profiles to various units, which can contain a number of modifiers (abilities)

Features

  • Average Damage Stats
    • Gather the average damage that each unit is expected to do against each possible save.
    • This average is a calculated value (not simulated)
    • The average damage is presented the following forms:
      • Table
      • Bar Graph
      • Line Graph
      • Radar Graph
  • Profile Modifiers
    • Add various modifiers, or abilities, to your weapon profiles in order to replicate the vast array of unit rules/abilities.
    • Some examples are:
      • 'Deal x Mortal Wounds on a roll of y'
      • 'Rerolls'
      • 'Leader Bonuses'
  • Target Modifiers
    • Add various modifiers, or abilities, to the target to which stats are generated against (the opponents unit).
    • Some examples are:
      • 'Ethereal'
      • 'Rerolls'
      • 'Negate wounds and mortal wounds on a roll of y'
  • Simulations
    • Generating x simulations to gather the following:
      • Discrete Probabilities
      • Cumulative Probabilities
      • Various Sample Metrics (mean, max, variance, etc.).
    • The number of simulations is customizable from the simulations screen.
  • Import/Export JSON
    • Save your crafted units so that you can re-import them later
  • Export PDF
    • Export the full stats, as well as, simulations to PDF form
  • Dark Theme
  • Persisitent data between refreshes
  • And more

Roadmap Features

  • Ability to add modifiers to the unit as a whole, and not just to each profile
  • Ability to provide points costs to provide stats for average damage / 100 points

Related Projects

Installation

Ensure that you have node, yarn, and nodedeamon installed.

Install the packages needed for the express server (backend) and the client (frontend)

yarn setup

Usage

yarn dev

Runs the app in development mode (launches both the express server, and the react frontend).

Open http://localhost:3000 to view it in the browser

yarn test

Runs the api tests. Please make sure you run this whenever you make any changes to the api / backend

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

If you make any changes to the API. Please ensure that you have run the unit tests. In addition, if you have added extra functionality to the API (e.g: a new modifier), please add a unit test to the api/tests/test.units.ts file that contains this new functionality

aos-statshammer's People

Contributors

damonhook avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aos-statshammer's Issues

Add a reverse cumulative damage probability

It would be more useful to have a cumulative probability of dealing of X amount of damage or more. Now it is so that the percentages tell the probability of dealing X amount of damage or less.

In my opinion it would be more logical to have value of the probability of dealing at least X amount of damage.

General 2.1 UI Improvements

  • Remove Footer from /pdf page (takes up too much space)
  • Change overflow-x: scroll -> overflow-x: auto on tables
  • Increase font-size on /about page for non-retina displays
  • Tabs touch scrolling is currently shrinking to content height
  • Users should be able to change between full and rail version of the left navigation when in large (lg) mode

Aos 3.0 support

There have been various changes that will effect how modifiers are applied. Some changes to the API will need to be made to support this

You should be accepting donations :)

Sorry for creating this as a bug ticket, but couldn't find another way to reach you. I think you should have some way of accepting donations. I would be happy to send a "beer" over your way.
Many thanks for such a beautifully crafted statistics helper for Warhammer!

Don't keep simulation results in array (Memory optimisation)

Currently it does all of the simulations and maps the results to an array. It then uses this array to create the frequency counts, and then no further use is needed for it.

Instead we should just build the frequency array as we simulate. This will improve memory utilisation.

Programatically determine the max (and not rely on simulations for it)

When you are dealing with the amount of possible permutations as we deal with here (up in the billions, or even higher, so we're talking <0.00001% sometimes), the chances of actually rolling the "perfect" max is close to nothing. This means that in the sample set (simulations) these values would almost never occur naturally and thus the sample max usually deviates heavily from the population max.

If instead we calculate the actual population max value. We can then extrapolate the data (marking as probability 0.00, as we only do 2 decimal place accuracy). This would improve the accuracy of the drawn graphs

Bugs with Damage Calculation for Mortal Wounds

Hello! I was messing around with stats hammer and noticed some inconsistencies with averages.

These inputs give me outputs that degrade when you increase the save which is not right.
image
image

And these inputs are mathematically equivalent, yet result in different outputs.
image

On chrome 92.0.4515.107/Windows if that helps!

Add a short info card to the target modifiers screen to explain API decisions

Following from a discussion in #60

Now that only one save-after-save mod can be rolled, it is not clear that you should add target modifiers as they appear on the warscroll (including duplicate FNP / MW Negate modifiers).

The same thing is true for re-rolls. If you add a "re-roll ones", and a "re-roll all", the API will use the "re-roll all" as it is the best choice (as re-rolls don't stack)

The backend API actually picks which is the best modifier to use for a certain scenario (so the user doesn't need to worry about it)

We should add a short info card to the screen to explain this. Something along the lines of:

Modifiers should be added as they appear on the warscroll. The application will apply the best modifiers for the scenario (obeying the rules for Age of Sigmar).

Requesting support for the Stormcast Judicator Rapid Fire ability

There does not appear to be a weapon profile modifier for successful hits generating more hits. I can currently accomplish this by adding an Exploding modifier for each possible hit roll, but it seems like you can only give a weapon 5 modifiers. A single modifier for this would be nice to have, unless I am missing something.

Responsive Left Navigation

The left navigation bar should be responsive based on the following criteria:

  • Lg: Show the full drawer
  • Md: Show a Rail but let users open the drawer
  • Sm: Hide the rail, let users open the drawer

Toggle Switches for Modifiers

It wouldn't be too difficult to add a checkbox for the modifiers, though I am a little worried about clutter for mobile. Might have to do something like:

  • Desktop: you can check/uncheck straight from the home screen
  • Mobile: you have to open the profile, but you can at least check/uncheck from there (at the moment you would have to delete the modifier entirely)

Simulations Screen UI overhaul / extra customizability

The simulations page has a lot of superfluous information that results in a cluttered UI, and a lot of scrolling / tabbing

I think the simulations page layout needs a little bit of revamp. I'm going to give it a little thought, probably throw together some mock ups and get feedback on them. I could also look into providing users with a bit more customisability in ordering / visibility.

Export screen overhaul

I was already planning on overhauling the PDF export page to give users the ability to customise exactly what gets put in it.

But I think it would be better to make a more generic "Export" page, which lets you pick between CSV, or PDF (or other formats in the future) and customise what you want exported (with CSV obviously having more restrictions)

Lazy load routed components

As the size of this webapp grows, the initial load times will start to increase, this is because it needs to import everything at the entry point. We should change to lazy loading of these containers

E.g:

import About from 'containers/About';
import Home from 'containers/Home';
import PdfContainer from 'containers/PdfContainer';
import Simulations from 'containers/Simulations';

Becomes

const About = lazy(() => import('containers/About'));
const Home = lazy(() => import('containers/Home'));
const PdfContainer = lazy(() => import('containers/PdfContainer'));
const Simulations = lazy(() => import('containers/Simulations'));

Some Kruleboyz specific questions / feature requests

Hi @damonhook love your tool!

So I have two situations specific for the Kruleboyz faction:

  1. I can't calculate the damage for the Beast-skewer Killbow

From the warscroll:
"To determine the Damage characteristic for an attack made with Beast-skewer Bolts, roll a number of dice equal to the Wounds characteristic of the target unit. The Damage characteristic is equal to 2, plus 1 for each roll of 5+, up to a maximum Damage characteristic of 12."

This would probably be a lot of work to add to the app, but wanted to ask anyway :D

  1. Something goes wrong when calculating the average damage for Gutrippaz when they are buffed by the Shaman and Sludgeraker
    So when a unit is buffed by the Sludgeraker Venom and Poison of the Shaman, I get a wrong calculation. When I add a rule for mortals on 6+ with 2 damage and 5+ and 1 damage, the calculations seem off. It ignores the second rule when you have two rules on mortals it seems.

Sludgeraker Venom
Add 1 to the number of mortal wounds caused by the Venom-encrusted Weapons battle trait if the unmodified hit roll was 6 and the attacking unit is wholly within 12" of any friendly units with this ability.

Poisons and Elixirs
At the start of your hero phase, if this unit is more than 3" from all enemy units, instead of attempting to dispel an endless spell or cast any spells with this unit in that phase, you can say that it is brewing either a poison or an elixir. If you do so, pick 1 friendly KRULEBOYZ ORRUK unit wholly within 12" of this unit, more than 3" from all enemy units and that has at least 1 model within 3" of this unit to be given that poison or elixir. A unit that has been given a poison or elixir cannot be given another poison or elixir in the same hero phase.

Thanks for your great app and if you need help let me know!

Simulations do not allow for certain modifier combinations

The simulations processor has a bug where it does not allow you to have the following modifier combinations on the same characteristic: Exploding, Mortal Wounds, or Conditional Bonus.

The simulations processor short circuits to the wound roll for these modifiers which results in incorrect data

Convert Logo SVG Text Object -> SVG Paths

Having text objects in the logo means that on certain devices, where that font is not installed, it will default to a different font, changing the look of the logo

Simulations API Performance Improvements

Right now it does a complete set of simulations per save. This means that at a numSimulations of 5,000 it actually simulates 30,0000 attack sequences.

However, an attack sequence is the same up until the save roll phase. This means we could change the simulations to simulate once, then at the save phase, do 6 save rolls. Thus we would only do 5,000 attack sequences up until the divergent path.

This would dramatically improve response times and allow us to increase the number of simulations used

Requesting Autowound Feature

With the new inclusion of the Frightful Touch feature in the Nighthaunt Battletome, some models now have the ability to autowound on 6s, bypassing the to-wound roll and moving on right to the save roll step.

Would it be possible to add that feature in ?

Add after-save exclusively for wounds

Looking at the picture, this means that a MW would have one or two after-saves?
Screenshot_20200904-071848
Since GHB2020, we can only have one after-save, but if both target modifiers above are cumulative, then there's currently no way to configure Nagash's target modifiers to account for his Morikhane (MWs negate on 4+), and his Deathless Minions (wounds negate on 6+). Deathless Minions also negates MWs, but Morikhane é the obvious choice since it is a 4+ negate.
This would be solved by an after-save exclusively for wounds, and not MWs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.