Difference between revisions of "Crate probability"

From Worms Knowledge Base

Jump to: navigation, search
m (Weapon crates)
m
 
(15 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
{{ParentArticle|[[Game logic]]}}
 
{{ParentArticle|[[Game logic]]}}
 +
{{Languages|en|Crate probability|fr|Probabilités des caisses}}
 
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.
 
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.
  
Line 34: Line 35:
 
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.
 
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).
+
Since version 3.8 it's possible to click and set the "no-crate" probability directly in this same place of the game's frontend. The following detailed explanation about it was taken from [[Worms_Armageddon_ReadMe_(English)/v3.8_Update|v3.8 ReadMe]]:
  
During Sudden Death, health crates will no longer spawn.
+
''<small>No-crate Probability – Edited in the Game Options screen, not Extended Game Options. Can be enabled or disabled by clicking its icon (a parachuting crate with a red "X" over it). When enabled, allows the per-turn probability of no crate falling to be directly controlled. It has the same units as the Weapon, Utility, and Health crate probability controls that are above it in the Game Options screen, e.g. if all are set to 10%, there will be an equal probability of any four occurrences (25% chance of a weapon crate falling, a utility crate falling, a health crate falling, or no crate falling) on any given turn. When disabled (the default), the original three crate probability controls act as they did before – the no-crate probability is equal to the number of empty squares in whichever of the three crate probability settings are set to any nonzero value (which means that the only way to make a crate drop on every turn is to set each probability to either 0% or 100%).</small>''
  
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 [[Beta updates (Worms Armageddon)|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.
+
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). However, since version 3.8 the [[RubberWorm]] feature known as ''crate limit'' was included in the game as "Maximum crate count on map at once" in [[Extended Scheme Options]], allowing players to set values different than the default 5, including only 1 crate capable of being present on the map, or hundreds of them.
  
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
+
During [[Sudden Death]], health crates will no longer spawn.
  
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.
+
When a crate is spawned in v3.0, 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 [[Updates (Worms Armageddon)|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 updated algorithm does not account for these bevels and assumes a rectangular shape instead (accounting for the bevels while preserving the algorithm schema would take a disproportionate amount of extra CPU and memory).
 +
 
 +
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 there. This was inadvertently changed during the v3.5 Beta 1 update (to a square encompassing the original diamond), making crate spawning theoretically twice as picky about nearby objects; this mistake was reverted in v3.6.26.4.
 +
 
 +
In order to determine which type of 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 ==
 
== Crate contents ==
Line 52: Line 57:
 
===== Utility crates =====
 
===== 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.
+
If a utility is set to have infinite ammunition, the probability that it will appear in a utility crate is set to zero. The probabilities are: fastwalk 20, laser sight 10, double damage 15, invisibility 5 (0 if all players are local), low gravity 10, crate spy 15, jetpack 10, double turn 15, crateshower 5 (total: 105 or 100).
  
 
===== Weapon crates =====
 
===== Weapon crates =====
  
{| class="toccolours collapsible" border="0" style="float: right; font-size: 80%; text-align: right;"
+
{| class="toccolours collapsible collapsed" width="220px" style="float: right; text-align: right;"
| width="50" |
+
!colspan="2"| Click show to expand
| width="80" |
+
|-
+
! colspan="2" | Click "Show" to expand
+
 
|-
 
|-
| Byte value || Relative Probability
+
| Byte value
 +
| Relative Probability
 
|-
 
|-
 
| 0 || 0.0
 
| 0 || 0.0
Line 209: Line 212:
 
<br clear="all">
 
<br clear="all">
  
==Super Weapons==
+
== [[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 are very strange in that their probability for appearing inside a crate depends upon a large number of factors.

Latest revision as of 13:52, 25 December 2024

(Up to Game logic)
In other languages: English (en) • français (fr) • +/-

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.

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.

Since version 3.8 it's possible to click and set the "no-crate" probability directly in this same place of the game's frontend. The following detailed explanation about it was taken from v3.8 ReadMe:

No-crate Probability – Edited in the Game Options screen, not Extended Game Options. Can be enabled or disabled by clicking its icon (a parachuting crate with a red "X" over it). When enabled, allows the per-turn probability of no crate falling to be directly controlled. It has the same units as the Weapon, Utility, and Health crate probability controls that are above it in the Game Options screen, e.g. if all are set to 10%, there will be an equal probability of any four occurrences (25% chance of a weapon crate falling, a utility crate falling, a health crate falling, or no crate falling) on any given turn. When disabled (the default), the original three crate probability controls act as they did before – the no-crate probability is equal to the number of empty squares in whichever of the three crate probability settings are set to any nonzero value (which means that the only way to make a crate drop on every turn is to set each probability to either 0% or 100%).

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). However, since version 3.8 the RubberWorm feature known as crate limit was included in the game as "Maximum crate count on map at once" in Extended Scheme Options, allowing players to set values different than the default 5, including only 1 crate capable of being present on the map, or hundreds of them.

During Sudden Death, health crates will no longer spawn.

When a crate is spawned in v3.0, 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 updated algorithm does not account for these bevels and assumes a rectangular shape instead (accounting for the bevels while preserving the algorithm schema would take a disproportionate amount of extra CPU and memory).

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 there. This was inadvertently changed during the v3.5 Beta 1 update (to a square encompassing the original diamond), making crate spawning theoretically twice as picky about nearby objects; this mistake was reverted in v3.6.26.4.

In order to determine which type of 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. The probabilities are: fastwalk 20, laser sight 10, double damage 15, invisibility 5 (0 if all players are local), low gravity 10, crate spy 15, jetpack 10, double turn 15, crateshower 5 (total: 105 or 100).

Weapon crates

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%
Personal tools