Spin Algorithm
Some are interested in knowing how exactly a spin is generated by HITMAPS Roulette. While the source code for the entire roulette backend is completely open-source, a high-level explanation is provided here.
- A mission is selected at random¹ from the list of missions selected on the "Mission Select" screen
- If using queue mode, the mission will always be the one selected in the queue
- Going through each target, in the order in which they appear in the spin, the following is performed:
- Disguise²
- First, all disguises that are banned for the target³, as well as disguises that have already been chosen, are removed from the pool of possible disguises
- Then, a remaining disguise is chosen at random¹. This disguise is then marked as "chosen" so it is not chosen for another target/objective
- Kill Method
- First, the list of available kill methods is calculated for the target
- If the target is "Erich Soders" in Situs Inversus (Hokkaido), a list of distinct kills is decided, regardless of the user's filters. Consult HITMAPS Roulette's manual mode to see a complete list of kills.
- For all other targets, the list of kill methods is calculated via the following:
- First, all kill categories are built. This is done by taking each category the user has selected and removing all kills banned for the target and selected disguise³, as well as conditions already chosen for a previous target/objective. Categories a user can select are:
- Generic Kills: These include "Firearm", "Concealable Melee", "Non-concealable Melee", "Accident", "Explosion", and "Poison"
- Firearms: These include "Pistol", "Sniper Rifle", "Assault Rifle", "SMG", and "Shotgun"
- Specific Accidents / Poison: These include "Drowning", "Falling Object", "Fall", "Fire", "Electrocution", "Explosion (Accident)", "Consumed Poison", "Injected Poison", and "Explosive (Weapon)". "Explosive (Weapon)" isn't an accident nor poison; however it fits best in this category compared to the others.
- Specific Melee Weapons: These include "Neck Snap", "Fiber Wire", and all "Lethal Melee" items on HITMAPS.com for the selected mission. All fiber wire-like items (such as the "Aztec Necklace" in The Ark Society) are bundled into "Fiber Wire".
- If the user selects "include unique target kills", all unique kills are added to their respective base category, unless the condition is banned for the target and selected disguise³.
- If a previous target's kill condition involves a large weapon⁴, all large weapons are removed from the pool of potential kills.
- First, all kill categories are built. This is done by taking each category the user has selected and removing all kills banned for the target and selected disguise³, as well as conditions already chosen for a previous target/objective. Categories a user can select are:
- A kill category is selected at random¹
- Within the selected kill category, one of the category's kill methods is selected at random¹
- Depending on the kill method, a "variant" may be added to the kill method (such as "Silenced Pistol" instead of just "Pistol"):
- For Explosive (Weapon) kills, the odds of receiving a variant (Loud, Remote, or Impact) is 100%. If a variant is to be added, there is an equal chance of receiving "Loud" vs "Remote" vs "Impact".
- For Firearm kills (excluding the generic "Firearm" kill condition), the odds of receiving a variant (Loud, Silenced) is 50%. If a variant is to be added, there is an equal chance of receiving "Loud" vs "Silenced".
- First, the list of available kill methods is calculated for the target
- Complications
- If a complication is selected in settings (such as "No Target Pacification"), and the kill method supports complications, one or more may be applied at random
- No Target Pacification⁵: 25% chance of receiving this complication
- If a complication is selected in settings (such as "No Target Pacification"), and the kill method supports complications, one or more may be applied at random
- Additional Objectives
- If "Include Additional Objectives" is not selected, no additional objectives are included in the spin
- Otherwise, for each additional objective, a completion method is chosen at random¹
- If "Require Specific Disguises" is selected under the "Additional Objectives" section, a disguise is chosen at random¹, excluding disguises chosen for previous targets/objectives.
- Disguise²
¹ All "random" elements are calculated by using C#'s Random class. While this is not a cryptographically-secure random number generator, it is sufficient for this process.
² If "Require Specific Disguises" is disabled, all targets will receive "Any Disguise" as the disguise restriction
³ If "Include Highly Difficult / Impossible Kills" is enabled, banned disguises / kill conditions will be included in the list of potential objectives.
⁴ A large weapon is classified as a firearm that cannot be concealed on 47's person. The only exception to this logic is "Loud Shotgun", which is classified as a large firearm, despite the Sawn-Off Shotgun being concealable. This is due to the fact that one cannot spawn into a mission with the shotgun concealed on 47's person.
⁵ Firearm and Melee weapons are the only categories that can receive the "No Target Pacification" complication
Updated 27 days ago