Cross Planet Attacks (CPAs) are time based assaults based on difficulty. AIP is considered but time in game is the primary source of the volume.
Mostly correct: either AIP _OR_ time is factored in, depending on which would create the bigger attack. But never do both impact the size of a single CPA.
The actual math is logged (if advanced logging is on) in LogicLog_AIMechanic_Waves_MainThread when a CPA is initially announced. Look for the string "Triggering CPA" to find that entry as opposed to the normal waves. FWIW, CPAs are actually just special kinds of waves as far as the game is concerned.
Note that the actual number of ships is shifted down according to cap scale.
Also, Core CPA posts use a different formula that doesn't consider game time:
size = 100 * AIDifficulty * Max(1,AIP/50) * (0.67 + (0.33*human_homeworld_count))
CPAs will use x number of ships, ignoring firepower ratings. Should your AI enemies be heavy on low-cap ships you'll see a larger firepower rating from a CPA than if they were using all gatlings.
Yep. Strictly speaking I'd like to change that to consider strength, but then it can't really give you a number of how many ships to expect in the announcement. That might not be the end of the world but I haven't seen enough reason to take that step.
These ships will start being collected at your current mark for AIP, then lower marks, drawing from barracks. Should that be insufficient it will then pull from the strategic reserve for the defenses of the AI HWs at current mark. Should that be insufficient it will then pull from increasingly higher marks (in the order of free -> Barracks -> Reserve) until the # of units is filled.
Not exactly:
It starts on the AI's current tech level, but no higher than:
if ( AIDifficulty < 7) then 2;
else if ( AIDifficulty <
then Max(2,AITechLevel); (smiley unintentional but left as-is because it gets the point across; it's less than 8 )
else 5;
The first thing it does is try to pull half the CPA's population from the strategic reserve. If this would drop the reserve below 50% of max it stops at 50%, so the reserve may not have enough for this, but generally will (particularly if the AI's tech level is 1 or 2).
Then it loops over all planets, and for each one where the humans have fewer than 1/3rd the military ships there than the AI:
- if there's a barracks on the planet, free ships of the target tech level from that barracks until either the CPA is full or the barracks has no more ships of that tech level.
- if there's AI military ships on the planet that:
-- are the target tech level
-- and are guarding something (guard post or command station) OR are in PlanetaryRoamer behavior (old one, not used for much) OR are in SpecialForces behavior
-- and are not a starship or guardian or carrier
-- and are not being protected by an immobile forcefield (note that it's possible a mobile forcefield is passing over them right at that moment and conceivably is the one considered to be giving them protection, so this filter would not apply)
--- then free them until the CPA is full or the planet has no more such ships
- And then it checks the next planet for barracks and then for guard/SF ships, and so on
After that, if the CPA is not full, it decrements the target tech level and loops over the planets again. If the target tech level hits zero it gets set to the starting tech level + 1 and tries again, and instead of decrementing at the end it increments. Once it hits 6 while incrementing it stops this part. Assuming it didn't stop because it had enough ships, of course.
At this point, if the CPA is still not full it does another pull on the strategic reserve for the balance (at the original target tech level), and is willing to leave the reserve bottomed out at 0% if it has to do so.
Strategic Reserve ships will be released from any random warp gate in the galaxy available command center, presumably as close to the player HW as possible. (This particular item is rather annoying...).
Actually it's been tracking where it's pulled all the non-strategic-reserve ships, and spawns the reserve ships on each of those planets in proportion to the percent of non-reserve ships spawned there. So if a given planet is providing 20% of the non-reserve ships, 20% of the reserve ships will spawn there. If it gets to the last planet with any non-reserve spawns it just dumps all the remaining reserve ships there but the percentages should have already worked out elsewhere.
As for spawn point it first looks for an AI command station, and then for a warp gate, and if none of that it just dumps them at point 4000,4000 (not far from the planetary center).
CPA ships are released as a general threat fleet with starting orders. Should they get stymied, they'll attempt to join the existing threatfleet hovering somewhere out there in the galaxy.
I think that first sentence is right but just to be clear: they're released as standard threat (like if they'd been guarding a guard post that you just did a drive-by on). Nothing special after that; they have no memory of being part of a CPA. But yes, like any other threat they go threatfleet after 30 minutes of meditating on the angst of the engineer without a control node (i.e. existing as threat).
Did I miss anything?