View Issue Details

IDProjectCategoryLast Update
0020810AI War 2Bug - GameplayApr 22, 2019 11:45 am
Reporterwm46 Assigned ToChris_McElligottPark  
Status resolvedResolutionfixed 
Product Version0.807 Cyber Command 
Fixed in VersionBETA 0.853 An Officer And A Bunch Of Fleets 
Summary0020810: Minor Faction AIP applies to player when spawning instigators
DescriptionHad a game with Nanocaust present, was doing deep strikes after taking my first planet for metal generation. The first instigator base spawns and it was 4 hops away at only 30 AIP?

Ended up losing just because it was the base that spawns 1 strength of guardians every 20 seconds, it spawned behind a planet with a Fortress, so by the time I got there it had over 200 guardians (and that was with me cheating and using "give metal")
TagsNo tags attached.

Activities

wm46

Mar 22, 2019 6:24 am

reporter   ~0051033

I had a large post ready to go and explain how I found things, but then I got a token error and it disappeared...

The jist of the issue, the instigator base script is exclusive rather than inclusive at the minimum. Below 150 AIP it tries to search a range of [2,2], but because of the way things work out, it searches (2,2] which will never have any results. This means the script then retries with a range of (1,3], leading to an effective search range of [2,3] when below 150 AIP, a range of [4,4] from 150 to 300, and a range of [6, inf] past that.

Proposed solution, subtract 1 from the min range before feeding it to the XHopsFromPlanet method:

                    if(minHopsFromHumanPlanet > 1)
                    {
                        //this planet must not be too close to a player planet
                        bool foundPlayerPlanetWithinMinHops = false;
                        planet.DoForPlanetsWithinXHops( Context, minHopsFromHumanPlanet - 1,
                                                        delegate (Planet otherPlanet, int distance )
                                                        {
                                                            if(otherPlanet.GetControllingFaction().Type == FactionType.Player)
                                                                foundPlayerPlanetWithinMinHops = true;
                                                            return DelReturn.Continue;
                                                        } );
                        if(foundPlayerPlanetWithinMinHops)
                            continue;

You should also change the criteria for checking the minimum hops from "MinHops > 0" to "MinHops > 1", because every planet is at least 1 hop away from another planet.

wm46

Apr 20, 2019 10:20 pm

reporter   ~0051250

I want to bump this, as its still a problem in the new version. The fix should still work

wm46

Apr 21, 2019 10:05 pm

reporter   ~0051255

I would submit this as a commit to the repository, but I realized that in the current game version you are checking (2,3], meaning you always place the instigator base 3 hops away. Is this intended?

Chris_McElligottPark

Apr 22, 2019 9:24 am

administrator   ~0051260

I don't think that's intended, and please feel free to commit the fix. :)

wm46

Apr 22, 2019 11:33 am

reporter   ~0051272

Done, revision 0005170

Chris_McElligottPark

Apr 22, 2019 11:45 am

administrator   ~0051275

* Instigator bases should now seed at more appropriate distances from you.
** Thanks to WeaponMaster for finding and fixing, and reporting.

Thanks!

Issue History

Date Modified Username Field Change
Nov 30, 2018 5:33 pm wm46 New Issue
Dec 3, 2018 10:54 am Michael Assigned To => Chris_McElligottPark
Dec 3, 2018 10:54 am Michael Status new => acknowledged
Mar 22, 2019 6:24 am wm46 Note Added: 0051033
Apr 20, 2019 10:20 pm wm46 Note Added: 0051250
Apr 21, 2019 10:05 pm wm46 Note Added: 0051255
Apr 22, 2019 9:24 am Chris_McElligottPark Note Added: 0051260
Apr 22, 2019 11:33 am wm46 Note Added: 0051272
Apr 22, 2019 11:45 am Chris_McElligottPark Status acknowledged => resolved
Apr 22, 2019 11:45 am Chris_McElligottPark Resolution open => fixed
Apr 22, 2019 11:45 am Chris_McElligottPark Fixed in Version => BETA 0.853 An Officer And A Bunch Of Fleets
Apr 22, 2019 11:45 am Chris_McElligottPark Note Added: 0051275