Space Combat Sequence
From PlanetsWiki
Contents |
[edit] Overview
Tim has allowed this information to be released. Most of this information is Host 196 and some parts of it will be in Host 197.
If you don't understand some terminology or need some more information on it, then you can probably find it in other parts of the PlanetsWiki or in the Glossary section of this page.
Attention: The following information is outdated!
Information based on host versions prior to Host 213 - some things definitely have changed. Look at The Battle Manual for up-to-date information on space combat.
[edit] Combat Sequence
[edit] Initialization
[edit] Ship Initialization
- Anger and Fear are set to 0.
- Start at a combat speed equal to: V = 6 – hull mass / 100 with a minimum value of 0. V = V + hull maximum speed / 40. Alien Hulls have their speed reduced by 30%.
- Set the starting position to the distance from the origin as: Polar Distance = 850 + 50 * Rnd. The angle around the origin is set according to the attack vector settings. If an attack vector is set then it is set specifically at the 8 radial lines; otherwise, it is truely random.
- Movement reaction time (deltaTime) is set to 200 ticks/phases. This is the amount of time that will need to pass before the unit can make a movement change decision.
- Alien Hull vulnerability to life support, control systems and weapons doubled. Soft Spot doubled. Power Capacity reduced by 30%.
- Any ships that the IMT control that are set to Ram gain 40 points to attack bonus.
- Alien Hull attack and evasive bonuses are reduced 40%.
- Exotic Techs for Battle Computer and Jammer ECM bonuses are added. Alien Hulls skip this step.
- Exotic Techs for Small & Large Weapon Overcharger and Small & Large Weapon Magnum bonuses are added. Alien Hulls skip this step.
- Exotic Tech for Ion Deflectors is activated. Alien Hulls skip this step.
- Exotic Tech for PD Boost is activated. Alien Hulls skip this step.
- Point defense, small, large and super weapons are activated. Alien Hulls have a 40% chance of not activating each weapon. Ships with less than half of their crew have a chance of not activating each weapon. That chance is: rOdds = 0.5 - (ship's crew / (hull crew capacity + 1)). Super weapons are automatically deactivated if you don’t have at least half of the maximum crew complement. All weapons start the combat without energy in them.
- Existing damage on the ship is multiplied by 10 since all damage units in combat are 1/10th units.
- Shields are raised if control systems are less than 90% damaged and shield damage is less than 100%. Shield strength is set to the % of shield damage that the ship is at times the maximum shield strength of the shield generator. Shield strength is reduced by 30% for Alien Hulls.
- Evil Empire hulls controlled by an Evil Empire player gain a 50% increase in shield strength based on the value from the previous step. The Super Gorbi controlled by an Evil Empire player gains 200% increase in shield strength based on the value from the previous step, but not the 50% increase.
- Exotic Tech for Agnotic Emitter bonuses are added to the shield strength. Alien Hulls skip this step.
- Shields are deactivated if the ship has less than 2 fuel.
- Lizard hulls 45 through 50 controlled by a non-Lizard gain 100 vulnerability to damage to their weapon systems.
- Evil Empire hulls controlled by non-Evil Empire players have their shield strength reduced by 75%.
- The Stormer hull Ill Wind Class Battlecruiser controlled by a Stormer has its vulnerability to damage for weapon systems set to 30 and its attack bonus set to 251.
- An Aczanny player with an Aczanny hull adds the following bonus to its evasive bonus: (ship’s engine technology number * 5) / ((1 + hull’s mass / 200) ^ 2). ECM Jammer is activated. If an Aczanny player is using a non-Aczanny hull then its shield strength is set to 1, its armor set to 1, and its vulnerability to damage to weapon systems is set to 500. The shield strength and armor will not exceed the capabilities of the hull.
- Ships that have just warp chunneled have their shield strength halved.
- Glory Device hulls 42 (Nefarious Class Destroyer) and 43 (Saber Class Frigate) are removed from combat when the device is active.
- Scavenger player overloaded small weapons activated.
- Stormer player using hulls 35 through 44 activate power for enhanced shield arc, enhanced blast damage, reduced damage from Photon Torpedo Tube, enhanced shield damage.
- A Crystal player using hulls 51 through 60 activates its energy absorption power for their shields.
- A Federation player with a high guard on any ship activates the Scotty bonus.
- A cloaked ship with a hull stealth rating of less than 60 gains a cloaker bonus.
- An Enforcer player activates the half crew kill with its weapons, double system damage with large weapons, special damage with super weapons, and 4 x system damage with small weapons.
- Hulls 520 (N. Willow Class Survey Ship), 521 (N. Everygreen Science Vessel), 523 (Maelstorm Class Light Cruiser), 524 (Lotus Class Pursuit Ship), and 525 (Aurora Class Flagship) with more than 40 fuel activate their Target Enhancer. Alien Hulls skip this step.
- Hulls 1 (Outrider Class Scout), 35 (Painmaker Class Cruiser), 65 (Skyfire Class Cruiser), 67 (Red Wind Class Carrier), and 82 through 88 owned by a Privateer activate their power of enhanced damage versus ships that they have a hull plan for.
- A Coalition player with hull 524 (Lotus Class Pursuit Ship), at least 4 med units, and high guard gains 100 to its attack bonus and 50 to its evasive bonus.
- Hulls 518 (X. 240 Comb Class Escort) and 519 (X. 1260 Royal Class Heavy Cruiser) add to the Hive Mind. The value of Hive Mind cannot exceed 10.
- Hull 525 (Aurora Class Flagship) activates a super weapon jamming field.
- A ship with the Solar Gamma Ray active initiates the ray.
- Hull 58 (Diamond Flame Class Battleship) has its armor set to 550 and its maximum armor limit to 850. This is not specific only to the Crystals.
- Hull 109 (Virgo Class) activates the Unicom power for that controlling player. The device does not need to be turned on.
- Hull 60 (Crystal Light Ship) activates the Colonies of Man wing disruption field.
[edit] Base Initialization
- Set the starting position at 70 from the origin. Their position around the origin is determined based on player number so each player has a spot.
- Check the status of the Exotic Tech Omega Pulse and if its counter is over zero then turn off the Base Shield; otherwise:
- If the controlling player is Solorian and the base has more than 10 million colonists then make a base shield present.
- If the Base Shield structure is present and more than 10 neutronium is present then activate the base shield. Bug: The structure doesn't need to be turned on for it to work.
- Calculate the amount of energy that the base generates.
- baseGen = # Ion Cannons + # Cities + # Factories / 20 + # Anti-Aircraft Guns / 2
- Set the starting energy of the base. baseE = baseGen * 100 with a minimum value of 20
- Base Hit Points (baseMaxIncoming) = 10 * (300 + Structure Hit Points from Chart Below). Asterisked individual items are not implemented yet.
- 15,000 per Undercity*
- 10,000 per City
- 200 per Laser Cannon, Raid Shelter*
- 100 per Anti-Aircraft Gun, Terra Former*
- 50 per Pod Launch Pad, Air Attack Base, Military Spaceport, Engine Plant, Assault Plant, Fighter Plant, Med Lab, Government Center, Base Shield, Ordnance Plant, Weapons Factory, Ship Parts Factory, Smelter, Farm, Race-specific Structure
- 25 per Factory
- 10 per Scanner, Public Space Port, Training Center
- 5 per Ion Cannon, Mineral Mine*
- Home Guard wings are formed. Up to 19 wings are formed from available fighters in the base. Each wing consists of up to 1,000 fighters, starting with type-1 until they are depleted. If there are still less than 19 wings formed then it will move on to the type-2 and type-3 fighters. No mixed wings are formed.
- If there is at least one high guard at the base, then each wing will have a high guard. High guards are not removed from the base.
- The wing is set to Ground Strike and Deadly First.
- The amount of ordnance in the wing is set to 50 * the number of fighters in the wing.
- After they are formed, they go through the Wing Initialization process.
[edit] Assault Pod Initialization
[edit] Other Pods Initialization
[edit] Wing Initialization
- The number of fighters of each type is summarized (dC) (e.g. if you have a 5/2/3 wing then dC = 10). The number of fighters of each type multiplied by their associated combat quickness are summarized (dA) (e.g. if you have a Fed 5/2/3 wing then dA = 5 x 20 + 2 x 20 + 3 x 100 = 440). The wing's combat speed is calculated by: rSpeed = Int((dA / dC) * .03), minimum of 1 and maximum of 5.
- Anger is set to 40.
- Fear is set to 10.
- Attack vector is randomized.
- Distance from the origin is set as: polarDist = Rnd * 900
- Movement Reaction Time (deltaTime) is set to 4.
- The generator value of each fighter type is assigned double its generator value. See Combat! below under Charge Weapons for the full effect of generators and batteries for wings.
- The initial energy level of each fighter type in the wing is set to the battery value.
- The amount of ordnance that each fighter type has is distributed from the available ordnance depending on their quantity and ammo capacity.
- Close to Point Blank and Target Closest aren't used at all.
- Exotic Techs for Nem Shields and Sand Shields are activated if enabled.
[edit] Post Initialization
- Friend/Foe values are set.
- Any ships controlled by a player whose race’s PSI factor is greater than 35 gain a bonus from Hive Mind from the formula:
- Attack Bonus = Attack Bonus + Hive Mind * 3
- Evasive Bonus = Evasive Bonus + Hive Mind * 2
- Any wings controlled by a player with Unicom active gains 20 to its chance to hit with beam weapons and 30 to its chance to hit with missile weapons.
- Any hulls that match a Privateer's hull plan are set as victim's to enhanced damage for the Privateer's ship.
[edit] Determine If Combat Should Proceed
Make sure that there is a wing, base, or ship of two or more opposing players present.
[edit] Remove Docked Objects from Combat
Any docked units are removed from combat. This includes pods as well as wings that are set to "Do Not Launch".
[edit] Configure 2nd Wave Units
Ships set for 2nd wave are set to appear on tick 300.
[edit] Combat!
For ticks 0 through 5000, perform the following steps.
- Check for units that were set to appear at a later time, such as 2nd wave units. Bring those units into combat.
- Every 10 ticks (including tick 0), determine targets for all units.
- When a ship has less than 1 crew, the target list is cleared and it won't get targets again.
- Loop through valid enemy units. Add target weighting to each, depending on certain conditions. When done, choose the top 10 highest weighted targets and put them into the target list for the attacker. The weight must be a positive (non-zero) number to be added to the target list. The following conditions may add or subtract from the weight and some may set the weight to specific value, thus nullifying any prior changes to the weight.
- When the target is a base:
- When the attacker is a ship without a super weapon that target's weight is set to -3000.
- When the attacker is a wing 20 is added to the weight.
- Regardless of any conditions, 300 is added to the weight.
- When "Attack Ground" is enabled, 550 is added to the weight.
- If "Attack Ground" is not enabled, then the weight is set to -1000.
- The distance between target and attacker adds weight: 520 - (distance / 500) * 0.3
- When the target is a ship 400 is added to the weight.
- When the target is a wing 100 is added to the weight. If "Anti-Fighter" is enabled, 750 is dded to the weight.
- When "Target Soft" is enabled, 50 is added to the weight of all pods. When a target ship has a damaged shield, 200 - shield strength is added to the weight. When a target ship has less than 100 armor, 200 - armor level is added to the weight.
- When "Target Soft" is not enabled, pods that are not Assault Pods have their weight set to -1000. Assault Pods gain no further weight.
- When "Target Dangerous" is enabled, the following conditions will add the appropriate weights.
- Shield strength > 100: 25
- Armor level > 300: 25
- Ship mass > 500: ship mass / 3
- Every large weapon: 30
- Every small weapon: 5
- Super weapon: 300
- If the target is the ship's kill target then 3000 is added to the weight.
- When "Do Not Fire At Disabled" is enabled, then the system damage is checked for > 100% damage and the crew is checked to see if all of the crew are dead. When either is true, the weight is set to -1000.
- When all of the crew are dead and the attacker has more than 20 crew, the target is captured. When the attacker is a Privateer, any hull plans on the target are destroyed. Any high guard on the target escape. 10 crew are transferred to the target. The target list of all units is cleared. Movement orders on the galactic map are cleared. Bug here that the order in which combatants are processed is linear so that the ship with the lowest ID will capture ships. In a multi-player and multi-enemy combat this can make a difference. Also, fuel from Solorian ships isn't removed when captured by a non-Solorian. Also, ships that are about to be destroyed by future damage will be captured (a waste of crew).
- When the target is a base:
- On tick 3 and 1000, display the correct values for ships' shield, armor and hull bars. These are also adjusted whenever damage is done to a ship.
- Every tick, check to make sure that a wing isn't depleted of fighters and update the displayed statistics.
- Every 3rd tick, make movement decisions if the unit's decision time (deltaTime) to do so has come or already passed. Loop through all units and for those that have a maximum speed greater than zero perform the following steps.
- Decide to stay and fight by adding together: Anger, experience (max 300), shield (max 100), armor (max 300) / 3, skill (max 100) / 3, and happiness (max 100) / 4.
- Decide to flee by adding together: hull damage * 8 (max 700), 80 if shield strength < 10, fear, the points below will be added per weapon that has exceeded its hardness.
- point defense: 1
- large weapon: 10
- small weapon: 5
- When the value to decide to stay exceeds the decide to flee, then the unit stays. It will then perform the following. Only ships will flee.
- For ships with less than 60% engine damage, their speed is set to the ship's maximum speed / 3 otherwise the speed is 0.
- For ships with a standoff range set, continue to approach their primary target unless the difference between the target and attacker minus the standoff range is greater than 20. When that occurs then switch direction directly away from the primary target.
- Wings and ships without a standoff range set will set their course towards their primary target.
- Ships that are set to Ram will set their course towards their primary target and if within a range of 25 to their target will attempt to ram. IMT ships that are set to Ram will get a second ram attempt if within a range of 125.
- Details on Ram is detailed under weapons fire below.
- If the unit is within a range of 5 of the origin then make some special movement adjustments.
- Ships can make new movement decisions according to this addition to deltaTime: v = (skill + experience / 4) / 10 with a maximum of 25. deltaTime = deltaTime + 50 + Rnd * 10 - v.
- When the unit decides to flee, it performs the following.
- The ship starts moving its maximum speed and plots a course for the edge of the map.
- Ships can make new movement decisions in this many ticks: 300 + Rnd * 100.
- Wings will set their speed to maximum and plot a course for their primary target. Their next movement decision will be in this many ticks: 15 + Rnd * 10.
- Every tick, any existing Nemesis Torpedoes are processed.
- If the torp's timer is greater than 0 then decrement it.
- If the torp's timer has been exhausted then increase the radius of the area of effect by 20. When the radius exceeds 800 then the torp is removed. Loop through all targets to see if the torp has hit.
- When the torp hits a ship...
- If the hull mass of the ship is less than 100 and it is controlled by an Aczanny then it takes 50 points of hull damage; otherwise, the ship is destroyed.
- If the hull mass is greater than 99 then and the shield strength is greater than 50 then take 50 shield damage; otherwise, the ship takes hull damage:
- rA = Abs((ship ang - torp ang) / 2)
- d = (ship polar distance + torp polar distance) * Sin(rA)
- dam = ((1300 - d) / 1000) * (200 / (hull mass + 100)) * 1000, where dam can be a minimum of 0 and maximum of 1500
- When the torp hits a wing...
- If the unit's controller is Azcanny then the wing loses from 30% to 60% of its fighters of each type; otherwise:
- If the unit has Nem Shields active and the controlling player is Evil Empire then the wing loses 20% of its fighters of each type; otherwise, it loses 50% of its fighters of each type.
- If the unit doesn't have Nem Shields active then the wing is destroyed.
- If the unit's controller is Azcanny then the wing loses from 30% to 60% of its fighters of each type; otherwise:
- When the torp hits a pod, it is destroyed.
- When the torp hits a ship...
- Every tick, Assault Pods have a 20% chance to change their movement decisions for which target to set a course for. They will primarily target ships with no shields and very little (less than 100) armor that are closest to them.
- Every tick, Assault Pods that have docked with an enemy ship will have a 1% chance to fight with the crew and guests on the ship. If the ship has already been captured or destroyed, it will undock. The target and pod fight using their combat strength by subtracting the lowest value between them or the lowest + 1 if the lowest combat value is less than 100. If either combat strength drops to 0 then the fight is over and the crew and guests of the ship are adjusted down by using a ratio of the starting combat value to its current combat value. The same is done for the assault pod. One of two results remain:
- When the pod's combat strength is depleted it detaches from the ship and if it is controlled by an Aczanny will explode doing the following damage: There is a bug here that the damage (other than armor) is removed from the ship instead of added.
- 400 damage to armor. If this brings the armor to less than 100 then:
- 20% of crew, troops, and colonists are killed
- Engine & Hyperdrive Damage: 10 * (ship mass / 100)
- Hull, Shield, and Weapon Damage: 50 * (ship mass / 100)
- System Damage: 20 * (ship mass / 100)
- Life Support Damage: 90 * (ship mass / 100)
- When the ship's combat strength is depleted, the pod captures it. If the ship is Privateer controlled then any hull plans are removed. All targets are cleared for all units in the combat. Crew is moved over to the ship up to the maximum crew complement followed by high guard, troops, and then colonists up to the guest capacity. Bug here that fuel on Solorian ships isn't removed when captured by non-Solorian. Also, ships that are about to be destroyed by future damage will be captured (a waste of pod).
- When the pod's combat strength is depleted it detaches from the ship and if it is controlled by an Aczanny will explode doing the following damage: There is a bug here that the damage (other than armor) is removed from the ship instead of added.
- Every tick, Assault Pods that are within a range of 10 of an enemy ship will dock with it. Combat strength of the pod and ship are determined. While either of these combat values are greater than 10,000, they will be halved.
- Pod strength = .4 * (colonists * colonist combat rating / 10) + (crew * crew combat rating) + (troops * troops combat rating) + (high guard * high guard combat rating * 20)
- Ship strength = ((ship skill + 40) / 100) * 10 * (colonists * colonist combat rating) + (crew * crew combat rating) + (troops * troops combat rating) + (high guard * high guard combat rating * 20)
- Every tick, ships are checked to see if they are disabled. When either the attack or evasive bonus is positive and the hull damage is greater than 700, engine damage is greater than 500, or the system damage is greater than 800 the ship has a 40% chance of becoming disabled. When disabled, the evasive bonus is set to -100, attack bonus is set to 0, and if its fear is less than 10,000 it will gain 100 fear.
- Every tick, Federation ships that have the Scotty bonus active and hull and system damage less than 900 will have a chance to repair systems.
- 3% chance for hull damage to be repaired by 100.
- 5% chance for shield strength to increase by 20.
- 2% chance for weapons to be completely repaired.
- 1% chance for system damage to be completely repaired.
- Every tick, when a Solar Gamma Ray ship is present in the combat any ships with Organic Armor will lose one point of armor.
- On tick 25, any ships that qualified for the cloak bonus during initialization gain power in their weapons. Each gains power according to the list below, but if the resulting power is less than 120, it is set to 10,000. The Ill Wind Class Battlecruiser controlled by any player gains a special power boost for its large weapons (cloaked or not) of 3,000 energy for each.
- Point Defense: 1/10 of the Power Capacity
- Large Weapons: 1/3 of the Power Capacity
- Small Weapons: 1/15 of the Power Capacity
- On ticks 310 and 4000, a power boost for all ships occurs. Each gains power according to the list below, but if the resulting power is less than 120, it is set to 10,000 except for Large & Super Weapons.
- Point Defense: 1/10 of the Power Capacity
- Large Weapons: 1/2 of the Power Capacity with a maximum of 1,000
- Small Weapons: 1/10 of the Power Capacity
- Super Weapons: 800 + Power Capacity (when result is < 120, set to 20,000)
- Every 3rd tick between ticks 50 and 300, charge weapons. All active combatants go through the following weapon charging process.
- If a ship has crew and less than 99.9% system damage then:
- Start with 1 point of energy in its energy pool (which will be referred to as E).
- Check the engine damage to see if it exceeds the engine hardness value. If not then add to E the amount of energy that the engines produce times the number of engines on the ship.
- Check the engine damage again and match this against the hardness value of each generator. If it is not exceeded, then add the energy of the generator to E. Mivorari gain an additional 50% energy per generator.
- An active Aczanny ECM Jammer will reduce E by 150.
- If there is anything in E, then loop through point defense weapons. For each that does not meet the following criteria, reduce E by the charge rate and add the charge rate energy to the weapon. If the Exotic Tech PD Boost is active, then add the charge rate energy to the weapon again. E is not reduced in this case.
- The weapon damage of the ship exceeds the hardness of the weapon.
- The weapon is not fully charged.
- E meets or exceeds the charge rate of the weapon.
- If there is anything in E, then loop through small weapons. For each that does not meet the criteria above then reduce E by the charge rate and add the charge rate energy to the weapon.
- If there is anything in E, then loop through large weapons. For each that does not meet the criteria below then reduce E by the charge rate and add the charge rate energy to the weapon. If E does not meet or exceed the charge rate, then add the remainder of E to the weapon and E is set to 0. Ill Wind Class Battlecruiser gains an additional 5 points of energy applied to each weapon. This may be a bug. It seems that the Ill Wind should have to be owned by a Stormer also. If the weapon is a Plasma Bolt Cannon and it is mounted on hulls 524 (Lotus Class Pursuit Ship) or 525 (Aurora Class Flagship) and the weapon damage of the ship doesn't exceed the hardness of the weapon then reduce E by the charge rate and add the charge rate energy to the weapon again.
- The weapon damage of the ship exceeds the hardness of the weapon (Ill Wind Class Battlecruiser is immune to this. This may be a bug. It seems that the Ill Wind should have to be owned by a Stormer also.
- The weapon is not fully charged.
- E meets or exceeds the charge rate of the weapon.
- If a super weapon is mounted on the ship, then reduce E by the charge rate and add the charge rate energy to the weapon if the criteria below is not met.
- The weapon damage of the ship exceeds the hardness of the weapon.
- The weapon is not fully charged.
- E meets or exceeds the charge rate of the weapon.
- Bases gain double their baseGen value in energy (maximum of 1000000 energy).
- For wings, each fighter type is calculated separately. Where E is double the generator value of the fighter type and N is the number of fighters of this type, the amount of energy gained per type is (E * N) / 400 + 0.99. The amount of energy stored in the wing for this type maxes out at 1000000000 or the battery value of the fighter type * N, whichever is lower.
- During charge weapons step, Holo Decoys decay. The number of decoys is the % chance that the number of decoys is reduced by 1 (e.g. if there are 100 decoys out then there is a 100% chance that one will be removed).
- If a ship has crew and less than 99.9% system damage then:
- Every tick after 300, charge weapons (see steps above).
- Every tick after 10, fire weapons.
- Decrement the super weapon counter, which limits the firing of super weapons for all players.
- The order of attacking units in which they are processed is randomized. Loop through all units until all have fired their weapons.
- Ships with crew and less than 99.9% system damage can fire or Ram.
- If a ship is set to Ram, then find a target in its list that is less than a range of 25 away. If so, perform a Ram.
- The attacker's attack modifier + skill * Rnd is compared to the target's attack modifier + (Rnd * .5 + .5). If the attackers result is higher, then a Ram occurs.
- Ram damage (for target) = attacker's hull mass * attacker's speed * ( 100 / ( target's hull mass + 50 ) )
- Apply the Ram damage to the shields of the target. If there is any Ram damage remaining then apply it to armor. If there is any Ram damage left then apply it to hull, engine, hyperdrive, system, life support, shield generator, weapons, the soft spot, and crew as follows.
- Hull Damage = ((Ram damage * (parts vulnerability / 100)) * (Rnd * 0.2 + 0.8)) * (500 / (target hull mass + 50)) + 0.5
- Engine Damage = ((Ram damage * (engine vulnerability / 100)) * Rnd) * (100 / (target hull mass + 50)) + 0.5
- Hyperdrive Damage = ((Ram damage * (hyperdrive vulnerability / 100)) * Rnd) * (100 / (target hull mass + 50)) + 0.5
- System Damage = ((Ram damage * (system vulnerability / 100)) * Rnd) * (100 / (target hull mass + 50)) + 0.5
- Life Support Damage = ((Ram damage * (life support vulnerability / 100)) * Rnd) * (100 / (target hull mass + 50)) + 0.5
- Shield Generator Damage = ((Ram damage * (parts vulnerability / 100)) * Rnd) * (100 / (target hull mass + 50)) + 0.5
- Weapon Damage = ((Ram damage * (parts vulnerability / 100)) * Rnd) * (100 / (target hull mass + 50)) + 0.5
- If Rnd * 20 < the Soft Spot of the target ship then additional hull damage is added: 600 + Rnd * 2000
- Rnd * 100 crew are killed on the target ship.
- Ram damage (for attacker) = attacker's hull mass * attacker's speed * ( 100 / ( attacker's hull mass + 50 ) )
- Apply the Ram damage to the shields of the attacker. If there is any Ram damage remaining then apply it to armor. If there is any Ram damage left then apply it to hull, engine, hyperdrive, system, life support, shield generator, weapons, the soft spot, and crew as follows.
- Hull Damage = ((Ram damage * (parts vulnerability / 100)) * (Rnd * 0.2 + 0.8)) * (500 / (target hull mass + 50)) + 0.5
- Engine Damage = ((Ram damage * (engine vulnerability / 100)) * Rnd) * (100 / (target hull mass + 50)) + 0.5
- Hyperdrive Damage = ((Ram damage * (hyperdrive vulnerability / 100)) * Rnd) * (100 / (target hull mass + 50)) + 0.5
- System Damage = ((Ram damage * (system vulnerability / 100)) * Rnd) * (100 / (target hull mass + 50)) + 0.5
- Life Support Damage = ((Ram damage * (life support vulnerability / 100)) * Rnd) * (100 / (target hull mass + 50)) + 0.5
- Shield Generator Damage = ((Ram damage * (parts vulnerability / 100)) * Rnd) * (100 / (target hull mass + 50)) + 0.5
- Weapon Damage = ((Ram damage * (parts vulnerability / 100)) * Rnd) * (100 / (target hull mass + 50)) + 0.5
- If Rnd * 20 < the Soft Spot of the target ship then additional hull damage is added: 600 + Rnd * 2000
- Rnd * 100 crew are killed on the target ship.
- The attacker's attack modifier + skill * Rnd is compared to the target's attack modifier + (Rnd * .5 + .5). If the attackers result is higher, then a Ram occurs.
- If an IMT ship is set to Ram, then it gets another chance to Ram if a target in its target list is less than a range of 125.
- Loop through small weapons on the attacking ship and verify that the weapon has a full charge and the ship has enough ordnance. Loop through the attacker's targets. If the attacking ship has "Do Not Fire At Disabled" turned on and the target's system damage is over 100% or the target is a wing then skip it. Check the weapons range against the distance to the target and if in range then fire the weapon. The charged energy in the weapon is set to 0 and the ordnance cost is deducted from the ship's supply of ordnance. There is a bug here that small weapons aren't checked to see if there is too much damage to the ship's weapon systems to fire.
- Loop through large weapons on the attacking ship and give it a 90% chance to proceed. Verify that the weapon has a full charge, that the ship's weapon damage doesn't exceed the hardness of the weapon (Stormers are immune to this restriction), and that the ship has enough ordnance. Loop through targets in the attacker's target list. If the attacking ship has "Do Not Fire At Disabled" turned on and the target's system damage is over 100% then skip it. If the weapon is a Plasma Bolt Cannon and it is mounted on hulls 524 (Lotus Class Pursuit Ship) or 525 (Aurora Class Flagship) then the range of the weapon becomes 760. If the attacker is closer to the center of the map than the target then increase the range of the weapon by 15%. Check the range to the target versus the range of the weapon. When the weapon fires, set the weapon's charged energy to 0 and remove ordnance from the ship based on the ordnance cost of the weapon. There is currently a bug here that when a PBC is used by ships 524 or 525 then "Do Not Fire At Disabled" setting is ignored.
- If the weapon is an Ionic Gun Array or Ion Cannon then check the ship's "Fire Ion Guns on Shields" setting and fire at ships and bases when enabled. When not enabled, only fire if the target's shield strength is 0.
- If the weapon is a Sand Caster then fire at ships when the ship's "Fire Sand Casters at Ships" is enabled, Energized Sand is active, the target has shields up, or there are over 20 Holo Decoys active. When there are over 20 decoys active, 15 are destroyed. When the ship's "Fire Sand Casters at Wings" is enabled, fire at wings.
- When the weapon isn't Ion-based or a Sand Caster it will fire at bases and ships. If the weapon is a Plasma Bolt Cannon and it is mounted on hulls 524 (Lotus Class Pursuit Ship) or 525 (Aurora Class Flagship) then the ordnance cost is doubled.
- Loop through point defense on the attacking ship and give it a 90% chance to proceed. Verify that the ship's weapon damage doesn't exceed the hardness of the weapon. Loop through the attacker's targets, verifying that the target is a wing and that the weapon has a full charge, the ship has enough ordnance, and the weapon has an anti-fighter accuracy over 0. When the point defense fires, its weapon charge is set to 0 and the ordnance cost is deducted from the ship's supply. Holo Decoys don't require a target and always have a chance to drop when the combat phase is less than 100; otherwise, it has a 40% chance to drop. Only 249 decoys can be active for a given player. When the combat phase is less than 110, the weapon energy charge is reduced by 1; otherwise, it is set to 0. The ordnance cost is dedcucted in any case.
- Give a 50% change to proceed. If Anti-Fighter Computer is active for the attacker and Fighter ECM Box is inactive for the target then fire a shot at triple the max range of the point defense. When this shot at triple range occurs, skip the normal shot in the next step.
- Give a 50% change to proceed. Fire a shot if the target is within standard range.
- If the ship mass of the attacker is over 690 then fire a shot. Continue to the next step.
- If the ship mass of the attacker is over 1200 then fire a shot. Continue to the next step.
- If the ship mass of the attacker is over 1800 then fire a shot.
- When a super weapon is mounted on the ship, it is enabled, has a full charge, the ship's weapon damage doesn't exceed the hardness of the weapon, the super weapon counter is at 0, a 5% chance succeeds, and there is no Aurora Class Flagship present jamming super weapons (an Aurora doesn't jam itself or any other Aurora's) then the super weapon will fire. The weapon's energy charge is set to 0 and the ordnance cost is removed from the ship's supply.
- The super weapon counter is set to 6. This is a bug. It should be set to 6 after ordnance is checked.
- Ordnance is checked to see if there is enough to fire. Crystal Light Ships don't require ordnance to fire their super lasers.
- For the Super Laser, if the combat phase is over 4000 and the kill target is set, then fire at the kill target.
- If "Fire at Ground Targets" is enabled, then find the first enemy base and fire at it.
- Loop through targets of the attacker. If the weapon is a Nemesis Torpedo then fire. Otherwise, if the attacking ship has "Do Not Fire At Disabled" turned on and the target's system damage is over 100% or the target is a wing or pod then skip it. If the combat phase is over 3000 or the weapon is not a Super Laser or the target is not a planet then fire.
- If a ship is set to Ram, then find a target in its list that is less than a range of 25 away. If so, perform a Ram.
- Bases with Ion Cannons or Anti-Aircraft Guns can fire.
- Verify that the base's energy meets or exceeds the HConfig Base Ion Cannon Charge setting, has more than 10 ordnance minor bug here, should be able to meet or exceed 10 ordnance, and doesn't have a base shield active. Loop through the base's target list, skip anything that is not a ship and isn't within range (determined by the HConfig Base Ion Cannon Range setting). For every Ion Cannon present, give a 50% chance to fire as long as there is enough energy ( bug: ordnance was missed ... oops). Each time a shot is fired, the charge is deducted from the base's energy and 10 ordnance is removed from the base's supply. Go to the next target if the base has enough energy (bug: not ordnance again ... oops).
- Verify that the base's energy meets or exceeds the HConfig Base AAA Charge setting. Loop through the base's target list, skip anything that is not a wing, isn't within range (determined by the HConfig Base AAA Range setting), and doesn't have "Ground Strike" enabled. For every AAG, give a 25% chance to fire as long as there is enough energy. Each time a shot is fired, the charge is deducted from the base's energy. Go to the next target if the base has enough energy.
- Wings will fire.
- Each fighter type in a wing will fire beams and missiles individually.
- Beams will fire first if the fighter type has enough energy (determined by the HConfig Fighter Beam Charge setting. Loop through the wing's target list, skipping any that are not within beam range or that have over 100% system damage when the wing's "Do Not Fire At Disabled" is turned on. It has a chance to fire if the range is less than 100 or a 5% chance is met. It again has a chance to fire if the range is less than 60 or the target's Anti-Fighter Computer is inactive or a 30% chance is met. For each fighter of this type it will fire if it has enough energy and a 5% chance is met. When it fires, the fighter type's energy is reduced by the HConfig Fighter Beam Charge setting amount. There is a bug here, but I've confirmed that it will be fixed in Host 197. If the fighter type is type-2 Coalition, there are more than 40 fighters, and there are less than 250 decoys present then the decoys will be increased by the number of fighters / 40.
- Missiles will fire if the fighter type has a missile rating, ordnance, and enough energy (determined by the HConfig Fighter Missle Charge setting. Loop through the wing's target list, skipping any that are not within beam range or that have over 100% system damage when the wing's "Do Not Fire At Disabled" is turned on. It has a chance to fire if the range is less than 120 or the target's Anti-Fighter Computer is inactive or a 10% chance is met. For each fighter of this type it will fire if it has enough energy, ordnance, and a 5% chance is met. When it fires, the fighter type's energy is reduced by the HConfig Fighter Missle Charge setting amount and the ordnance is reduced by 1. There is a bug here, but I've confirmed that it will be fixed in Host 197.
- Each fighter type in a wing will fire beams and missiles individually.
- Apply future damage. Damage caused by weapons may be scheduled to be applied in future combat phases based on the ordnance cost of the weapon. That damage is applied during this step. Also, any ships that have over 100% hull damage are destroyed. If there are units (namely wings and pods) docked to the ship then they will appear on the map unless they are destroyed with the ship. The chance for destruction is: Hull Damage / 10 + Engine Damage / 10 - 100. If a number between 0 and 999 is below this chance then the unit is destroyed.
- Move combatants. This will be presented here in the future.
[edit] Aftermath
- Mark the coordinates of the combat as the location for Wreckage Pods. If there were no Scavenger ships in the combat, then look for a Scavenger base within 500 ly of the combat center and mark that as the location. If no base is found then look for a Scavenger ship and mark that as the location.
- Loop through all combatants. Any destroyed combatants will have a message created for them to be put into the RST file. Destroyed units are processed thus:
- Ore Pods will have their minerals put on a planet at the combat, if it exists.
- Construction Pods will have their minerals put on a planet at the combat, if it exists.
- Any ships destroyed in the combat
- increment the experience point gain pool. The pool has a minimum value of 10.
- High Guard will escape.
- If the hull damage was less than 500% and a 40% chance is met or a Scavenger was located then a Wreckage Pod will be created (if there are available resource points). It will contain the minerals used to build the ship and any that exist in the cargo. Fuel will be in the pod unless the owner was Solorian. Ordnance, supplies, repair, med units, weapons, point defense, generators, hyperdrive, engines, and the shield generator is put into the pod. The mass of the pod will equal the mass of the ship. The pod's owner will be the original ship owner's unless a Scavenger was found then the Scavenger will own it. When a pod is not created and there is a planet at the combat, the minerals and fuel (except in the case of the ship being Solorian-owned) will appear on the planet surface.
- If a Planet was destroyed, it is changed into an Asteroid Field.
- If the pod was a Native Pod with Chupanoids in it then up to 10 planets within 350 ly will have an equal share of Chupanoids land there.
- If a base was destroyed then a message will be created and put into the RST file. If the base was Privateer-owned, then megacredits, fuel, ordnance, and repair are added to the planet surface based on a factor of how many original colonists were present. For every 300 privateer colonists that are killed that way, 6 megacredits, 2 fuel, 12 ordnance, and 3 repair units appear on the planet surface. Details:
- v = colonists / 50
- Megacredits: v + megacredits from base
- Fuel: v / 3
- Ordnance: v * 2
- Repair: v / 2
- If a Super Weapon was fired, a single message will be produced and put into the RST file.
- Any captured ships have their speed set to 0, their hyperdrive turned off, and all race-specific ship devices turned off. Messages are put into the RST files of capturer and victim.
- Surviving ships gain experience from the experience pool and an additional Rnd * 10, but only if there is experience in the pool. The pool is only created during the Aftermath process from any destroyed ships.
- Surviving bases suffer the following penalties:
- Gain crime from damage taken: damage / 1000 * Rnd (maximum of 100). Crime is capped at 10000.
- Natives get unhappy: damage / 1000 * Rnd (maximum of 100). Happiness can only go down to -300.
- Colonists get unhappy: damage / 1000 * Rnd (maximum of 100). Happiness can only go down to -300.
- 60% chance that the food storage will get damaged. Lost food = (damage / 10) * Rnd. The damage value is decremented by the amount of food lost.
- 50% chance that the med unit storage will get damaged. Lost med units = (damage / 50) * Rnd. The damage value is decremented by the amount of med units lost.
- 50% chance that the contraband storage will get damaged. Lost contraband = (damage / 100) * Rnd. Every type is affected the same. The remaining damage is unchanged.
- 50% chance that the supplies storage will get damaged. Lost supplies = (damage / 30) * Rnd. The damage value is decremented by the amount of supplies lost.
- 50% chance that the repair units storage will get damaged. Lost repair units = (damage / 30) * Rnd. The damage value is decremented by the amount of repair units lost.
- When the remaining damage is greater than 400 there is a 15% chance that the super weapon storage will get destroyed entirely. If so, the damage will be increased by Rnd * 4000.
- When the remaining damage is greater than 400 there is a 12% chance that the point defense storage will get destroyed entirely. If so, the damage will be increased by Rnd * 200.
- When the remaining damage is greater than 300 there is a 17% chance that the large weapon storage will get destroyed entirely. If so, the damage will be increased by Rnd * 200.
- When the remaining damage is greater than 350 there is a 30% chance that the small weapon storage will get destroyed entirely. If so, the damage will be increased by Rnd * 100.
- When the remaining damage is greater than 350 there is a 18% chance that the engine storage will get destroyed entirely. If so, the damage will be increased by Rnd * 600.
- When the remaining damage is greater than 350 there is a 18% chance that the hyperdrive engine storage will get destroyed entirely. If so, the damage will be increased by Rnd * 400.
- When the remaining damage is greater than 350 there is a 14.5% chance that the shield generator storage will get destroyed entirely.
- When the remaining damage is greater than 350 there is a 23.45% chance that the generator storage will get destroyed entirely. If so, the damage will be increased by Rnd * 800.
- If the owning player is a Robot and the remaining damage is greater than 550, then all racial structures are destroyed.
- If the remaining damage is greater than 100 there is a 20% chance for each of the following buildings to be destroyed (in this order): Pod Pad, Air Attack Base, Military Spaceport, Engine Plant, Mech Plant, Fighter Plant, Med Lab, Government Center, Base Shield, Ordnance Plant, Weapons Factory, Ship Parts Factory. Damage is reduced by 100 for each building destroyed.
- When the remaining damage is greater than 1000 then colonists are killed. The number of colonists killed = ((colonists - (raid shelters * 10000) - (undercities * 10000)) / 2) * Rnd. If the base-owner is a Privateer then cash, fuel, ordnance and repair is put on the planet surface as listed below. The remaining damage is reduced by 1000 * Rnd.
- v = colonists killed / 50
- Cash = v
- Fuel = v / 3
- Ordnance = v * 2
- Repair = v / 2
- When the remaining damage is greater than 1000 then (crew / 4 * Rnd + 1) crew are killed. The remaining damage is reduced by 1000 * Rnd.
- When the remaining damage is greater than 1000 then (troops / 6 * Rnd + 1) troops are killed. The remaining damage is reduced by 1000 * Rnd.
- When the remaining damage is greater than 1000 then a random % of total prisoners are killed.
- When the remaining damage is greater than 1000 then a random % of total natives are killed.
- When the remaining damage is greater than 1000 then a random % of total high guard are killed.
- When Rnd * 10000 is less than the amount of ordnance in the base then Rnd * Ordnance is lost and that amount is added to the damage.
- When the remaining damage is greater than 1500 then ((total * Rnd) / 3) rogue colonists and natives are killed.
- When the remaining damage is greater than 9000 then (damage / 1000 * Rnd) smelters are destroyed. The remaining damage is reduced by the number of buildings destroyed * 50.
- When the remaining damage is greater than 3000 then (damage / 800 * Rnd) factories are destroyed. The remaining damage is reduced by the number of buildings destroyed * 80.
- When the remaining damage is greater than 3000 then (damage / 1800 * Rnd) mineral mines are destroyed. The remaining damage is reduced by the number of buildings destroyed * 180.
- When the remaining damage is greater than 1000 then there is a 20% chance that fighters will be destroyed. The number destroyed is (fighters * Rnd / 2), which is performed separately for each type. The remaining damage is reduced by the number of fighters destroyed.
- When the remaining damage is greater than 1000 then there is a 50% chance that (damage / 500 * Rnd) cities are destroyed. The remaining damage is reduced by 300.
- When the remaining damage is greater than 1000 then there is a 50% chance that (damage / 600 * Rnd) training centers are destroyed. The remaining damage is reduced by 30.
- When the remaining damage is greater than 1000 then there is a 50% chance that (damage / 600 * Rnd) racial structures are destroyed. The remaining damage is reduced by 30 for each type of structure.
- When the remaining damage is greater than 1000 then there is a 30% chance that (damage / 600 * Rnd) farms are destroyed. The remaining damage is reduced by 130.
- When the remaining damage is greater than 1000 then there is a 40% chance that (damage / 600 * Rnd) public space ports are destroyed. The remaining damage is reduced by 160.
- When the remaining damage is greater than 1000 then there is a 30% chance that (damage / 700 * Rnd) terraformers are destroyed. The remaining damage is reduced by 160.
- When the remaining damage is greater than 500 then there is a 10% chance that (total * Rnd) armor is destroyed. The remaining damage is reduced by 5 * armor destroyed.
- When the remaining damage is greater than 1000 then there is a 80% chance that (damage / 100 * Rnd) scanners are destroyed. The remaining damage is reduced by 60 per building destroyed.
- When the remaining damage is greater than 1000 then there is a 10% chance that (total * Rnd / 4) mechs are destroyed. The remaining damage is reduced by the number of mechs destroyed.
- When the remaining damage is greater than 7300 then there is a 4% chance that (damage / 1000 * Rnd) raid shelters are destroyed. The remaining damage is reduced by 260.
- When the remaining damage is greater than 7700 then there is a .5% chance that (damage / 1000 * Rnd) undercities are destroyed. The remaining damage is reduced by 360.
- Home Guard wings return to their base.
[edit] VCR Scan
Determine if the VCR is "boring" and delete it if so.
[edit] Glossary
| Alien Hulls | These are ships captured by another race that doesn't have that hull as one that they can build by themselves. If the HConfig option "Alien Hulls have problems with Combat, Scanning and Repair" is turned off then there are no penalties for owning an alien hull. |
|---|---|
| Ang | The angle in radians where a unit is positioned around the origin. |
| Anger | Value added to "do not run" calculation. It is never adjusted during combat. This feature has almost been entirely removed from combat. |
| Combat Speed | Value that determines how fast a unit will move within the combat area. There is a "current" value and a "maximum" value. |
| Fear | Value added to "run" calculation. Fear on ships is adjusted when they are disabled. |
| Hive Mind | Hive Mind is a counter from 0 to 10 that increments by 1 when a hive ship is initialized in Ship Initialization. |
| Hull | When referring to a hull, you are referring to the general abilities of the hull itself, and not the abilities of the controlling player/race. A hull defines what the hull is capable of having on it; whereas a ship will define what the controlling player has put on the hull. Hull defines the capacity of things like ordnance and how many large weapons can be mounted. |
| Movement Reaction Time (deltaTime) | Units can only make decisions on how to change their movement goals every few ticks. This is determined by the deltaTime value. In general, ships are slower at changing the movement than wings. |
| Polar Distance | Distance from the center of the map (origin). |
| Shield Strength | This is the current level of the shields that offer protection against weapons. Ships have shield generators put on the hull. Hulls define what size shield it can have as a maximum. Damage to the shield generator will lower its ability to provide a full shield strength in the next combat. |
| Ship | A ship defines what the controlling player has put onto a hull, such as armor, weapons, crew, etc. When a controlling player transports ordnance into a ship, the hull determines how much capacity for ordnance the ship can hold. |
| Tick (Pulse) | This is a measurement of time as far as at what point is a unit at a certain location. It abstracts seconds, minute, hours, etc and is only used to determine the relative difference between one point and another. |
