Weapon scheme

Back to Scheme page

Weapon schemes are used to set the initial ammo, crate probability, delays and crate contents of weapons and utilities.

For each ammo, you can set one of these for settings.

  • Initial ammo: How much ammo you get at start. Can be infinite
  • Delay: Number of rounds you have to wait until the ammo gets unlocked
  • Probability: Probability that this ammo can be found in a crate. Note that the probability does not increase linearly!
  • Ammo in crates: How much additional ammo you get per crate. If 0 (not recommended), crates won't drop

Notably, Skip is the only ammo type you can't change with a weapon scheme. Skip is always infinite, has no delay and never drops in crates in Normal-style games.

The weapon scheme has a different meaning when used together with Highlander.


Appendix

Probabilities

The amount of crate icons changes the absolute probability of an ammo type occouring. The more crate icons are used, the more likely it becomes. With 0 crate icons, the ammo types never drops in crates. The absoulte probability being used is not equal the the amount of icons, see the table below.

The following rules are used:

  1. The game assigns each ammo type an absolute probability A (see in the table below)
  2. It calculates the sum S of all absolute probabilities
  3. Each time the game decides to drop an ammo or utility crate, it randomly selects a weapon or utility from all ammo types
  4. The probability of any particular box dropping is P = A / S

The game may force the probability of any ammo type to 0 for some special cases:

  1. Skip in the Normal style
  2. All ammo types with an infinite initial ammo
  3. All ammo types with 0 ammo in crates
  4. All ammo types which got removed by the game in special circumstances, like air attack in cave maps or invulnerable when the invulnerability game modifier is active

Absolute probabilities

Crate symbols Absolute probability
0 0
1 20
2 30
3 60
4 100
5 200
6 400
7 600
8 800

Note the big difference between 1 crate and 8 crate symbols. These numbers have been chosen so that adding one more crate icon for any weapon type can make quite a difference.

Source: https://hg.hedgewars.org/hedgewars/file/47be9f3e61e9/hedgewars/uAmmos.pas#l82

Example

In an otherwise empty weapon set, let's say you have set 1 crate for the mortar, 5 crates for bazookas, 4 crates for cluster bombs and 0 crates for everything else.

By simply looking up the values, you can determine that the mortar has an absolute probability A of 20, for cluster bombs A=100 and for bazookas A=200.

Calculate the sum S and you get 20+100+200 = 320.

Now you just apply the probability formula for each ammo type and you get:

Ammo type Absolute probability Relative probability (fraction) Relative probability (percentage)
Bazooka 200 200/320 62.5%
Cluster bomb 100 100/320 31.25%
Mortar 20 20/320 6.25%
Everything else 0 0/320 0%

User login

Copyright © 2004-2017 Hedgewars Project. All rights reserved. [ contact ]