1# Stat system scaling:
2Minimum stat: 0 (should only happen due to penalties, instant failure in most scenarios)
3
4Nominal stat: 8 ("average" person)
5
6Very high stat: 14 (realistic world class human, maximum cost-effective in chargen)
7
8Maximal stat: 20 (higher may be achievable, but we're not worried about balancing at that point.)
9
10
11# Skill system scaling:
12Minimum skill: 0 (no training)
13
14Maximum skill: 10 (requires regular training to maintain, "professional" level)
15
16
17# Monster melee skill scaling:
18Minimum skill: 0 (no melee potential; turret, fungal wall)
19
20Nominal skill: 4 (average critter; most zeds & giant insects)
21
22Notable skill: 6 (competent/carnivore; bear, wolf, police/survivor zeds)
23
24Very high skill: 8 (dangerous opponent; dark wyrm, vinebeast)
25
26Maximal skill: 10 (highest for balance purposes; jabberwock, tribot, shoggoth, gracken)
27
28
29# Speeds:
30Zombies are a bit faster than "shambling". Zombified versions of fast critters will remain fast, but in general the process slows the undead version. Further, under no circumstances should a zed be more than 50% faster than base character speed. Currently, this means "capped at 150".
31
32
33# Dodge System assumptions:
34Dodge chance is based on attacker's melee skill and target's dex stat and dodge skill.
35
36Successful dodges negate the attack and impose a cumulative penalty on dodges within the same turn.
37
38## Dodge Use Cases:
39An individual with no skill and nominal stats in ideal circumstances against a basic opponent should occasionally be able to dodge.
40
41An individual with no skill and nominal stats in ideal circumstances against a skilled opponent should rarely if ever be able to dodge.
42
43An individual with world-class dodging ability, in ideal circumstances against a basic opponent should have a negligible chance of failure.
44
45An individual with world-class dodging ability, in ideal circumstances against a skilled opponent should have a moderate chance of failure.
46
47The effect of increasing dodge skill has a growth rate with diminishing returns that accelerates sharply at the point where you move beyond the dodge a "regular" character is likely to achieve (7  and above)
48
49The balance of melee versus dodge should favor dodge which, after all, isn't effective against a wide variety of other types of attacks.
50
51Even a world class dodger should not be able to dodge continuously when attacked many times a turn.
52
53
54# MELEE WEAPONS:
55## To-Hit Bonuses
56To-hit bonuses start at '-2' and are modified as follows for weapons that have the following properties:
57
58### Grip
59Grip is a measure of how well you can control the weapon to quickly respond to situational changes.
60
61-1 - Particularly hard to grip items, (especially those that are innately slipper or very rounded with no obvious gripping edge) such as basketballs and barrels, or which are dangerous to hold because of very sharp edges, like scrap metal and broken glass.
62
63+0 - Any object that doesn't fall into one of the categories below. Examples include 2x4s, computer monitors, wires, stingers and clothing. Basically, anything that has a grippable component, but which is too thick, too thin, or too flimsy to grab comfortably in a way that can reliably control the object.
64
65+1 - A weapon with a fairly solid grip, like a pipe, a rock, guitar neck, or pool cue.
66
67+2 - A weapon with a dedicated grip shaped to the hand, like a sword, axe, knife, or police baton, or that is strapped to the body (or is a piece of the body). Fists would get a +2 bonus here, bringing them to "0" total, since none of the others would apply.
68
69### Length
70Length allows more surface area for potential contact, and reduces the need to control the positioning of the body to guarantee a hit. It also allows the player to strike from a safer distance, allowing them to worry more about trying to hit without being hit in return, and allows for swings with larger arcs, making dodging such a strike more difficult.
71
72+0 - Any object without a length bonus.
73
74+1 - Objects that, when held, extend over a foot (1/3 of a meter) in length from the hand. A normal American 12inch ruler is the handy boundary guide for when an item should switch over to a +1 bonus (the ruler, losing several inches when held, does not get one - unless you added a handle to it!).
75
76+2 - An object that is over 3 feet in length from the point where it is held. Includes swords, spears, quarterstaffs, poles, and a lot of other stuff.
77
78### Striking Surface
79Some weapons need to strike in a certain way to be effective. Others are more difficult to use "incorrectly".
80
81-2 - Single-Point weapons - Picks, spears, syringes. Any weapon that has a single point that must contact the enemy in a specific way in order to deal a decent amount of damage. Also, weapons with difficult attack angles, like scythes, where the damaging part of the weapon is faced away from the enemy.
82
83-1 - Line of damage weapons - Swords, knives, and other weapons that require a solid strike along a particular piece of the weapon, where the weapon can be said to have an attack angle, fall here. Weapons that have point attacks but are still effective without any solid hit, such as a nailboard, would also fall here.
84
85+0 - attack-anywhere weapons - Clubs, pipes, maces, etc, where the weapon will be dealing full damage with a solid blow no matter how it is angled, because every surface is a striking surface.
86
87+1 - Weapons that can still do significant damage even with glancing blows would fall here. Jagged tearing weapons and electric weapons like a stun baton would fall here.
88
89### Balance
90A measure of how well-suited the item is for being swung/thrust/etc. This factors in overall balance of the weapon, weight is accounted for separately.
91
92-2 - Very clumsy or lopsided items ill-suited for swinging or thrusting.  Characterized by requiring effort just to hold steady.  frying pan or pot, chainsaw, chair, vacuum cleaner.
93
94-1 - Balance of the object is uneven, but in a way that at least doesn't interfere with swinging. axes, sledgehammer, rifle, scythe, most polearms.
95
96+0 - Neutral balance, neither well nor poorly weighted for the typical use. Heavy stick, rock, pool stick, kitchen knives, claw hammer, metal pipe, crowbar, handguns.
97
98+1 - Well-balanced for swinging or stabbing.  Baseball bat, golf club, swords, quarterstaff, knives.
99
100## Damage
101Weapon's relative strength is based on an approximate formula involving its damage, to-hit, techniques and few other factors.
102
103### Damage per second
104A melee's weapon damage per second (dps) is calculated past armor against a sample group of monsters with a range of dodge and armor values: a soldier zombie (low dodge, high bash and cut armor), a survivor zombie (medium dodge, some bash and cut armor), and a smoker zombie (high dodge, no armor).  This should correctly weigh accuracy, criticals, and damage without over valuing any of them.
105
106In code, this is calculated using the item::effective_dps() function, which takes a character and a monster.  It calculates the relative accuracy of the character and weapon against the monster's defenses and determines the hit rate from a table lookup.  It also determines the number of critical hits.  Number of hits is hit rate * 10,000, and number of misses is 10,000 - number of hits.
107
108For both critical and non-critical hits, average damage is calculated based on the weapon's stats and the user's skill.  Monster armor absorbs the damage, and then the damage is multiplied by the number of hits: either critical hits for the critical hit case, or total hits - critical hits for the non critical hit case.  If the weapon has the rapid strike technique, the total damage is halved, and then the average damage is recalculated, multiplied by 0.66, and absorbed by monster armor again to account for rapid strikes.
109
110Number of moves is calculated as attack speed * ( number of misses + number of non-critical hits + number of critical hits ) for weapons without rapid strike, or attack speed * ( number of misses + number of non-critical hits / 2  + number of critical hits / 2  ) + attack speed / 2 * ( number of non-critical hits / 2  + number of critical hits / 2 ) for weapons without rapid strikes.
111
112Damage per second against a particular monster is total damage * 100 / number of moves (100 for the 100 moves/second).  Overall dps is the average of the dps against the three reference monsters.
113
114### Critical hits
115A double critical can occur when a second hit roll is made against 1.5 * the monster's dodge.  Double critical hits have a higher chance of occurring than normal critical hits.  For each hit, the chance of achieving either a double critical hit or a normal critical hit is calculated, and then if a random number is less than the critical chance, the critical occurs.  Both double and normal critical hits have the same effect, but the chance of them occurring is different.
116
117**Note** The critical hit system is stupid and complicated and produces weird results.  Double critical hits should have a chance of occurring when the original hit roll is more than 1 standard deviation above the mean, which is simple and faster to calculate than the current system.
118
119### Other factors
120Reach is worth +20% at reach 2, +35% at reach 3.
121
122A weapon that is usable by a known martial art is worth +50%.
123
124### Weapon tiers
125Relative value should put the weapon into one of those categories:
126
127<2 - Not weapons. Those items may be pressed into service, but are unlikely to be better than fists. Plastic bottles, rocks, boots.
128
1292-5 - Tools not meant to strike and improvised weapons. Two-by-fours, pointy sticks, pipes, hammers.
130
1316-11 - Dangerous tools or crude dedicated weapons. Golf clubs, two-by-swords, wooden spears, knife spears, hatchets, switchblades, tonfas, quarterstaves.
132
13312-15 - Good dedicated weapons or the most dangerous of tools. Wood and fire axes, steel spears, electric carvers, kukris, bokken, machetes, barbed wire bats.
134
13520-35 - Weapons of war, well designed to kill humans. Wakizashis, katanas, broadswords, zweihanders, combat knifes, battle axes, war hammers, maces, morningstars.
136
13735+ - Sci-fi stuff. Diamond katanas, monomolecular blades, lightsabers and chainswords.
138
139Specific weapon balancing points:
14020 - combat knifes
14122 - short blades
14224 - long blades, short axes, and short flails
14326 - two handed blades, long axes, most spears
14428 - two handed axes and polearms
14530 - combat spears
146
147Improvised weapons generally have about 75% of the value of a real weapon.
148
149## Other melee balancing factors
150### Attack speed
151Out of two weapons with same dpt, the faster one is generally better.
152Faster weapons allow more damage granularity (less overkill), make it less likely to miss a turn (and thus dodge/block recharges) and make positioning easier.
153Slower weapons will pierce armor better, but currently most enemies are very lightly armored.
154
155### Damage type
156At low skill, piercing damage suffers from scaling and bashing damage from damage limit due to low strength and skill. Cutting damage is not affected.
157At high skill, bashing damage is generally the strongest, but still suffers from the damage limit.
158Exotic damage types (currently only fire) do not scale with skills or crits.
159
160# RANGE WEAPONS
161## Automatic Fire
162Guns with automatic fire are balanced around 1-second of cyclic fire, unless the cyclic or practical fire rate is less than 1 every second.  Rates of fire less than 1 shot every second are increased to 2.
163
164## Magazines
165### Reload times
166The overall balance is that magazines themselves are slow to reload whereas changing a magazine should be fast. For standard box magazines a default `reload_time` of 100 (per round) is appropriate with this value increasing for poor quality or extended magazines. Guns themselves should also specify `reload` of 100 (per magazine) unless their magazines are particularly awkward to reload (eg. ammo belts). The game logic intrinsically handles higher volume magazines consuming more time to attach to a gun so you need not consider this.
167
168### Weight
169Increases proportional to capacity and should have a comparable ratio to similar magazines. Consider the base item to be a 10-round .223 factory specification box magazine which has a capacity:weight of 1:10. Increase the ratio markedly for poor quality magazines or more slightly for extended magazines. Smaller calibers should use a lower ratio. The `material` should have some effect, with plastic magazines weighing less.
170
171### Volume
172Scaled based upon the capacity relative to the `stack_size` of the ammo. For example 223 has a `stack size` of 20 so for 10 and 30 round magazines the volume would be 1 and 2. Extended magazine should always have larger volume than the standard type and for very large drum magazines consider applying an extra penalty. By default most handgun magazines should be volume 1 and most rifle magazines volume 2. Ammo belts should not specify volume as this will be determined from their length.
173
174### Rarity
175Overall balance is that pistol magazines are twice as common as rifle magazines and that for guns that spawn with magazines these are always the standard capacity versions. Consider 9x19mm and .223 to be the defaults with everything else more rare. Some locations have more specific balance requirements:
176
177Location          | Description                                               | With guns | Damaged   | Example
178------------------|-----------------------------------------------------------|-----------|-----------|--------------------------
179Military site     | Only source of milspec magazines and ammo belts           | Never     | Never     | LW-56, .223 ammo belt
180Gun store         | Standard and extended capacity magazines                  | Never     | Never     | STANAG-30, Glock extended
181Police armory     | Mostly pistol magazines, especially 9x19mm, never extended| Sometimes | Never     | Glock, MP5 magazine
182SWAT truck        | Police or military magazines, occasionally extended       | Sometimes | Rarely    | MP5 extended
183Survivor basement | Anything except milspec weighted towards common types     | Often     | Sometimes | Saiga mag, M1911 extended
184Military surplus  | Older military magazines that are not current issue       | Never     | Rarely    | M9 mag, STEN magazine
185Pawn shop         | Anything except milspec weighted towards unusual calibers | Never     | Rarely    | Makarov mag, AK-74 mag
186Everywhere else   | Predominately 9mm and 223. Always with standard magazine  | Often     | Sometimes | Ruger 223 mag, M1911 mag
187
188## Archery damage
189Bow damage is based on the momentum achieved in the projectile.  Since arrows and bolts have sharp cutting surfaces, the penetration and therefore damage achieved is based on the projectile's capacity for slicing through tissues.  The arrow has a modifier based on construction, material and design, most critically centered around the effectiveness of the head.  Base damage is calculated from momentum by taking momentum in Slug-foot-seconds, multiplying by 150 and subtracting 32. This was arrived at by taking well-regarded bowhunting guidelines and determining the damage numbers necessary for a kill of various game on a critical hit, see tests/archery_damage_test.cpp for details.
190
191## Ammo stats
192The damage (**Dmg**) of firearm ammunition is the square root of a round's muzzle energy in joules (**Energy, J**) rounded to the nearest integer with an arbitrary increase or decrease to account for terminal ballistics. Damage of handloaded ammo is set to 92% (rounded down) of their factory counterparts. A similar system for calculating recoil is planned but not currently being worked on. The figures used to calculate stats and any other relevant information are presented in table below.
193
194Each cartridge also has a Base Barrel Length (**Base Brl**) listed; this determines the damage for the connected guns. A firearm has its damage modifier determined by it's real life barrel length; for every three inches between it and the listed baseline here, the gun takes a 1 point bonus or penalty, rounding to the nearest modifier. For example, a .45 ACP gun with a 7 inch barrel would get a +1 bonus (against a baseline of 5 inches).
195
196Ammo ID            | Description                 | Energy, J | Dmg | Base Brl | Applied Modifiers / Comments |
197-------------------|-----------------------------|-----------|-----|----------|-------------------------------
198.22 CB             | 18gr CB bullet              | 39        | 6   | 7.87in   |                              |
199.22LR              | 40gr unjacketed bullet      | 141       | 12  | 6in      |                              |
200.22LR FMJ          | 30gr FMJ bullet             | 277       | 17  | 6in      |                              |
201.32 ACP            | 60gr JHP bullet             | 218       | 15  | 4in      |                              |
2027.62x25mm          | 85gr JHP bullet             | 544       | 23  | 4.7in    |                              |
2037.62x25mm Type P   | 120gr bullet                | 245       | 15  | 9.6in    | Fired from the Type 64 SMG; need more data here |
2049x18mm 57-N-181S   | 93gr FMJ bullet             | 251       | 16  | 3.8in    |                              |
2059x18mm SP-7        | 93gr bullet                 | 417       | 20  | 3.8in    |                              |
2069x18mm RG028       | 93gr hardened steel core bullet | 317   | 18  | 3.8in    |          damage reduced by 4 |
2079x19mm FMJ         | 115gr FMJ bullet            | 420       | 24  | 5.9in    |                              |
2089x19mm JHP         | 115gr JHP bullet            | 533       | 23  | 5.9in    |damage increased by 3         |
2099x19mm +P          | 115gr JHP bullet            | 632       | 25  | 5.9in    |                              |
2109x19mm +P+         | 115gr JHP bullet            | 678       | 26  | 5.9in    |                              |
211.38 Special        | 130gr FMJ bullet            | 256       | 16  | 4in      |                              |
212.38 FMJ            | 130gr FMJ bullet            | 256       | 16  | 4in      |                              |
213.38 Super          | 147gr JHP bullet            | 660       | 26  | 4in      |                              |
21410mm Auto          | 180gr FMJ bullet            | 960       | 31  | 4in      |                              |
215.40 S&W            | 135gr JHP bullet            | 575       | 24  | 4in      |                              |
216.40 FMJ            | 180gr FMJ bullet            | 598       | 24  | 4in      |                              |
217.44 Magnum         | 240gr JHP bullet            | 1570      | 40  | 7.5in    |                              |
218.45 ACP JHP        | 185gr JHP bullet            | 614       | 25  | 5in      |                              |
219.45 ACP FMJ        | 230gr FMJ bullet            | 447       | 21  | 5in      |                              |
220.45 ACP +P         | 200gr JHP bullet            | 702       | 26  | 5in      |                              |
221.454 Casull        | 300gr JSP bullet            | 2459      | 50  | 7.5in    |                              |
222.45 Colt JHP       | 250gr JHP bullet            | 610       | 25  | 7.5in    |                              |
223.500 S&W Magnum    | 500gr bullet                | 3056      | 55  | 8.4in    |                              |
2244.6x30mm           | 31gr copper plated steel bullet | 505   | 22  | 7.1in    |        damage reduced by 4   |
2255.7x28mm SS190     | 31gr AP FMJ bullet          | 534       | 23  | 10.4in   |        damage reduced by 3   |
2267.62x39mm          | 123gr FMJ bullet            | 2179      | 46  | 16.3in   |                              |
2277.62x39mm 57-N-231 | 121.9gr steel core FMJ bullet | 2036      | 45  | 16.3in   |                              |
2287.62x39mm M67      | 123gr FMJ bullet            | 2141      | 46  | 16.3in   |         TODO                 |
2295.45x39mm 7N10     | 56gr FMJ bullet             | 1402      | 37  | 16.3in   |        damage increased by 3 |
2305.45x39mm 7N22     | 57gr steel core FMJ bullet  | 1461      | 38  | 16.3in   |                              |
231.223 Remington     | 36gr JHP bullet             | 1524      | 39  | 20in     |Uses 5.56 NATO barrel baseline; damage increased by 5 |
2325.56x45mm M855A1   | 62gr copper core FMJBT bullet | 1843      | 43  | 20in     |                              |
233.300BLK supersonic | 125gr OTM                   | 1840      | 43  | 16in     |
234,300BLK subsonic   | 220gr OTM                   | 675       | 26  | 16in     |  subsonic
2357.62x54mmR         | 150gr FMJ bullet            | 3629      | 60  | 28in     |                              |
236.308 Winchester    | 168gr hollow point bullet   | 3570      | 60  | 24in     |                              |
2377.62 NATO M80      | 147gr FMJ bullet            | 3304      | 57  | 24in     |                              |
2387.62 NATO M62      | 142gr tracer bullet         | 3232      | 57  | 24in     |  Belt with 1/5 tracer rounds |
239.270 Winchester    | 130gr soft point bullet     | 3663      | 61  | 24in     |                              |
240.30-06 Springfield | 165gr soft point bullet     | 3894      | 62  | 24in     |        damage increased by 4 |
241.30-06 M2          | 165.7gr AP bullet           | 3676      | 60  | 24in     |         damage reduced by 10 |
242.30-06 M14A1       | Incendiary ammunition       | 3894      | 62  | 24in     |         damage reduced by 10 |
243.45-70 Govt.       | 300gr soft point bullet     | 3867      | 66  | 24in     |        damage increased by 4 |
244.300 Winchester Magnum | 220gr JHP bullet        | 5299      | 73  | 24in     |        damage increased by 5 |
245.700 NX            | 1000gr JSP bullet           | 12100     | 110 | 28in     |                              |
246.50 BMG Ball       | 750gr FMJ-BT bullet         | 17083     | 131 | 45in     |                              |
247.50 BMG M33 Ball   | 706.7gr bullet              | 18013     | 134 | 45in     |                              |
248.50 BMG M903 SLAP  | 355gr tungsten AP bullet    | 17083     | 131 | 45in     |  Can't be used with M107A1   |
249.410 000 shot      | 5 000 pellets               | 1530      | 39  | 18in     |                              |
250
251# LIQUIDS:
252Multi-charge items are weighed by the charge/use.  If you have an item that contains 40 uses, it'll weigh 40x as much (when found in-game) as you entered in the JSON. Liquids are priced by the 250mL unit, but handled in containers.  This can cause problems if you create something that comes in (say) a gallon jug (15 charges) and price it at the cost of a jug's worth: it'll be 15x as expensive as intended.
253
254To that end, here's a list of containers with non-one volume.  If you have something spawn in 'em, divide the "shelf" price by this value to arrive at the correct price to list in the JSON.
255
256- plastic bottle: 2
257
258- glass jar: 2
259
260- glass bottle: 3
261
262- plastic canteen: 6
263
264- 3L glass jar: 12, as expected
265
266- gallon jug: 15
267
268# Diamond weapons
269Diamond weapons should be uniform in their CVD machine requirements.
270Coal requirements are `floor((weapon_volume+1)/2)*25`.
271Hydrogen requirements are `coal_requirements/2.5`.
272