View Issue Details

IDProjectCategoryLast Update
0019482AI War 2Bug - GameplayMar 14, 2018 4:58 pm
Reporterelcommendante Assigned ToBadgerBadger  
Status closedResolutionfixed 
Product Version0.710 
Fixed in Version0.712 
Summary0019482: Zombified ships fight the allied Dyson Sphere ships
DescriptionShouldn't the two fleets recognize each other as "the friend of a friend is my friend" and not fight, thereby sapping allied resources?
TagsNo tags attached.

Relationships

related to 0019481 closedMichael Zombified ships don't fight the Warden Fleet 
related to 0019483 resolvedkeith.lamothe Zombified AI command 1) should it exist, and 2) is still generating non-zombified AI ships 
related to 0019491 resolvedkeith.lamothe Zombified AI - a neverending story 

Activities

BadgerBadger

Mar 12, 2018 9:50 pm

manager   ~0047131

This is also currently an issue for HRF (the Human Resistance Forces will fight allied Dyson Sphere ships).

I think we need a function like
 AllyMyFactionToThisFaction(Faction alliedFaction)
{
   iterate over all factions. For each faction, if it is Friendly to alliedFaction then make sure you are friendly to it and it is friendly to you
}

Chris/Keith, if you agree then you can throw this bug at me.

Michael

Mar 13, 2018 11:28 am

administrator   ~0047145

Added to Trello card for 19481

Chris_McElligottPark

Mar 14, 2018 12:44 pm

administrator   ~0047163

I agree with that fix, however my only caveat is that we need to be really careful with iterations and the expense that comes with it. So basically if this is called frequently (such as during targeting logic), it's going to potentially cause this to loop millions of times per second. In that sort of case, we'd instead need to have a bool[] FactionsIAmIndirectlyFriendsWith that we simply update once per frame or similar, and then it can just index into that. Something along those lines.

But if the calls to this are infrequent-enough, then an iteration is fine as well as simpler.

Chris_McElligottPark

Mar 14, 2018 12:55 pm

administrator   ~0047164

Scratch that. Keith notes:

Transforming allegiance into a calculated property should not be necessary, and it will likely lead to inconsistent behavior down the road, because then the gamestate will have at least two conflicting answers to the question "am I allied with faction X?"

There are two main things that need to happen:

1) The faction implementation's SetStartingFactionRelationships logic needs to be correct for the initial state of the game.
- I'm guessing this is already true, from what I'm hearing.

2) For factions that need to function as "ally to allies of my ally", etc, in that faction implementation's DoPerSimStepLogic (or potentially DoPerSecondLogic) it should check the relationship between its "parent" faction and each other faction, and if necessary update its allegiance via MakeFriendlyTo/MakeHostileTo/MakeNeutralTo .

With those two things, the normal allegiance checks will return the correct results.

BadgerBadger

Mar 14, 2018 1:42 pm

manager   ~0047165

Yeah, what I was proposing was Keith's option number 2. Won't be done any more often than DoPerSecond

BadgerBadger

Mar 14, 2018 3:10 pm

manager   ~0047172

Any chance you have a save game for this, elcommendante? I have a fix but I'd like to check for sure

elcommendante

Mar 14, 2018 3:11 pm

reporter   ~0047173

Should be in one of the prior issues I filed a day or two ago. May be on .710 so you'll need to convert. Let me know if you find it.

BadgerBadger

Mar 14, 2018 4:58 pm

manager   ~0047178

Shuold be fixed in .712

Issue History

Date Modified Username Field Change
Mar 12, 2018 9:47 pm elcommendante New Issue
Mar 12, 2018 9:50 pm BadgerBadger Note Added: 0047131
Mar 13, 2018 11:27 am Michael Relationship added related to 0019481
Mar 13, 2018 11:28 am Michael Assigned To => keith.lamothe
Mar 13, 2018 11:28 am Michael Status new => assigned
Mar 13, 2018 11:28 am Michael Note Added: 0047145
Mar 13, 2018 11:30 am Michael Relationship added related to 0019483
Mar 14, 2018 10:19 am Michael Relationship added related to 0019491
Mar 14, 2018 12:42 pm Chris_McElligottPark Assigned To keith.lamothe => BadgerBadger
Mar 14, 2018 12:44 pm Chris_McElligottPark Note Added: 0047163
Mar 14, 2018 12:55 pm Chris_McElligottPark Note Added: 0047164
Mar 14, 2018 1:42 pm BadgerBadger Note Added: 0047165
Mar 14, 2018 3:10 pm BadgerBadger Note Added: 0047172
Mar 14, 2018 3:11 pm elcommendante Note Added: 0047173
Mar 14, 2018 4:58 pm BadgerBadger Status assigned => closed
Mar 14, 2018 4:58 pm BadgerBadger Resolution open => fixed
Mar 14, 2018 4:58 pm BadgerBadger Fixed in Version => 0.712
Mar 14, 2018 4:58 pm BadgerBadger Note Added: 0047178