Low Visibility

= Brief = Every turn your mechs, and all other units make rolls to determine to spot and detect enemy units.

The rolls are affected by many factors, including pilot tactics skill, sensor upgrades, active probes, the weather, time of day, and enemy jamming.

Depending on your roll, and how difficult a target is to detect you might get a rundown of every item on it, or you might not see it at all.

Most of the time it will be somewhere in between., but remember your unit's spotting ability changes every turn.

Shooting at something you can barely see is hard.

 * A mechwarrior who detects a threat on sensors but can't see it can fire with No Visual at a +5 difficulty.
 * A mechwarrior who can see the target but can't lock on can fire with No Sensors at a +7 difficulty.
 * A mechwarrior who has neither clear sight nor sensor info, but has a rough idea of where an enemy is can Fire Blind at +13

= Low Visibility = This is a mod for the HBS BattleTech game that introduces a new layer of depth into the detection mechanics of the game. These changes are influenced by the double-blind rules from MaxTech, but have been heavily adapted to the video game mechanics.

This mod has been designed to work with RogueTech. In theory is should work without that mod, but your mileage may vary.

WARNING: THIS MOD LIKELY BREAKS SKIRMISH MULTIPLAYER. It has not been tested, but all due to the way it's been implemented my guess is that it won't work. You have been warned!

Summary
This mod is comprehensive, but a short summary of changes in the mod include:


 * Sensor blips can now be targeted and attacked, allowing long range builds to be more viable.
 * ECM bubbles provide protection for allies and reduce enemy sensors.
 * Enemy details are hidden and are only revealed to strong sensors and/or pilots with high Tactics.
 * The environment can reduce visibility due to snow, rain, night, etc. This makes sensors critical to success on those maps.
 * Stealth can hide enemy mechs (and your own!) allowing you to close range safely.
 * Memetic armor reduces your ability to be targeted, but decreases if you move

Target States
Every model in the game is in one of the three states. A target is either:


 * Visible - your team can directly observe the target.
 * Detected - your team tracks the target using sensors.
 * Unknown - your team does not know the position of the target at all.

All allied units contribute towards determining if a model is visible or detected. If one unit can see a target, it passes that information to all other units on that team. However, each unit individually calculates whether it has a Line of Sight to the target, and what level of Identification it has for the target.

A unit has a line of sight to a target if it can directly observe the target. Line of sight can be obstructed by terrain such as hills, or reduced by weather conditions such as rain or fog. A line of sight can be obstructed, which means it partially passes through a terrain feature.

Even if a target is visible or detected, you may know its location but all other details can be hidden. Identification of the target's details comes from either visual inspection or sensor analysis:


 * Visual ID - if you are close enough, your pilots can determine some basic information such as the chassis type, rough armor/structure values, and type of weapon. You have to be within 150 meters for visual identification.
 * Sensor ID - with a good electronic warfare check your pilots can determine all of a target's details, including current armor values, weapon names, and component locations.

Pilot Skill
Even the most advanced equipment depends upon the pilot...

Equipment
This mod adds several types of equipment that generate electronic warfare effects. A short summary of their effects are:


 * ECM components generate a scrambling bubble that protects the carrier and friendly units within its area. This provides an attack penalty to attacks against friendly units, increases the difficulty of sensor identification against friendly units, and applies a penalty to sensor identification for any enemy unit within the area of effect.
 * Stealth components makes the equipped unit harder to detect by absorbing sensor emissions. They make the carrier harder to detect, increase the difficulty of sensor identification, and applies an attack penalty to any attacker.
 * Mimetic components make the unit harder to visually identify through a chameleonic effect. The carrier will be less visible and attacks will suffer a penalty. These effects are lost if the carrier moves during their turn.
 * Probe components are advanced sensors that make it easier to detect enemy units. They provide a bonus to sensor identification and reduce ECM, Stealth, and Mimetic effects on targets.
 * Narc weapons fire a transmitter the broadcasts data about the target across the entire map. This effect ignores Stealth and Mimetic effects on the target.
 * TAG weapons fire a specialized beam that locates and identifies a target. This effect is lost when the target moves. This effect ignores ECM or Stealth on the target.

Details
This section describes the various mechanics that are used throughout LowVisibility. Players may find this information overwhelming, as its written as a reference for mod authors.

While not necessary, it's suggested that you are familiar with the information in the Low Visibility Design Doc.

Any variable name in  is a configuration value. It can be changed by modifying the named value in LowVisibility/mod.json.

Electronic Warfare Checks
At the start of each round, every unit makes an electronic warfare check (EWC for short). A good check result represents the pilot making the best use of their equipment, while a poor one reflects them being preoccupied with other things.

At the start of every combat round, every unit (player or AI) makes two sensor checks. Each check is a random value between -14 to +14, assigned as per a normal distribution (aka a bell curve). The distribution uses mu=-2 and a sigma=4 value, resulting in a wide curve that's centered at the -2 result.



Each check is further modified by the source unit's tactics skill, as per the table below. (Skills 11-13 are for RogueTech elite units).

The current check result is displayed in a tooltip in the status bar of each player mech. The check result contributes to various calculations in the mod, including:


 * As a bonus to visual identification
 * As a bonus to sensor identification

Spotting and Sensors
Every unit in the game has four related values that control whether it can be seen and targeted:


 * Spotting Range determines how far away the source can visually locate a target. You can only draw a line of sight to a target at or within than your spotting range in meters.
 * Visibility is a multiplier from the target that modifies the source's spotting range.
 * Sensor Range determines how far away the unit can locate targets using sensors. You can only have sensor lock on a target at or within your sensor range in meters.
 * Signature is a multiplier from the target that modifies the source's sensor range.

For both cases the math is straightforward. If a source has a 500 meter range, and the target has visibility/signature of 0.5, the target can be detected at 250 meters or closer. If the target's visibility/signature is 1.5, it can be detected at 750 meters or closer.

Terrain design masks can modify visibility and signature values. Forests apply a 0.8 modifier to signature, while water applies a 1.2.

Spotting
In LowVisibility a unit's base spotting range is shorter than vanilla, as sensor locks allow targets to be identified and attacked. It can also be influenced by weather effects (see below). No matter the circumstances, a unit's spotting range cannot drop below. This value is expressed as 30 meter hexes, and defaults to 2 hexes (60 meters).

A MechWarrior can make some guesses about the target when they are very close. Units at  or will identify basic details about the target even if they have no sensor lock. Details will be limited to approximate armor and structure amounts, general weapon types, and the like. The default value is 5 hexes (180 meters).

TODO: Add EW check to effect to allow stronger pilots to know mor

Environmental Effects
Each map contains one or more mood tags, some of which apply a limit to all units spotting distance. Conceptually, tags related to the ambient light level set the base vision range, while tags related to obscurement provide a multiplier that reduces this base range.

Any modifiers to a units SpottingVisibilityMultiplier or SpottingVisibilityAbsolute statistic increase the calculated base range.

Sensor Range
The first check (the range check) is used to determine the unit's sensor range this turn. Each unit has a base sensor range determined by its type, as given in the table below. This range is increased by SensorDistanceMultiplier and SensorDistanceAbsolute values normally, allowing variation in unit sensor ranges. The range check result is divided by ten, then used as a multiplier against the unit's sensor range. A range check result of +3 yields a sensor range multiplier of (1 + 3/10) = 1.3x. A negative range check of -2 would result in a multiplier of (1.0 - 2/10) = 0.8x.

No matter the circumstances, sensors range cannot drop below a number of hexes equal to SensorRangeMinimum. This value defaults to 6 hexes (240 meters).

Target Details
The electronic warfare check also determines how many details about the target a source unit has access to this round. Enemy ECM, environmental effects, and other conditions will make this detailed information level fluctuate from round to round. Because every pilot and mech is different, the currently displayed details will cycle as you go through the round. A scout unit may have many details about the target available, while an assault unit may have very few. The range of check results is given below:

First Turn Protection
On the very first turn of every combat, every unit (friendly, neutral, or foe) always fail their range check. This ensures players can move away from their deployment zone before the AI has a chance to attack them.

= Component and Status Effects = LowVisibility is a toolkit designed to allow mod authors a great deal of flexibility. This flexibility comes at a cost, as each author has to understand how the various components work together. The mod is built from many differnet effects which can be applied to components or as statuses to fit the mod needs.

Advanced Sensors
The BattleTech universe includes a complex array of sensors that improve a unit's ability to find enemies in specific situations. In LowVisibility all of these advanced sensor types provide a bonus to the target details check.

Active Probes
Active Probes are designed to counteract ECM, Stealth, and other forms of obfuscation. LowVisibility provides two active probe effects that reduce these values one for one. The first is a passive effect that always applies to the carrier unit. The second is a intended to be used for transient effects that originate from a 'ping', as per the HBS Active Probe system.

The transient effect is stronger as it applies equally to all friendly units, while the passive effect only applies to the source unit.

ECM
ECM components generate an bubble of interference around the carrier unit. The carrier has an ECM Carrier effect, while friendly units within the bubble receives an ECM Shield effect. Enemy units within the bubble receive an ECM Jamming effect.


 * For each point of ECM Shield, attackers gain -1 sensors identification check. The target gains a 0.05 decrease to their signature, making it harder for them to be located.
 * For each point of ECM Jamming on a target, the target suffers a -1 penalty to any sensors identification check they make.

Both ECM Jamming and ECM Shield modifiers apply when a jammed source attempts to locate a shielded target. If there are multiple ECM sources the strongest modifier is used, +1 for each additional source.

The details on the ECM equipment can be found on the ECM Equipment page.

Stealth
Thematically, Stealth components interfere with an opponent's ability to sensor lock the protected unit. Units absorb sensor waves and thus seem to disappear from the attackers screens. Mechanically it provides a modification to the unit's signature, a modifier to detailed information, and range-based attack modifiers. Because these values aren't set you can use them in a variety of ways, including building stealth true to the table-top version.

Units protected by an active stealth effect will be surrounded by a black bubble when they are visible.

Mimetic Armor
Mimetic armor makes the target difficult to visually or impossible to identify, and approximates the chameleonic armor of many sci-fi settings. Mechanically it provides a modification to the unit's visibilty as well as an attack modifier based upon how far the unit has moved. Units protected by an active mimetic effect will be surrounded by a shimmer effect when they are visible.

Narc
Narc beacons launch a small transmitter that attaches to the target and broadcasts their location. Mechanically LowVisibility provides a Narc effect that makes it easier to locate and target the narc'd unit.

TAG
TAG emitters are special sensors that provide deep information on a target so long as they can be targeted with a laser-like beam. LowVisibility provides a TAG effect that makes it easier to locate and target the TAG'd unit.

Attack Modifiers
Once a target has been detected it can be attacked normally, though attacks may suffer penalties based upon how strong of a lock they have to the target.

If an attacker only has sensor lock to the target, they suffer a Sensors Only attack penalty of +2 (SensorsOnlyPenalty).

If an attacker only has visual lock to the target, they suffer a Vision Only attack penalty based upon their distance to the target. For every 3 hexes away (VisionOnlyRangeStep) the attacker suffers a +1 attack penalty (VisionOnlyPenalty), regardless of the weapon used.

Zoom Vision
BattleTech has a long standing tradition of zoom vision being a standard feature on cockpits. To support this, equipment with extra zoom levels apply an attack bonus that decays over distance. Each point of X applies as a -1 bonus to the attack roll. For each Y hexes between the attacker and the target, the bonus is reduced by one, until no bonus is provided.

This bonus only applies ranged attacks. This bonus does not stack with other vision bonuses. An attacker with multiple visual enhancement components applies the highest bonus to an attack, plus +1 for each addition visual enhancement component that provides a bonus.

Heat Vision
Like zoom vision, detecting an opponent through thermal vision has been a staple of BattleTech games back to MW2. Components capable of "Heat Vision" mimic this effect by applying an attack bonus that increases the as the target heats up. The attacker gains a -X bonus to their attack for each Y points of heat the target currently has.

This bonus only applies ranged attacks. This bonus does not stack with other vision bonuses. An attacker with multiple visual enhancement components applies the highest bonus to an attack, plus +1 for each addition visual enhancement component that provides a bonus.