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.

  1. A mission is selected at random¹ from the list of missions selected on the "Mission Select" screen
    1. If using queue mode, the mission will always be the one selected in the queue
  2. Going through each target, in the order in which they appear in the spin, the following is performed:
    1. Disguise²
      1. 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
      2. Then, a remaining disguise is chosen at random¹. This disguise is then marked as "chosen" so it is not chosen for another target/objective
    2. Kill Method
      1. First, the list of available kill methods is calculated for the target
        1. 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.
        2. For all other targets, the list of kill methods is calculated via the following:
          1. 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:
            1. Generic Kills: These include "Firearm", "Concealable Melee", "Non-concealable Melee", "Accident", "Explosion", and "Poison"
            2. Firearms: These include "Pistol", "Sniper Rifle", "Assault Rifle", "SMG", and "Shotgun"
            3. 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.
            4. 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".
          2. 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³.
          3. If a previous target's kill condition involves a large weapon⁴, all large weapons are removed from the pool of potential kills.
      2. A kill category is selected at random¹
      3. Within the selected kill category, one of the category's kill methods is selected at random¹
      4. Depending on the kill method, a "variant" may be added to the kill method (such as "Silenced Pistol" instead of just "Pistol"):
        1. 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".
        2. 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".
    3. Complications
      1. 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
        1. No Target Pacification⁵: 25% chance of receiving this complication
    4. Additional Objectives
      1. If "Include Additional Objectives" is not selected, no additional objectives are included in the spin
      2. Otherwise, for each additional objective, a completion method is chosen at random¹
      3. If "Require Specific Disguises" is selected under the "Additional Objectives" section, a disguise is chosen at random¹, excluding disguises chosen for previous targets/objectives.

¹ 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