View Issue Details

IDProjectCategoryLast Update
0023849AI War 2Balance IssueOct 1, 2020 6:50 pm
ReporterTechSY730 Assigned ToChris_McElligottPark  
Status resolvedResolutionfixed 
Product Version2.603 Nanocaust And Civvies Strike Back 
Fixed in Version2.604 A Thousand Screaming Idiots 
Summary0023849: AIs difficulty 8 or 9 and up should be underconfident in their fleet strength at least a little
DescriptionThe minimum overconfidence the AI seems to have is 1.0, meaning they will at least wait until their strength matches the planet before attacking.

However, in classic, IIRC, higher level AIs (not sure when it started exactly) started underestimating their strength.

This gave the AI "wiggle room" for cases such as:
 - The strength formula failed to be a good predictor of battle outcome
 - The human shows up with last minute fleet reinforcements that were originally too far away to be picked up in the planet strength check

Now it shouldn't be by very much. We don't want the AI to sit around too patiently on their planets for a human to come around and clean them up.
Maybe at max at difficulty ten overconfidence can be like 0.9, and scale from whenever you want that start point for this to be.
TagsNo tags attached.

Activities

Chris_McElligottPark

Oct 1, 2020 3:19 pm

administrator   ~0058855

So the way it is right now, it works the opposite of classic. It is multiplying its own estimation of its forces by the overconfidence_ratio. For low difficulties, that goes as high as 5, but as low as 2.0 on difficulty 6. I'll make some more adjustments here, this is a good idea.

Chris_McElligottPark

Oct 1, 2020 3:22 pm

administrator   ~0058856

Thanks!

* The "overconfidence ratio" of the AI is something that has it overestimate the competence of its own forces and charge in in various situations where the strength values are not exactly equal-or-in-its-favor.
** For difficulty 6, the value has long been 2.0. For all other difficulties above that, it has been 1.0.
** For difficulty 7, the value is now 1.5.
** For difficulties 8 and 9, the value is now 1.3.
** For difficulty 10, the value is now 1.1.
** It has been pointed out to us that not all strength is equal, and leaving some margin for error in there to account for potentially strengths and weaknesses playing a bigger role is a good idea.

TechSY730

Oct 1, 2020 3:26 pm

reporter   ~0058857

I'm a little confused about how the "overconfidence ratio" works? Does 2.0 mean "strength as is" and values less then 2 mean underconfident?

TechSY730

Oct 1, 2020 3:28 pm

reporter   ~0058858

Nevermind, didn't see your first post there

TechSY730

Oct 1, 2020 3:29 pm

reporter   ~0058859

So does this mean difficulty 10 is actually a bit overconfident now? Since it is greater then 1?

BadgerBadger

Oct 1, 2020 3:31 pm

manager   ~0058860

I think this change does the opposite of what the bug report was requesting.

Also note this setting is Only for regular AI threat. Hunter/Warden use different logic.

RocketAssistedPuffin

Oct 1, 2020 3:33 pm

reporter   ~0058861

I might be confused, but that seems...backwards?

If I have 100 Strength on a planet, and a Difficulty 7 AI has 67 Strength:

Then if I read it correctly, the Difficulty 7 AI will "overestimate" it's power, multiply that by 1.5, see it's equal to the target planet, then attack.

Doesn't that mean the difficulty with most of its intelligence showing would make odd offenses?

TechSY730

Oct 1, 2020 3:38 pm

reporter   ~0058862

Yeah. If this is a multiplier to it's _own_ strength computation, then it should be less then 1.0 for higher difficulties to make them underconfident and bank up more.

Chris_McElligottPark

Oct 1, 2020 3:40 pm

administrator   ~0058863

So this is from the perspective of the AI, remember.

Basically the logic is, if I'm reading it correctly, the AI thinks as follows:

1. "I" have 100 strength of units here.
2. However, my overconfidence is 1.5, so we'll call that 150 strength that I have.
3. "All my enemies" have 140 strength. I look at that literally, not through any extra lens.
4. So I will compare my "150" of strength to my enemies' strength of 140, and make decisions that lead me to think I'm going to win.

And... I realize that I am indeed reading it backwards in what TechSY730 was saying. He was requesting this, if I understand correctly now:

1. "I" have 100 strength of units here.
2. However, my overconfidence is 0.9, so we'll call that 90 strength that I have.
3. "All my enemies" have 140 strength. I look at that literally, not through any extra lens.
4. So I will compare my "90" of strength to my enemies' strength of 140, and make decisions that lead me to think I'm going to lose, so I wait.

I will change accordingly. Reading fail!

RocketAssistedPuffin

Oct 1, 2020 3:43 pm

reporter   ~0058864

About the strength. I wonder if part of it is maybe the damage bonuses from a Military for example. If all your units have 50% more damage, then it's as if all enemy forces have started the battle with 33% of their health missing.

(To give a simple example of that math, if I did 10 DPS, and the target had 150 HP, then I kill it in 15s. If I did 15 DPS (50% increase), then I kill it in 10s. 10 is 66% of 15, so it's like it loses 33% of total health at the very start).

That loss of health then means each unit does less damage, as it dies earlier. Then you have the range advantage, where you get essentially "free damage" to the approaching enemy before they get in range, and you then have each sides health and damage output properly fighting.

This being the little formula I have for it:

Damage Advantage = ( ( Defender Range - Attacker Range ) / ( Attacker Speed - Defender Speed ) ) * Defender DPS

Defender being the longer range unit.

So...damage bonuses removing a lot of health from the attacking force, plus range advantage, plus the fact the automatic strength calculation apparently really values more health compared to more damage, would I think result in...something that's 1.5x the strength of the planet being attacked, kind of being reduced to effectively something much lower, passively.

If a 50% damage boost reduces enemies effective health by 33%, then affects their total damage output because of that...then a force of strength 1.5x that of the target might actually result in its..."effective" strength being lower than the planet, causing these results.#

Lastly, there's the fact not many units get a bonus against Turrets, on purpose. I had multiplied the strength of units with a damage bonus to try to include the effects of that, but if defending a planet, the AI force will most likely not get to use them, so it's a little bit inflated there too.

I hope that makes sense. It's...strange to try to explain it.

Chris_McElligottPark

Oct 1, 2020 3:43 pm

administrator   ~0058865

Rewritten based on Badger's notes as well:

* The "overconfidence ratio" of the AI is something that has it overestimate the competence of its own forces and charge in in various situations where the strength values are not exactly equal-or-in-its-favor.
** For difficulty 6, the value has long been 2.0. For all other difficulties above that, it has been 1.0.
** For difficulties 8 and above, the value is now 0.9.
** It has been pointed out to us that not all strength is equal, and leaving some margin for error in there to account for potentially strengths and weaknesses playing a bigger role is a good idea. Let's really make sure the AI is going to smash them.
** Bear in mind that this only applies to the regular threat controlled by the sentinels, and the hunters and warden use their own separate logic.

Chris_McElligottPark

Oct 1, 2020 3:44 pm

administrator   ~0058866

I think that the strength values get updated dynamically to account for extra damage, but they don't for range. And there may be some damage areas where I missed having it buff the strength, I'm not sure.

Chris_McElligottPark

Oct 1, 2020 4:10 pm

administrator   ~0058869

Related, this should up the intelligence a lot:

* In external constants, there is a new field called strength_multiplier_for_turrets. It is by default now 2.
** This basically makes the apparent strength of all turrets twice what they have previously been estimated to be. Turrets are observed to have a number of advantages when absolutely wrecking enemies, so this should more accurately reflect reality. We look forward to future suggestions on more accurate numbers here.
** Individual turrets are still able to have their own strength_multiplier, and this is still added in for those on top of the general turret bonus.

RocketAssistedPuffin

Oct 1, 2020 4:53 pm

reporter   ~0058876

I tested a Military Command Station on a planet with 60 Strength worth of Defenses in CF. Said Station was temporarily modified to have as low stats as possible so it would never affect the value.

Swapping between Station types, the Strength value never changed.
Upgrading it to MK5 never changed.
Saving then loading with a MK5 never changed.

RocketAssistedPuffin

Oct 1, 2020 5:08 pm

reporter   ~0058879

Confirmed it occurs in vanilla too. The only Strength difference is from the Station itself.

BadgerBadger

Oct 1, 2020 5:37 pm

manager   ~0058880

You mean the firepower increase from a military command station isn't reflected in the strength of the unit?

RocketAssistedPuffin

Oct 1, 2020 6:29 pm

reporter   ~0058885

Yes. No unit affected by it changes its strength.

BadgerBadger

Oct 1, 2020 6:50 pm

manager   ~0058886

Puffin, can you open the "Strength calculations don't include military command stations" problem separately? Note that EntitySystemTypeData.cs:CalculateDamageMultiplierForIndividualShip() seems like the right place to put that check, though giving it reasonable performance might be problematic.

Issue History

Date Modified Username Field Change
Oct 1, 2020 3:14 pm TechSY730 New Issue
Oct 1, 2020 3:19 pm Chris_McElligottPark Note Added: 0058855
Oct 1, 2020 3:22 pm Chris_McElligottPark Assigned To => Chris_McElligottPark
Oct 1, 2020 3:22 pm Chris_McElligottPark Status new => resolved
Oct 1, 2020 3:22 pm Chris_McElligottPark Resolution open => fixed
Oct 1, 2020 3:22 pm Chris_McElligottPark Fixed in Version => 2.604 A Thousand Screaming Idiots
Oct 1, 2020 3:22 pm Chris_McElligottPark Note Added: 0058856
Oct 1, 2020 3:26 pm TechSY730 Note Added: 0058857
Oct 1, 2020 3:28 pm TechSY730 Note Added: 0058858
Oct 1, 2020 3:29 pm TechSY730 Note Added: 0058859
Oct 1, 2020 3:31 pm BadgerBadger Note Added: 0058860
Oct 1, 2020 3:33 pm RocketAssistedPuffin Note Added: 0058861
Oct 1, 2020 3:38 pm TechSY730 Note Added: 0058862
Oct 1, 2020 3:40 pm Chris_McElligottPark Note Added: 0058863
Oct 1, 2020 3:43 pm RocketAssistedPuffin Note Added: 0058864
Oct 1, 2020 3:43 pm Chris_McElligottPark Note Added: 0058865
Oct 1, 2020 3:44 pm Chris_McElligottPark Note Added: 0058866
Oct 1, 2020 4:10 pm Chris_McElligottPark Note Added: 0058869
Oct 1, 2020 4:53 pm RocketAssistedPuffin Note Added: 0058876
Oct 1, 2020 5:08 pm RocketAssistedPuffin Note Added: 0058879
Oct 1, 2020 5:37 pm BadgerBadger Note Added: 0058880
Oct 1, 2020 6:29 pm RocketAssistedPuffin Note Added: 0058885
Oct 1, 2020 6:50 pm BadgerBadger Note Added: 0058886