WriteIDEA studio for LitRPG authors
All tools

[ Tool ] · Free and offline

RPG Damage Formula Sandbox

Type a damage or derived-stat formula such as STR*2 + WEAPON - DEF, set each variable with a slider, and read the result plus a sweep graph of one variable across its range. It is the exact formula engine WriteIDE runs on your book, and it works entirely in your browser.

Every name that is not one of the listed functions becomes a variable below. Names are case sensitive, so STR and str are two variables.

Variables
max
max
max
Sweep graph
varies
What the grammar accepts
Operators
+ - * / ^
Functions
floor ceil round abs sqrt min max
  • The result is floored to a whole number, the way LitRPG stats usually are.
  • This reads formulas, not dice. 2d6 is not part of the grammar.
  • The power operator groups right to left, so 2^3^2 is 512.
Result
29

Computed from the variable values on the left.

Result vs DEF
-18-5.5719.53208162432404850ResultDEF
Result as DEF varies from 0 to 50
DEFResult
032
131
230
329 (you are here)
428
527
626
725
824
923
1022
1121
1220
1319
1418
1517
1616
1715
1814
1913
2012
2111
2210
239
248
257
266
275
284
293
302
311
320
33-1
34-2
35-3
36-4
37-5
38-6
39-7
40-8
41-9
42-10
43-11
44-12
45-13
46-14
47-15
48-16
49-17
50-18

The gold marker sits where DEF equals its current value.

Share

The PNG holds the sweep graph, the formula, and the variable values, ready to post to Reddit or Discord.

How the sandbox reads a formula

The sandbox parses the same grammar WriteIDE validates for stat formulas: numbers, your own variable names, the operators plus, minus, times, divide, and power, parentheses, and the function whitelist floor, ceil, round, abs, sqrt, min, and max. Anything else, such as implicit multiplication like 2STR or a dice roll like 2d6, is rejected and the result reads as a dash. The final value is floored to a whole number, so STR times 2.5 with STR at 3 shows 7 rather than 7.5, since intermediate math stays a decimal and only the returned value floors.

Design combat math, not spreadsheets

A general graphing tool makes you rename your stats to x and y and gives you no sense of how a formula behaves as one stat scales. This sandbox keeps your real variable names, evaluates the formula with the same engine that runs across a whole WriteIDE manuscript, and draws the sweep so you can see the shape of the curve as defense climbs to 200 or strength doubles. It runs entirely in your browser. There is no account and nothing you type is sent anywhere.

WriteIDE does this for your whole book, automatically

This tool handles one at a time. WriteIDE is the desktop studio that tracks LitRPG stats, items, skills, and quests across a whole novel, and keeps them correct at every scene.

Runs in your browser. Nothing you type is sent anywhere, and it keeps working with your network off.
Made with writeide.com
More free tools