View Issue Details

IDProjectCategoryLast Update
0022173AI War 2Bug - GameplayNov 14, 2019 4:18 pm
Reporterwm46 Assigned ToChris_McElligottPark  
Status resolvedResolutionfixed 
Product Version1.007 The Player/AI Arms Race Intensifies 
Fixed in Version1.008 Golems And Arks Come Marching In 
Summary0022173: Coarse background simulation causes engineers (edit: most ships) to not function properly
DescriptionSee video: https://youtu.be/5SAYs0IeUOI

When coarse simulation is on, it seems like AttackerLogic_Assister does not properly run for un-viewed planets. Engineers will never close the distance to damaged or constructing objects to assist them.

Turning coarse simulation off fixes the issue in my simple case of engineers being out of range.

I found the bug while typing this up, here's my quick napkin notes I made for myself:

Current Sim Cycle = CurrentFrame % 10 -> [0,3] ; R < 3 = 0, R < 6 = 1, R < 8 = 2, else =3
Current BG Step = CurrentFrame % 10

VeryFirstSimStepCalculation ( Current BG Step )
    if ( planetIndex % 10 == current BG Step )
        ProcessThisSimStep = true
        deltaTime == nonZero

*Entity Logic*
if ( ProcessThisSimStep ) ; planetIndex % 10 == currentFrame % 10
    DoForEntities( ReevaluateUnitOrders )

*Reevaluate Unit Orders*
if (currentSimCycleSlow == EntitySimCycleGroup)
    Do Logic

Reminder:
currentSimCycleSlow = currentFrame % 10 --> [0,3]
EntitySimCycleGroup = KeyID % 10 --> [0,3]

Logic only gets run if:
currentFrame % 10 == planetIndex % 10, and currentFrame % 10 --> [0,3] == KeyID % 10 --> [0,3]

There's about a 70% chance that the logic will never run for a set of ships on a coarse BG planet, and what had happened to me in my Youtube video is that ALL of my engineers happened to not have their KeyID and PlanetIndex line up ( == no engineer movement, == no passive repairing / constructing )
TagsNo tags attached.

Relationships

related to 0022165 resolvedChris_McElligottPark AI ships break command station under forcefield without damaging forcefield 

Activities

BadgerBadger

Nov 10, 2019 11:27 pm

manager   ~0054492

Great bugfinding.

wm46

Nov 10, 2019 11:27 pm

reporter   ~0054493

It should be noted, it appears that TargetListPlanning and MetalFlowPlanning do not have any restrictions on which ships have their logic runs per frame group, so as long as the ships were in range of something they'd work just fine.

It also seems like the imbalance gives the AI a large buff, since the AI can give direct orders to unviewed planets through their "all in" and "breakthrough" logics on the faction logic threads, while your ships might be dicking around on the corner of the map unable to move into position.

Note: Protection logic planning also requires planetIndex % 10 == currentFrame % 10. There was a bug report that a person's command station was destroyed and the shields left intact. This can happen because shield protections get cleared if there's no AI ships on the planet, leading to structures being technically unprotected even though they are under the shield.

Then when a wave hits: TargetListPlanning runs since there's no restriction on SimGroups. Then CombatStep runs (no restriction on SimGroups), which calls SystemStep (no restriction on SimGroups), which fires at targets in TargetListPlanning. Then since the planet is coarse: 1) the shots insta hit to save time calculating shot movement, resulting in 2) The shots hit before ProtectionPlanning even runs and shields the command station. This will only happen if the command station is within firing distance of the entrance wormhole (which is always the case for snipers).

Chris_McElligottPark

Nov 14, 2019 4:13 pm

administrator   ~0054563

Thank you!

Fix 1:

* Fixed an issue in the ReevaluateUnitOrders code that would sometimes have background-coarse planets not run the logic for their ships at all. Now those ships only use the secondary "SimCycleGroup_Slow" logic if this is on a "tier 1" planet that gets processed every frame.
** The intent of the sim frame processing was to split it out across multiple frames, which works great on those tier 1 planets, but for planets that are already being split across multiple frames it could mean that their ships might not get new orders ever until the player visited the planet. This could greatly nerf engineers, for example.

Chris_McElligottPark

Nov 14, 2019 4:18 pm

administrator   ~0054565

Thanks!

Fix 2:

* The forcefield protection planning was being run only intermittently on tier 2 planets, which include player forces that are not being monitored right now. Now it ONLY runs those intermittently on tier 3 planets (no players), and runs them continuously otherwise, so as to never run into cases where enemies could get off a few shots at something of a player that was being protected by a forcefield.

Issue History

Date Modified Username Field Change
Nov 10, 2019 10:50 pm wm46 New Issue
Nov 10, 2019 10:51 pm wm46 Description Updated
Nov 10, 2019 11:27 pm BadgerBadger Note Added: 0054492
Nov 10, 2019 11:27 pm BadgerBadger Assigned To => Chris_McElligottPark
Nov 10, 2019 11:27 pm BadgerBadger Status new => assigned
Nov 10, 2019 11:27 pm wm46 Note Added: 0054493
Nov 10, 2019 11:28 pm wm46 Relationship added related to 0022165
Nov 14, 2019 4:13 pm Chris_McElligottPark Note Added: 0054563
Nov 14, 2019 4:18 pm Chris_McElligottPark Status assigned => resolved
Nov 14, 2019 4:18 pm Chris_McElligottPark Resolution open => fixed
Nov 14, 2019 4:18 pm Chris_McElligottPark Fixed in Version => 1.008 Golems And Arks Come Marching In
Nov 14, 2019 4:18 pm Chris_McElligottPark Note Added: 0054565