AI War:AI Wave Size Calculations

From Arcen Wiki
Jump to navigation Jump to search

Documentation: Factors that affect wave size

(in development)

WaveSize Overview

From the post http://www.arcengames.com/forums/index.php/topic,6778.0.html

By X4000

Well... it's really, REALLY hard to describe in a concise way in terms of the wave size in particular. There are literally a few hundred lines of code in at least three files that govern this. Make that four files.

The basic underlying rules are thus, though:

1. Higher AI Progress leads to larger waves, pretty linearly. 2. Higher AI Difficulty levels lead to larger or smaller waves, not quite linearly. 3. Higher tech levels lead to corresponding drops in wave size (equivalent to the drop in ship cap at those tech levels). 4. The max/min time between waves varies by AI Difficulty level, and is randomized by around 30ish minutes or more (per AI). The wave size is 1x normal in the middle of that range, and is down to perhaps 0.4x at the lower end, and maybe 3x at the upper end. Or something along those lines.

The above governs all waves and their size, regardless of anything else. But on top of that, and where the biggest complexity comes from, is that there are an absolute ton of possible modifiers:

1. Ships with wave bonuses. 2. The actual end cap on wave size per line item (something like 2000). 3. The number of players in the game (it's 1 line item per human player or homeworld per AI, so 2 total in 1 player, 16 total in 8 player, with either 1 or 2 coming at a time in 1 player, and 8 or 16 coming at a time in 8 player). All the waves from a given AI go to the same planet in multiplayer games, so at most two planets are ever targeted at once. 4. The ship type in use (even in schizophrenic) causes a multiplier. You see fewer vampires always, but always way more laser gatlings. 5. Sometimes a starship or two are added in, but this sometimes costs the AI smaller ships from the wave (depends on the AI type). 6. Recently, same deal as #5 when it comes to "support ships" like munitions boosters and shield boosters, etc. 7. AI modifiers obviously can alter all this. 8. There are also variances per AI type. Mad Bombers have something like 3x larger waves, but almost no defenses, for example.


And... I think those are some other variances, but those are the high points. You won't ever be able to predict wave sizes, trust me. I coded almost all of the variables for it, and I'm not ever able to predict it. There are too many layers of variables and randomization on top of all that. Best advice is to keep the AI progress low and to avoid ships with wave modifiers, and that's mostly all that would be actionable data from all that in a given campaign.


Some other factors: AIs of difficulty 8 get one extra wave per wave instance. So in 1 player games that's 2 waves per AI, in 8 player games it's 9 waves per AI. On difficulty 9 it's 2 extra waves, and 10 3 extra waves.Verify

AI Type Grouped By Wave Multiplyer

case AIType.NeinzulYoungster:


case AIType.Mad_Bomber:


case AIType.Vicious_Raider: case AIType.Technologist_Raider:


case AIType.Attritioner: case AIType.ZenithDescendant: case AIType.StarfleetCommander: case AIType.Experimentalist: case AIType.GravDriller:


case AIType.The_Tank: case AIType.The_Core:


case AIType.Feeding_Parasite: case AIType.Technologist_Parasite: case AIType.Bully: case AIType.Assassin: case AIType.SpeedRacer:

Actual Code

from this post http://www.arcengames.com/forums/index.php/topic,7636.msg63734.html#msg63734


[quote author=x4000 link=topic=7636.msg63734#msg63734 date=1289923913]

[code]

   public static int AdjustNumberShipsFromAIType( AIPlayer player, AIPlanet planet, int NumberOfShips,
       bool IsForReinforcement )
   {
       FInt multiplier = Mat.One;
       bool isCore = planet.IsCoreAIPlanet || planet.IsHomePlanet;
       if ( planet.ControllingPlayer < Configuration.FIRST_AI_PLAYER_INDEX )
           isCore = false;
       switch ( player.AIType )
       {
           case AIType.NeinzulYoungster:
               if ( IsForReinforcement )
                   multiplier = FInt.FromParts( 0, 250 );
               else
                   multiplier = FInt.FromParts( 1, 500 );
               break;
           case AIType.Mad_Bomber:
               if ( IsForReinforcement )
               {
                   if ( !isCore )
                       return 1; //only gets one ship per non-core reinforcement
                   else
                       multiplier = FInt.FromParts( 0, 250 );
               }
               else
                   multiplier = FInt.FromParts( 2, 0 );
               break;
           case AIType.Vicious_Raider:
           case AIType.Technologist_Raider:
               if ( IsForReinforcement )
                   multiplier = FInt.FromParts( 0, 300 );
               else
                   multiplier = FInt.FromParts( 1, 500 );
               break;
           case AIType.Attritioner:
           case AIType.ZenithDescendant:
           case AIType.StarfleetCommander:
           case AIType.Experimentalist:
           case AIType.GravDriller:
               if ( IsForReinforcement )
                   multiplier = FInt.FromParts( 0, 400 );
               else
                   multiplier = FInt.FromParts( 1, 250 );
               break;
           case AIType.The_Tank:
           case AIType.The_Core:
               if ( IsForReinforcement )
                   multiplier = FInt.FromParts( 0, 300 );
               else
                   multiplier = FInt.FromParts( 0, 500 );
               break;
           case AIType.Feeding_Parasite:
           case AIType.Technologist_Parasite:
           case AIType.Bully:
           case AIType.Assassin:
           case AIType.SpeedRacer:
               if ( !IsForReinforcement )
                   multiplier = FInt.FromParts( 1, 250 );
               break;
       }
       int numberOfShips = ( NumberOfShips * multiplier * AILoop.Instance.UnitCapScale.AIShipCountScale ).IntValue;
       if ( numberOfShips < 1 )
           return 1;
       else
           return numberOfShips;
   }

[/code] [/quote]