Author Topic: Seeking detailed reprisal mechanics  (Read 2264 times)

Offline Traveller

  • Jr. Member Mark III
  • **
  • Posts: 96
Seeking detailed reprisal mechanics
« on: April 26, 2015, 02:51:03 pm »
Tried a few topics and couldn't quite find an answer here...the reprisal waves seem a little confusing to me in the way they change over time.

So, the way I understand from the game and the wiki is that are you lose their ships on an AI controlled planet, their value in metal is added to that player's reprisal bank, and after an amount of time, they drop a wave on you that's some kind of exponential scale.  Maybe it's based on the log of your metal lost, or maybe it's linear on your metal lost, I can't tell.

But what really has me confused is...it seems like the coefficient for reprisal added by player losses drops over time.  That is, if early game losing 100k metal would trigger reprisal 1, then later game you need to lose 400k metal...or something.  Is this true?  What are the mechanics?  Does it divide your losses by AI progress, calculate reprisal level, then multiply reprisal level to get the force it attacks you with?  Or does losing the same amount of metal always increment the behind-the-scenes reprisal in the same way, but the threshold of how much reprisal score is worth calling "reprisal 1" is higher?

Is the reprisal value linear with player value lost, or is it a log?  If losing 100k is reprisal 1, then is 400k reprisal 4 (because it's four times the metal) or is it reprisal 3 (because it's 100 * 2^2 the metal)?  If it's a log, then the AI doesn't actually get exponential resources, it just means that they get to wind up harder before kicking you.  I feel like it's linear, but maybe there's still some log component there.

Is the reprisal value calculated as a decimal...if you've earned reprisal 1.4, does it send a bigger wave than reprisal 1, and still only display reprisal 1?

If you don't take any losses in a while, and you haven't yet earned reprisal 1 (which commits the AI to attacking), does it drop back to 0 over time?


Anyway, the motivation here is that I'm currently playing a game using bombards, playing against astro trains, in a map with a lot of wormholes.  Until I got used to hiding them out of the way or in transports, they got stolen by tractors...a lot...and I didn't always catch them before they got yanked offworld.  It seemed like early game, if an astro train stole a full cap of I-III bombards and I didn't notice in time to scrap them, it was game over: the AI would hit me with reprisal 5, and I'd die under the weight of a couple thousand missile frigates.  But late game I can obviously lose a lot more materiel and I don't even hit reprisal 1.  I'd love to know what the mechanics are in more detail.

(Does scrapping increase the reprisal level?  I've been doing it in hopes that I could dodge the reprisal but I don't know if it's working.)

Offline Toranth

  • Hero Member Mark III
  • *****
  • Posts: 1,244
Re: Seeking detailed reprisal mechanics
« Reply #1 on: April 26, 2015, 05:51:36 pm »
Tried a few topics and couldn't quite find an answer here...the reprisal waves seem a little confusing to me in the way they change over time.

So, the way I understand from the game and the wiki is that are you lose their ships on an AI controlled planet, their value in metal is added to that player's reprisal bank, and after an amount of time, they drop a wave on you that's some kind of exponential scale.  Maybe it's based on the log of your metal lost, or maybe it's linear on your metal lost, I can't tell.

But what really has me confused is...it seems like the coefficient for reprisal added by player losses drops over time.  That is, if early game losing 100k metal would trigger reprisal 1, then later game you need to lose 400k metal...or something.  Is this true?  What are the mechanics?  Does it divide your losses by AI progress, calculate reprisal level, then multiply reprisal level to get the force it attacks you with?  Or does losing the same amount of metal always increment the behind-the-scenes reprisal in the same way, but the threshold of how much reprisal score is worth calling "reprisal 1" is higher?

Is the reprisal value linear with player value lost, or is it a log?  If losing 100k is reprisal 1, then is 400k reprisal 4 (because it's four times the metal) or is it reprisal 3 (because it's 100 * 2^2 the metal)?  If it's a log, then the AI doesn't actually get exponential resources, it just means that they get to wind up harder before kicking you.  I feel like it's linear, but maybe there's still some log component there.

Is the reprisal value calculated as a decimal...if you've earned reprisal 1.4, does it send a bigger wave than reprisal 1, and still only display reprisal 1?

If you don't take any losses in a while, and you haven't yet earned reprisal 1 (which commits the AI to attacking), does it drop back to 0 over time?


Anyway, the motivation here is that I'm currently playing a game using bombards, playing against astro trains, in a map with a lot of wormholes.  Until I got used to hiding them out of the way or in transports, they got stolen by tractors...a lot...and I didn't always catch them before they got yanked offworld.  It seemed like early game, if an astro train stole a full cap of I-III bombards and I didn't notice in time to scrap them, it was game over: the AI would hit me with reprisal 5, and I'd die under the weight of a couple thousand missile frigates.  But late game I can obviously lose a lot more materiel and I don't even hit reprisal 1.  I'd love to know what the mechanics are in more detail.

(Does scrapping increase the reprisal level?  I've been doing it in hopes that I could dodge the reprisal but I don't know if it's working.)
Yes, scrapping a unit in AI territory counts as destroying it, so the AI gets the salvage.  No cheesy escapes there.
No, hiding and waiting does not cause the AI salvage totals to shrink.  The AI will always be there, waiting, to recycle your garbage into a newer, more explosive, form.

Now, as to the size changing, that's because the reprisal wave is based on the normal wave size.  So as time and AIP go up, the normal wave size increases, and the minimum size of the reprisal wave increases.  So losing a cap of Mk I triangle ships early on at AIP 10 might trigger a reprisal wave, but late in the game at AIP 400, it wouldn't even come close.

Whenever the reprisal wave launches, it uses up the entire accumulated mass of salvage.  This means that the strength of the resulting reprisal wave is linear between levels - As you put it, if you've earned reprisal 1.4, you get 40% above the minimum reprisal level 1 added on towards reprisal level 2.  Note that the informational alert is just that - informational.  The actual strength of the wave depends purely on the total amount of Metal salvage the AI player has accumulated, and is thus purely linear.

Most of the salvage rules are in the 7.xxx release notes, but I'll try to summarize here.

On the AI side:
1)  When you lose units in AI controlled systems, the AI acquires salvage equal to the Metal value of the lost unit, multiplied by a difficult-based "salvage efficiency" factor.  This ranges from 35% at Diff 7 or less, up to 100% at Diff 10.
2)  Some special units with extremely high costs, such as Golems or Mercenaries, give lower salvage rates.
3)  Each AI player has its own salvage pool.  Units lost in an AI system give salvage only to the AI player controlling that system.
4)  Every 3 game minutes, each AI checks to see if it has accumulated enough salvage to launch a reprisal wave.  If it has, it will immediately consume all accumulated salvage and create a wave to attack the human player.
5)  Reprisal waves are treated identically to normal waves, with one major exception: AI types that get bonus units in waves (Spire Hammer, Support Corps) do NOT get those bonus units added to reprisal waves.
6)  The reprisal wave size has a minimum of 1.5 times the normal waves size for the given time and AIP at that point of the game.
7)  The reprisal wave is created by transforming the salvaged Metal total into a strength budget, based on how many Mk I Bombers the salvaged metal could produce.  On normal/normal game modes, this is 1600 Metal per Bomber, and 2 strength per Bomber.  So a salvage total of 32,000 Metal would be equal to 20 Bombers or 40 strength. 
8)  When an AI has accumulated enough salvage to produce a reprisal wave, a warning will appear in the upper left hand corner of the player's screen.  The warning will indicated the expected level of the reprisal wave, using the term "Reprisal Level".
9)  The "Reprisal Level" alert rounds down - a Level 1 alert may actually be as weak as the minimum strength or as strong as just shy of Level 2.
10)**  Here's the one I am not certain of:  "Reprisal Levels" may be multiplicative or additive.  Aka, Level 1 = 1.5x, Level 2 = 3x, level 3 = 4.5x, etc OR Level 2 = 2.25x, level 3 = 3.375x, etc.  This doesn't change the actual strength of the wave, just the level that the warning appears at.  Does anyone know which is the case?


Here's a excerpt from the logs of a game played a little while back.
Spoiler for Hiden:
Code: [Select]
Salvage-Reprisal Wave Check; Current Game Time: 4:29:18
= Salvage is non-zero, so checking if player 9's AISalvage is high enough for a salvage-reprisal wave
AISalvage: 521708
effectiveMetalForSalvageWave = floor(AISalvage) = 521708
referenceMetalCost = (metal cost of a mkI bomber in this game) = 1600
referenceStrength = (strength of a mkI bomber in this game) = 2
metalToStrengthRatio = referenceStrength / referenceMetalCost = 0.00122
= potentialSalvageStrength = effectiveMetalForSalvageWave * metalToStrengthRatio = 636.85
computing strength budget of a normal wave for threshold check

FleetShipBudget = (base value, equivalent to a single mkI fighter on high caps) = 1
FleetShipBudget *= this.AITechLevel = 1
FleetShipBudget *= (FInt)Game.Instance.Options.TotalHumanPlayerPlusExtraHomeworldsCount = 1
FleetShipBudget *= this.AIProgressionLevelEffective = 10
FleetShipBudget *= player.GetHandicapMultiplier() = 10
preMinStep_DifficultyMultiplier = player.AIDifficulty / ( 13 - player.AIDifficulty ) = 2.25
FleetShipBudget *= preMinStep_DifficultyMultiplier = 22.5
FleetShipBudget less than minimum strength (which is 34 * player.GetHandicapMultiplier()), so set to 34
FleetShipBudget *= player.AITypeData.WaveSizeMultiplier = 34
postMinStep_DifficultyMultiplier = player.GetDifficultySpecificWaveSizeMultiplier() = 6
FleetShipBudget *= postMinStep_DifficultyMultiplier = 204
= Enough salvage strength to launch a salvage-reprisal, so calling TriggerNormalWave with OverrideStrength = 636.85
You can see how it computed the strength budget, determine it was large enough, then just created a wave like normal using that strength budget.  For what it is worth, this was at AIP 10 diff 9 - normal wave size was around 400 strength, this one was about 650, so it was close to the minimum reprisal wave size.

Offline Pumpkin

  • Hero Member Mark III
  • *****
  • Posts: 1,201
  • Neinzul Gardener Enclave
Re: Seeking detailed reprisal mechanics
« Reply #2 on: April 26, 2015, 06:58:29 pm »
@Toranth
 :o
May you?
Please excuse my english: I'm not a native speaker. Don't hesitate to correct me.

Offline Red.Queen

  • Full Member Mark II
  • ***
  • Posts: 191
  • Mad Hacker
Re: Seeking detailed reprisal mechanics
« Reply #3 on: April 26, 2015, 07:11:14 pm »
Excellent answer, Toranth, that cleared up several questions I had in the back of my mind.
Infiltrating hostile AI networks to rewrite reality.

[[Hacks available from this unit found on the AI War Modding subforum.]]

Offline Traveller

  • Jr. Member Mark III
  • **
  • Posts: 96
Re: Seeking detailed reprisal mechanics
« Reply #4 on: April 26, 2015, 11:58:22 pm »
Hmm, okay.  So what it sounds like is, the only reason I got wasted so bad when I lost all those bombards...is because they really just are a massive metal sink and you can buy one hell of a lot of Mk.I missile frigates for that.  The AI doesn't get extra metal when you lose a lot of things at once, and the only advantage is that it can throw it at you in one wave instead of many.  That changes my strategy a lot re: suicide attacks.

Thanks!

Offline Tolc

  • Full Member Mark II
  • ***
  • Posts: 161
Re: Seeking detailed reprisal mechanics
« Reply #5 on: April 27, 2015, 10:57:31 am »
Really useful info, Toranth, thank you! That explains why my brute force AI home world attack yesterday got me a level 4 reprisal wave that wiped out one planet after the other...it wasn't pretty to look at.