Difference between revisions of "Crate probability"
From Worms Knowledge Base
m (restore. i'm gonna fuck about with it on my userpage until it works) |
m (→Weapon crates) |
||
Line 56: | Line 56: | ||
===== Weapon crates ===== | ===== Weapon crates ===== | ||
− | {| | + | {| class="toccolours collapsible collapsed" width="220px" style="float: right; text-align: right;" |
− | + | !colspan="2"| Click show to expand | |
− | + | ||
|- | |- | ||
− | + | | Byte value | |
+ | | Relative Probability | ||
|- | |- | ||
| 0 || 0.0 | | 0 || 0.0 |
Revision as of 14:58, 31 May 2008
The worms games have a large section of their scheme options dedicated to crates and their contents, allowing for quite a large degree of customisability.
Contents
Crate Spawns
In Worms Armageddon and Worms World Party, the respective probabilities for each crate type spawning at the start of a turn are shown as values from 0 - 10 in game. You can work out how to determine the true crate probabilities as follows:
Multiply each of these values by 10, then divide each one by the number of crate types which have a non-zero value. This will give you the probability of each crate spawning each turn.
An example:
- In-game values
- Weapon crate = 3
- Health crate = 6
- Utility crate = 0
Multiply by 10 then divide by 2
- Probabilities:
- Weapon crate = 15%
- Health crate = 30%
- Utility crate = 0%
- No crate = 55%
Another example:
- In-game values
- Weapon crate = 9
- Health crate = 4
- Utility crate = 7
Multiply by 10 then divide by 3
- Probabilities:
- Weapon crate = 30%
- Health crate = 13%
- Utility crate = 23%
- No crate = 34%
This means that it is not possible to have more than one type of crate in the scheme where one has a higher chance of spawning than another and have a crate spawn every turn.
In addition, only 5 crates can be present on the landscape at any one time. No more crates will spawn until some of them are removed (collected, destroyed, or sunk).
During Sudden Death, health crates will no longer spawn.
When a crate is spawned, 75 locations around the landscape will be randomly chosen to see if there is a place available for it to appear. If no suitable position is found during these attempts, it will not appear. In the Worms Armageddon beta update v3.5 Beta 1, this was changed to a new method which scans every location on the map for a suitable position, in order to allow crates to fall in a crowded terrain. The location in which it will appear must be large enough to fit the crate's collision mask, which is 24x29 pixels large, with a single pixel bevel in each corner. The v3.5 Beta 1 update algorithm does not allow for these bevels and assumes a rectangular shape instead.
Crates will not spawn near other objects (worms, mines, oil drums and other crates). This is determined by checking the area around the potential crate spawn by using a diamond shape with a radius of 64 pixels. If any object is within this area, it will not spawn. This was briefly changed during the v3.5 Beta 1 update mentioned above, but was reverted back again by v3.6.26.4
In order to determine which crate will fall in a turn, the game uses an array of size 100. Each % chance of a weapon type spawning is added into this array, so the array is filled with values representing "weapon crate", "health crate", "utility crate" and "no crate". The number of times each value appears in the array is equal to the % chance of that type spawning. As crates spawn (or the "no crate" is activated) each turn, one of the appropriate values is removed from the array. When the array is emptied, it is reset. This method guarantees that the correct crates will fall over 100 turns, but it also means that a player could work out which crate is mostly to fall next if he keeps check of these values. It is unknown if this is still affected if a crate cannot possibly spawn.
Crate contents
Health crates
The amount of health provided by a health crate is controlled by the scheme settings. The values available are 25, 50, 100, 150, 200, and 250, but an external editor can set it to any value from 1 to 256.
Utility crates
If a utility is set to have infinite ammunition, the probability that it will appear in a utility crate is set to zero. All other utilities each have an equal probability of appearing in a utility crate.
Weapon crates
Click show to expand | |
---|---|
Byte value | Relative Probability |
0 | 0.0 |
13 | 0.2 |
26 | 0.4 |
39 | 0.6 |
52 | 0.8 |
1 | 1.0 |
14 | 1.2 |
27 | 1.4 |
40 | 1.6 |
53 | 1.8 |
2 | 2.0 |
15 | 2.2 |
28 | 2.4 |
41 | 2.6 |
54 | 2.8 |
3 | 3.0 |
16 | 3.2 |
29 | 3.4 |
42 | 3.6 |
55 | 3.8 |
4 | 4.0 |
17 | 4.2 |
30 | 4.4 |
43 | 4.6 |
56 | 4.8 |
5 | 5.0 |
18 | 5.2 |
31 | 5.4 |
44 | 5.6 |
57 | 5.8 |
6 | 6.0 |
19 | 6.2 |
32 | 6.4 |
45 | 6.6 |
58 | 6.8 |
7 | 7.0 |
20 | 7.2 |
33 | 7.4 |
46 | 7.6 |
59 | 7.8 |
8 | 8.0 |
21 | 8.2 |
34 | 8.4 |
47 | 8.6 |
60 | 8.8 |
9 | 9.0 |
22 | 9.2 |
35 | 9.4 |
48 | 9.6 |
61 | 9.8 |
10 | 10.0 |
23 | 10.2 |
36 | 10.4 |
49 | 10.6 |
62 | 10.8 |
11 | 11.0 |
24 | 11.2 |
37 | 11.4 |
50 | 11.6 |
63 | 11.8 |
12 | 12.0 |
25 | 12.2 |
38 | 12.4 |
51 | 12.6 |
Through the in-game weapons editor, each weapon can be given an integer value from 0 to 5 which determines the relative probability that that weapon will appear in a crate. The exact probability of a weapon appearing in a crate is given by the quotient of the weapon's value divided by the total of all the weapons' values (for example, if the values assigned to weapons added up to 35, and a particular weapon had a value of 4, then that weapon would have a 4 in 35 chance of appearing in a weapon crate).
An external editor can be used to edit these values with greater versatility (see table, right).
Weapons that have infinite ammunition have zero probability of appearing in crates. If they have been given a non-zero relative probability setting, it is ignored in the calculation described above.
When the "special weapons" option is enabled, these weapons are assigned a value of 1.
The Select Worm weapon always has a value of 0.5 assigned to it. As a consequence, crates will always contain a Select Worm if the relative probabilities for all other weapons are set to zero.
If a weapon is under the effect of a delay setting, it will have zero probability of appearing in a crate until that delay expires.
The contents of the crates spawned by a Crate Shower are completely random, and every weapon has an equal chance of appearing. Even Skip Go and Surrender may appear.
Super Weapons
Super weapons are very strange in that their probability for appearing inside a crate depends upon a large number of factors.
- Super weapons must be enabled in the scheme options.
- At least 5 times as many crates containing standard weapons must have spawned than crates containing a super weapon.
- At least 3 minutes must have passed since the last super weapon appeared.
Once the above 3 conditions are met, a weapon crate will have a 1 in 8 chance of containing a super weapon. The super weapon is chosen randomly from the available ones, and they will not appear if you have infinite amounts of ammo for that weapon.
External Editing of Scheme Files for Altering Crate Probabilities
Scheme files can be externally edited in order to have more control over the crate probabilities.
Each of the crate spawn values are assigned byte values of 10, so a value of 3 in-game would be a value of 30 inside the scheme file. It is possible to raise the values above 100, up to a maximum of 127. Any values higher than this can cause the game to crash. After adding up the values and dividing them by the number of non-zero entries, it is possible to have the total probability over 100%. If this occurs, the extra probability is removed from the utility crates, followed by the health crates if the utility crate value is zero.
For example:
scheme: Weapon Crate = 127% Health Crate = 127% Utility Crate = 127%
Each one is divided by 3:
Weapon Crate = 42% Health Crate = 42% Utility Crate = 42%
But, 42+42+42=126, which is greater than 100. So what actually happens is this:
result: Weapon Crate = 42% Health Crate = 42% Utility Crate = 16% (100-42-42=16) No Crate = 0%