Talk:Space Combat - Fighter Wings

From PlanetsWiki

Jump to: navigation, search

I did a quick look over the code and did find a Unicom section. However, it is not in the combat code itself, but is in the subroutine that loads the data at the beginning of the fight. As I only had the combat code itself when I originally wrote the psuedo code, it was not included. I'll do a more complete analysis tomorrow. There should be no problem with this bonus combining with the large wing benefits.Amaranthine 05:07, 13 August 2007 (CEST)

host 197-Fixed: Virgo's Unicom never turns on. i dont see anything regarding that unicom is now working in this code. is it not working? or is it just left out. is the unicom a bonus that can be added cumulative to large wings versus ship bonus? or is does it only allow for one of the bonuses?--protomatter 03:20, 13 August 2007 (CEST)

Does the new bonus of big wing vs ship from host 208 have being added to the pseudo code ?
Lord Lancelot 19:11, 10 August 2007 (CEST)
Yes. Both Fighter Beam and Missile get a bonus.
Beams max at +35 with 500 fighters and Missiles max at +85 at 500 fighters.
Amaranthine 20:14, 10 August 2007 (CEST)


Is there any fighter that succeeds with its beams or missile when firing through the base shield with the formula given?

Fighters always fire though base shields.

Reply: Which fighters can successfully overcome these beam odds and land a hit?

Beams: If there is a Base Shield: vBOdd = 3000 + (# of BaseAACannon) * 30 Maximum of 20,000 rOdds = BeamOdds * 2 Check for HIT, (Rnd * vBOdd) < rOdds: ...

80 is a high beam accuracy value, gives rOdds = 160 Value of random variable needs to be less than 0.05. The best fighter has a 5 percent probability to land a hit. Whether that hit accomplishes something, seems to depend on whether there's is a NEW roll of the dice for the random variable or whether the same value is used for the rest of the hit code. If there is a new roll of the dice, then don't expect much.


Missile: If there is a Base Shield: vBOdd = 500 + (# of BaseAACannon) * 5 Maximum of 6,500 rOdds = MissileOdds * 2 Check for HIT, (Rnd * vBOdd) < rOdds: ...

80 is a high missile accuracy value, gives rOdds = 160, results in about a 1 in 3 chance to land in hit. For the hit outcome see above.

Any ideas which of the Rnd's in the combat codes are separatedly calculated?

Every Rnd in host are newly rolled dices, so expect different numbers. With 110 AA-gun, missiles firing, missile accuracy= 80; expect ((500 + 5*110))/160 = 0,152 -> 15,2% of the missiles do actually impact on the base.

Reply: OK, thanks. That means the probability of successfully eliminating the base shield with a missile is about 0.33*0.01 or 0.3% of all missiles fired at the base. Beams are useless against the baseshield: 0.05*0.001 = 0,00005 or 0.005%.

The chance to take out the baseshield is not coupled with the chance to destroy something in the base. Every hit has a chance to destroy the baseshield, regardless weather it does any damage inside the base (Building, AA-Guns, IC). Missile or beam power doesn't matter. If you fire 100 missiles at the base you have a chance of 0,999^100 = 0,904 -> 90,4% that the baseshield is still there (not enforcers).

What about that incoming fire bit of code? Is that variable constantly reset to zero or does it grow over the course of a vcr with each missile hit? The latter means the longer the fighter bombardment of a base lasts, the more likely it is that it will cause destruction. It would also mean, if your bombers are wiped out by enemy interceptors, base air defense or defending ships after their first few initial bombing runs they will have accomplished nothing.

BaseIncomming does grow over the whole combat. It grows from any hit impacting to the base regardless weather ships or wings did the damage. Conclusion is, that at the beginning you need some damage impacting to the base (3000 is not that much, one blaster hit does this already) and afterwards you need only many number of hits to destroy the planet defences (AA&IC).


_______

Sandcaster vs. fighters:

   If HIT:
     Armor Modifier = (20 – fighter’s armor) / 100
       Minimum of 0.02        (2% with 18 armor)
       Maximum of 0.2         (20% with 0 armor)

Is that right? That way fighters with 20 armor would be immune to sandcasters. And what about figthers with even more armor?

Jochen 14:27, 28 April 2006 (CEST)


The minimum of 0.02 is the minimum damage modifier regardless of how much armor the fighter type has. So all fighter types will take damage. BTW, the average armor of all wings in the game is 12.48. --Magik 19:04, 28 April 2006 (CEST)


Contents

[edit] Beam Range Modifier

The formula confuses me:

 Range Modifier = (MaxRange – Range) / MaxRange * 0.9 + 0.9
 Minimum of 0.1

This sugests that

  • if Range= Max Range then Range Modifier is 0.9
  • if it is point blank range is it 1.8 and
  • anything above 189% of Max Range has a range modifier of 0.1
  • I would think anything longer than Max Range would never fire

I think perhaps it should be

 Range Modifier = (MaxRange – Range) / MaxRange * 0.9 
 Minimum of 0.1

or

Range Modifier = (MaxRange – Range) / MaxRange * 0.8 + 0.1

If someone could clear up this, I would appreciate it. --KBJ07675 12:16, 29 August 2007 (CEST)

I believe the 0.1 minimum is to simply prevent any negative or 0 value from EVER being used as a modifier. As the code is written, I don't believe that that sort of value is possible to arrive at, and that this is just a bit of defensive coding.
Amaranthine 22:26, 29 August 2007 (CEST)


Does that mean you can hit beyond maxrange? and the at Max Range, you your chances to hit are 50% of Point Blank Range?--KBJ07675 03:13, 31 August 2007 (CEST)
I'm not sure about the Point Blank. However, the ship will not fire beyond Max Range because Range is checked before the firing code is called (check the Begin Attack Run portion). Amaranthine 15:33, 31 August 2007 (CEST)

Tactically, this explains advise that I have received that Range is among the most important stats. If you hit only twice as well at point blank range. Shooting is what matters not how close you are when you shoot. Assuming you have power and Armor to survive, range is how often you shoot. I just noticed that on my first note, the Beam vs ship range modifier was changed but not the Beam vs. Wing which is still as indicated. Beam vs ship is now:

 Range Modifier = (MaxRange – Range) / MaxRange * 0.4 + 0.6
 Minimum of 0.1

Which means Point blank range is modificed to just 67% of the hit % of max range. Please double check the Range Modifier on Wing vs wing combat.--KBJ07675 13:08, 5 September 2007 (CEST)


SC vs. Wings prior to Host 213:

For each Fighter Type in Wing (loop 3 times)

  rOdds = Sand Caster Hit Odds (Energized Sand does not increase this)

  Range Modifier = (MaxRange – Range) / MaxRange * 0.5 + 0.5
    Minimum of 0.1

  Evasion Modifier = (100 – fighter's Evasion) / 100
    Minimum of 0.1

  rOdds = rOdds * Range Modifier * Evasion Modifier

  Check for HIT, (Rnd * 100) < rOdds:
    If HIT:
      Armor Modifier = (20 – fighter’s armor) / 100
        Minimum of 0.02        (2% with 18 armor)
        Maximum of 0.2         (20% with 0 armor)

      If fighter count < 50
        Then Armor Modifier = Armor Modifier * 3  (6% - 60%)

      Hits = fighter count * Armor Modifier * Rnd

      If fighter count (all) > 100
        Then Hits = Hits / 3
      If fighter count (all) > 200
        Then Hits = Hits / 3  (1/9)
      If fighter count (all) > 500
        Then Hits = Hits / 3  (1/27)

      If Energized Sand Inactive or 20% likely if Energized Sand Active
      ' NOTE: Fighter ECM Box does not counter Energized Sand
        If Evil Empire Wing
          Maximum Hits = 1
          60% chance Maximum Hits = 0
        If Sand Shields Active
          Hits = Hits * Rnd
          ' NOTE: On average, losses reduced by half
        If Robot R27 Raider
          Maximum Hits = 5
          90% chance Maximum Hits = 0
        If Robot R2 Foxdire
          Hits = Hits * 0.3
        If Robot R1 Rutzie
          Hits = Hits * 0.5

      If Hits > 30
        Hits = 30

fighter count = fighter count – Hits

Wing targeting < Host 213

For each Fighter Type in wing (loop 3 times):

  ' BEGIN BEAM
  If Fighter Type has Beam and there is enough energy (>10) to fire.

    Acquire target (loop 10 times)

      Confirm target is enemy

      If target disabled:
        Disengage and Acquire new target if "Do Not Fire on Disabled" is On

      Confirm within Beam Range
        If Range >= 100, only 5% likely to fire
          If Range >= 60 and Anti-Fighter Computer active, only 30% likely to fire ' {{{1}}}
            Repeat once for each fighter of this type in wing:
              If there is enough energy to fire:
                Each fighter only has a 5% chance of firing
                  FIRE BEAM  ' vs. Ship, Base, Wing, Soft Target
                  Energy of Fighter Type reduced by 10
              Repeat until out of Fighters.

      If fighter is S/Ai-383 Wraith and FighterCount > 40.  ' Still within 10x loop
        If Holo Decoy count < 250
          Holo Decoy count is increased by FighterCount / 40


  ' BEGIN MISSILE
  If Fighter Type has Missile and there is enough Energy (>100) and Ord (>1) to fire.

    Acquire target (loop 10 times)

      Confirm target is enemy

      If target disabled:
        Disengage and Acquire new target if "Do Not Fire on Disabled" is On

      Confirm within Missile Range
        If Range >= 120 and Anti-Fighter Computer active, only 10% likely to fire.
          Repeat once for each fighter of this type in wing:
            If there is enough energy to fire:  (doesn’t check Ord, bug)
              Each fighter only has a 5% change of firing
                FIRE MISSILE  ' vs. Ship, Base, Wing, Soft Target
                Energy of Fighter Type reduced by 100
                Ord of Fighter Type reduced by 1
            Repeat until out of Fighters.

[edit] Wing vs. Ship

Information based on host versions prior to Host 213 - things definitely have changed. Look at The Battle Manual for up-to-date information on space combat.

[edit] Fire Beam

rOdds = BeamOdds
If High Guard present on Wing, increase rOdds by 40

If fighter count (of type) > 200
  Then rOdds increased by 20
If fighter count (of type) > 400
  Then rOdds increased by 10 (30)
If fighter count (of type) > 500
  Then rOdds increased by 5 (35)

rOdds reduced by (# of Enemy Holo Decoys / 30)
Range Modifier = (MaxRange – Range) / MaxRange * 0.4 + 0.6
  Minimum of 0.1

If Aczanny ECM Jammer active:
  rOdds reduced by 15

Evasion Modifier = (100 – target’s evasive mod + fighter’s attack mod) / 100
  Minimum of 0.1

rOdds = rOdds * Range Modifier * Evasion Modifier
  Minimum of 10

If target Experience > 100:
  r = 1 – (Experience * 0.001)
    Minimum of 0.3
  rOdds = rOdds * r

If Wing experience > 100:
  r = 1 + (Experience * 0.001)
    Maximum of 1.7
  rOdds = rOdds * r

Check for HIT, (Rnd * 100) < rOdds

If HIT:

  ' Shield Drain
  If NOT flag Emp:
    Shield = Shield – fighterBeam
      Minimum of 0
  ' Thunder Dancers inflict control damage on unshielded or EE ships
  If Shield = 0 OR flag Emp:
    If flag Rebel:
      If Type 3 Fighter:
        DamageSys increased by 5
          Maximum of 5000

  ' Armor Drain
  If NOT flag EmpHit:
    Armor = Armor – fighterBeam/2 – 1
    If Rnd < 0.5:
      Armor = Armor – 1
    If High Guard on Wing:
      Armor = Armor – Rnd * 10
    Minimum armor of 0

  ' Hull
  If Armor < 1 OR flag EmpHit:

  (1 vH point = 1/10 damage unit)

    ' HULL DAMAGE
    vD = fighterBeam + 1
    If HighGuard on Wing:
    vD = vD + 2
    vS = target’s parts modifier
    vH = ((vD*(vS/100))*(Rnd*0.25+1.25))*(100/hullmass + 50) + 5
    DamageHull = DamageHull + vH
      Maximum of 5000

    ' ENGINE DAMAGE
    vD = 30 * Rnd
    vS = target’s engine modifier
    vH = ((vD*(vS/100))*Rnd)*(100/hullmass+50)) + 5
    DamageEngine = DamageEngine + vH
      Maximum of 5000

    ' HYPERDRIVE DAMAGE
    Check if ship has HyperDrive:
      vD = 15 * Rnd
      vS = target’s hyperdrive modifier
      vH = ((vD*(vS/100))*Rnd)*(100/hullmass+50)) + 10
      DamageHyp = DamageHyp + vH
        Maximum of 5000

    ' SYSTEM DAMAGE
    vD = Rnd * 30
    vS = target’s system modifier
    vH = ((vD*(vS/100))*Rnd)*(100/hullmass+50)) + 1.5
    DamageSys = DamageSys + vH
      Maximum of 5000

   ' LIFE DAMAGE
    vD = Rnd * 30
    vS = enemy’s life modifier
    vH = ((vD*(vS/100))*Rnd)*(100/hullmass+50)) + 0.5
    DamageLife = DamageLife + vH
      Maximum of 5000

    ' SHIELD GENERATOR AND WEAPONS
    vD = Rnd * 60
    vS = enemy’s parts modifier
    vH = ((vD*(vS/100))*Rnd)*(100/hullmass+50)) + 3
    DamageShield = DamageShield + vH
      Maximum of 5000
    vH = ((vD*(vS/100))*Rnd)*(100/hullmass+50)) + 3
    DamageWeapons = DamageWeapons + vH
      Maximum of 5000

    ' CRITICAL HIT?
    If Rnd*1500 < SoftSpot:
      DamageHull = DamageHull + 500 + Rnd * 2000

[edit] Fire Missile

rOdds = MissileOdds
If High Guard present on Wing, increase rOdds by 60
rOdds reduced by (# of enemy Holo Decoys / 30)

Range Modifier = (MaxRange – Range) / MaxRange * 0.4 + 0.6
  Minimum of 0.1

If Aczanny ECM Jammer active:
  rOdds reduced by 15

Evasion Modifier = (100 – target’s evasive mod + fighter’s attack mod) / 100
  Minimum of 0.1

rOdds = rOdds * Range Modifier * Evasion Modifier
  Minimum of 5

If target experience > 100:
  r = 1 – (Experience * 0.001)
    Minimum of 0.3
  rOdds = rOdds * r

If Wing experience > 100:
  r = 1 + (Experience * 0.001)
    Maximum of 1.7
  rOdds = rOdds * r

If fighter count (of type) > 200
  Then rOdds increased by 40
If fighter count (of type) > 400
  Then rOdds increased by 30 (70)
If fighter count (of type) > 500
  Then rOdds increased by 15 (85)
 
Check for HIT, (Rnd * 100) < rOdds

If HIT:

  ' Shield Drain
  If NOT flag Emp:
    Shield = Shield – fighterMissile -2
      Minimum of 0

  ' Armor Drain
  If Shield = 0 OR flag Emp:
    If NOT flag EmpHit:
      Armor = Armor – fighterMissile/2 – 2
      If Rnd < 0.1:
        Armor = Armor – 5
      If High Guard on Wing:
        Armor = Armor – Rnd * 10
      Minimum armor of 0
 
  If Armor < 1 OR flag EmpHit:

    ' HULL DAMAGE
    vD = fighterMissile + 1
    If High Guard on Wing:
      vD = vD + 2
    vS = target’s parts modifier
    vH = ((vD*(vS/100))*(Rnd*0.75+1.25))*(300/hullmass + 250) + 5
    DamageHull = DamageHull + vH
      Maximum of 5000

    ' ENGINE DAMAGE
    vD = 30 * Rnd
    vS = target’s engine modifier
    vH = ((vD*(vS/100))*(Rnd*0.25+1.25))*(100/hullmass+50)) + 7
    DamageEngine = DamageEngine + vH
      Maximum of 5000

    ' HYPERDRIVE DAMAGE
    Check if ship has HyperDrive:
      vD = 15 * Rnd
      vS = target’s hyperdrive modifier
      vH = ((vD*(vS/100))*Rnd)*(100/hullmass+50)) + 10
      DamageHyp = DamageHyp + vH
        Maximum of 5000

    ' SYSTEM DAMAGE
    vD = Rnd * 30
    vS = target’s system modifier
    vH = ((vD*(vS/100))*Rnd)*(100/hullmass+50)) + 0.5
    DamageSys = DamageSys + vH
      Maximum of 5000

    ' LIFE DAMAGE
    vD = Rnd * 30
    vS = enemy’s life modifier
    vH = ((vD*(vS/100))*Rnd)*(100/hullmass+50)) + 0.5
    DamageLife = DamageLife + vH
      Maximum of 5000

    ' SHIELD GENERATOR AND WEAPONS
    vD = Rnd * 60
    vS = enemy’s parts modifier
    vH = ((vD*(vS/100))*Rnd)*(100/hullmass+50)) + 2
    DamageShield = DamageShield + vH
      Maximum of 5000
    vH = ((vD*(vS*100))*Rnd)*(100/hullmass+50)) + 2
    DamageWeapons = DamageWeapons + vH
      Maximum of 5000

    ' CRITICAL HIT?
    If Rnd*500 < SoftSpot:
      DamageHull = DamageHull + 500 + Rnd * 2000

[edit] Wing vs. Base

[edit] Fire Beam

If "Ground Strike" is On:

  If there is no Base Shield:
    vBOdd = 100 + (# of Anti-Aircraft Guns)
    Maximum of 1000

  If there is a Base Shield:
    vBOdd = 3000 + (# of Anti-Aircraft Guns) * 30
    Maximum of 20,000

  rOdds = BeamOdds * 2
  Check for HIT, (Rnd * vBOdd) < rOdds:

    If HIT:
      Incoming Fire = Incoming Fire + (Rnd * BeamPower)
      If there are Ion Cannons AND BeamPower >= 3:
        If (Rnd * 3000) < Incoming Fire:
          10% chance 1 Ion Cannon destroyed
      If there are Anti-Aircraft Guns:
        If (Rnd * 3000) < Incoming Fire:
          30% chance 1 Anti-Aircraft Gun destroyed
 
  ShieldHit = 0.001    (0.1%)
  If UEA:
    ShieldHit = 0.005  (0.5%)
  If Rnd < ShieldHit:
    Base Shield destroyed

[edit] Fire Missile

If "Ground Strike" is On:

  If there is no Base Shield:
    vBOdd = 100 + (# of Anti-Aircraft Guns)
    Maximum of 600

  If there is a Base Shield:
    vBOdd = 500 + (# of Anti-Aircraft Guns) * 5
    Maximum of 6,500

  rOdds = MissileOdds * 2
  Check for HIT, (Rnd * vBOdd) < rOdds:

    If HIT:
      Incoming Fire = Incoming Fire + (Rnd * MissilePower * 10)
      If there are Ion Cannons AND MissilePower >= 2:
        If (Rnd * 3000) < Incoming Fire:
          15% chance 1 Ion Cannon destroyed
      If there are Anti-Aircraft Guns:
        If (Rnd * 3000) < Incoming Fire
          50% chance that 1 Anti-Aircraft Gun destroyed.

    ShieldHit = 0.01     (1%)
    If Enforcers:
      ShieldHit = 0.03   (3%)
    If Rnd < ShieldHit:
      Base Shield Destroyed

I believe "Incoming Fire" contantly increases (never decreasing) over the duration of the combat.

[edit] Wing vs. Wing

[edit] Fire Beam

rOdds = BeamOdds
If High Guard present in Wing, increase rOdds by 40

MaxRange = Maxrange * 1.5
Range Modifier = (MaxRange – Range) / MaxRange * 0.2 + 0.8
  Minimum of 0.1

Target Fighter Type Selected
  60% Type 1
  25% Type 2
  15% Type 3
  If no Type 1's, select Type 2
  If no Type 2's, select Type 3
  If no Type 3's, select Type 1

  Evasion Modifier = (200-EvasiveMod)/100		(Attack mod = 100)
  If High Guard present, increase Evasion Modifier by 0.4  (another HG bonus to hit)
    Minimum of 0.1
  rOdds = rOdds * Range Modifier * Evasion Modifier
    Minimum of 5

  If fighter count(of firing type) >= 200:
   rOdds = rOdds + 30
  If fighter count(of firing type) >= 400:
   rOdds = rOdds + 20 (50)
  If fighter count(of firing type) >= 500:
   rOdds = rOdds + 15 (65)
  If fighter count(of firing type) >= 1000:
   rOdds = rOdds + 10 (75)

  If Robot fighter attacking CoM Wing:
    rOdds = rOdds / 3
    If target is V15 Viper:
      rOdds = rOdds / 2     (total of rOdds / 6)

  If non-CoM fighter attacking Robot Wing:
    rOdds = rOdds / 1.3
    If target is R27 Raider:
      rOdds = rOdds / 2  (total of rOdds / 2.6)

  Check for HIT, (Rnd * 100) < rOdds:
    If HIT:
      Beam = BeamPower (own)
      Beam = Beam * Rnd + 0.5
      If High Guard on Wing (own)
        Beam = Beam + 1

      Armor = fighterArmor (enemy)
      Armor = Armor * Rnd

      If (Beam > Armor) OR ((Rnd * 30) < fighterSoftSpot (enemy):
        Enemy fighter count decreased by 1

      If fighter count(of firing type) > fighter count(target type) * 2
        Enemy fighter count decreased by 1 (2)
      If fighter count(of firing type) > fighter count(target type) * 3
        Enemy fighter count decreased by 1 (3)
      If fighter count(of firing type) > fighter count(target type) * 4
        Enemy fighter count decreased by 1 (4)
      If fighter count(of firing type) > fighter count(target type) * 5
        Enemy fighter count decreased by 3 (7)

[edit] Fire Missile

rOdds = MissileOdds
If High Guard present in Wing, increase rOdds by 40

If Quasar (Solorian Type 1 Fighter)
  MaxRange = MaxRange * 2

Range Modifier = (MaxRange – Range) / MaxRange * 0.9 + 0.9
  Minimum of 0.1
If at point blank or at maximum range
  Range Modifier = 0.5   (unsure of my interpretation of this bit)

Target Fighter Type Selected
  60% Type 1
  25% Type 2
  15% Type 3
  If no Type 1's, select Type 2
  If no Type 2's, select Type 3
  If no Type 3's, select Type 1

  Evasion Modifier = (200-EvasiveMod)/100             (Attack mod = 100)
  If High Guard present, increase Evasion Modifier by 0.4  (another HG bonus to hit)
    Minimum of 0.1
  rOdds = rOdds * Range Modifier * Evasion Modifier
    Minimum of 8

  If target is Fusion (Solorian Type 2 Fighter)
    rOdds = 0		

  If Robot fighter attacking CoM Wing:
    rOdds = rOdds / 3

  If non-CoM fighter attacking Robot Wing:
    rOdds = rOdds / 2
    If target is R27 Raider:
      rOdds = 0

  ' The following doesn't increase rOdds against Fusion and R27 Raider (Host 210 Patch1)
  If fighter count(of firing type) >= 200:
   rOdds = rOdds + 40
  If fighter count(of firing type) >= 400 Then 
   rOdds = rOdds + 30 (70)
  If fighter count(of firing type) >= 500 Then 
   rOdds = rOdds + 15 (85)
  ' NOTE: No bonus for 1000 fighters

  Check for HIT, (Rnd * 100) < rOdds:
    If HIT:
      Missile = MissilePower (own)
      Missile = Missile * Rnd + 0.5
      If High Guard on Wing (own)
        Missile = Missile + 10

      Armor = fighterArmor (enemy)
      Armor = Armor * Rnd

      If (Missile > Armor) OR ((Rnd * 20) < fighterSoftSpot (enemy):
        Enemy fighter count decreased by 1
        ' NOTE: No extra kills for outnumbering target like beams have

Personal tools