View Issue Details

IDProjectCategoryLast Update
0023609AI War 2GUIAug 31, 2020 11:19 am
ReporterSigma7 Assigned ToChris_McElligottPark  
Severityminor 
Status resolvedResolutionfixed 
Product Version2.129 No Shrooms For Ships 
Fixed in Version2.130 Redux: Dutch Cities and Softer Eyeballs 
Summary0023609: Journal_TooMuchAIP firing too early
DescriptionThe journal message explaining that it's a gurilla campaign is firing well too early, where the attached save would instead be considered good neutering discipline.

I see the code in AIWarExternalCode\Src\SpecialFactions\Human.cs

        public void Journal_TooMuchAIP( Faction faction, ArcenSimContext Context, ref int planetsOwned )
        {
            /* Warn the player about accruing too much AIP early */

            int planetsOwnedInner = planetsOwned;
            int planetsPaidFor = 0;
            int planetsNeutered = 0;
            World_AIW2.Instance.DoForPlanets( false, delegate ( Planet planet )
            {
                PlanetFaction pFaction = planet.GetPlanetFactionForFaction( faction );
                if ( pFaction.AIPLeftFromControlling == 0 )
                    planetsPaidFor++;
                if ( pFaction.DataByStance[FactionStance.Hostile].TotalStrength <
                     pFaction.DataByStance[FactionStance.Self].TotalStrength + pFaction.DataByStance[FactionStance.Friendly].TotalStrength )
                    planetsNeutered++;
                if ( planet.GetControllingFaction() == faction )
                    planetsOwnedInner++;
                return DelReturn.Continue;
            } );
            planetsOwned = planetsOwnedInner;
            int numForWarning = 4;
            if ( planetsPaidFor > numForWarning &&
                 (planetsNeutered - planetsPaidFor) < 2 )
            {
                World_AIW2.Instance.QueueLogJournalEntryToSidebar( "Beginner_TooMuchAIP", string.Empty, faction, null, null, Context );
            }
        }


I don't see why it would fire this early, considering that it it somehow bypasses the first requirement of needing to conquer enough planets. However, the second requirement also seems rather hypersensitive as it would likely activate when you neuter a planet without keeping a force there.
TagsNo tags attached.

Activities

Sigma7

Aug 29, 2020 2:45 am

reporter  

neuter.save (276,466 bytes)

Chris_McElligottPark

Aug 29, 2020 4:26 pm

administrator   ~0058270

So the number of planets owned is not actually a consideration in here. It's tallying up how many planets you own, but then just passing those back out for use elsewhere.

I am thinking that planetsPaidFor is too high, probably because a bunch of planets have AIPLeftFromControlling == 0 when maybe they should not, I'm not sure.

Badger, you can assign this back to me, but I don't understand at the moment how AIPLeftFromControlling is supposed to work.

Sigma7

Aug 29, 2020 10:13 pm

reporter   ~0058283

Attached log file - it's from a custom build, but shows exactly what's being calculated. Here's the AIP 0 planets from the save, and they're enough to pass the threshold.

1. Tulev. (Human Home planet)
2. Jennisek (Purple AI Home world)
3. Forbus (Captured world)
4. Ahnit (Orange AI Home world)
5. Aldebaran (Neutral, being captured)

Two of those planets are AI owned. So basically a game with four AI players would have the journal fire instantly.

Here's what the save considers neutered:

1. Tulev
2. Forbus

These are only my own systems. What I consider neutered that the algorithm missed (all of which are close enough to human homeworld):

1. Rivest
2. Boehm
3. Sten
4. Lusus
5. Creighton

Thus planetsPaidFor is too high and planetsNeutered is too low. Latter is probably because any AI force brings it above the not-neutered threshold when it probably should check for whether it could launch a counter attack.

Also, I think it's best to also restrict the AIP range it activates on. Maybe 60-300, outside that range it's not helpful (below 60 means player is either starting up or neutering data centers, above 300 means the player has already mastered neutering or is more interested in going for the kill (or perhaps already conquered the galaxy.)
ArcenDebugLog-neuter.txt (6,862 bytes)   
8/29/2020 9:42:06 PM	Current directory used: G:/Games/SteamLibrary/steamapps/common/AI War 2/
Process Count = 0 so PlayerDataDirectory used: G:/Games/SteamLibrary/steamapps/common/AI War 2/PlayerData/
8/29/2020 9:42:06 PM	Boot up FleetOS (0.2849s)
8/29/2020 9:42:06 PM	graphicsDeviceType in use: Direct3D11
graphicsDeviceVersion in use: Direct3D 11.0 [level 11.1]
graphicsMultiThreaded: True
graphicsShaderLevel: 50
operatingSystem: Windows 10  (10.0.0) 64bit
graphicsDeviceName: NVIDIA GeForce GTX 1080
graphicsDeviceID: 7040
graphicsDeviceVendor: NVIDIA
graphicsDeviceVendorID: 4318
graphicsDeviceVersion: Direct3D 11.0 [level 11.1]
graphicsMemorySize: 8079
maxTextureSize: 16384
npotSupport: Full
processorType: Intel(R) Core(TM) i5-7600K CPU @ 3.80GHz
processorCount: 4
processorFrequency: 3792
systemMemorySize: 16348
supportedRenderTargetCount: 8
supportsComputeShaders: True
supportsShadows: True
usesReversedZBuffer: True
8/29/2020 9:42:06 PM	Check System Logs For Rogue Intelligence (0.1606s)
8/29/2020 9:42:06 PM	Game Version: 2.130
8/29/2020 9:42:06 PM	Eject Trash Into Hyperspace (0.0738s)
8/29/2020 9:42:06 PM	Check For Extra Modules (0.0219s)
8/29/2020 9:42:06 PM	Warning: skipped mod "_Vanilla" in XMLLoadingOrder.txt because we couldn't find any mod with that name
8/29/2020 9:42:06 PM	Bring Cloaking Systems Online (0.0279s)
8/29/2020 9:42:06 PM	Recalculate Speed Of Light (0.0180s)
8/29/2020 9:42:06 PM	Optimize Comfort On Command Decks (0.0239s)
8/29/2020 9:42:06 PM	Generating Framerates (0.0160s)
8/29/2020 9:42:06 PM	Expansions:  The Spire Rises (NOT INSTALLED)  Zenith Onslaught (NOT INSTALLED)  
8/29/2020 9:42:06 PM	Mods:  SKCivilianIndustry (Disabled)  SpireRailgunShop (Disabled)  
8/29/2020 9:42:06 PM	Check Nearby Stellar Masses (0.1915s)
8/29/2020 9:42:06 PM	Remembering Alamo (0.0140s)
8/29/2020 9:42:06 PM	Boot Audio Comms (0.0120s)
8/29/2020 9:42:06 PM	Establish Individual Audio Links (0.0219s)
8/29/2020 9:42:06 PM	Prepare Explosions and Crackles (0.0249s)
8/29/2020 9:42:06 PM	No resolution change was required.
8/29/2020 9:42:07 PM	Applied graphics settings: 
AntialiasingMode:x2
UseSoftParticles:False
BillboardsFaceCameraPosition:False
AnisotropicMode:ForceEnable
TextureQuality:Full
8/29/2020 9:42:07 PM	Applied Framerate Type: 120 FPS (vsync: 0 targetFPS:120)
8/29/2020 9:42:07 PM	Refresh Optical Lensing (0.0389s)
8/29/2020 9:42:07 PM	Revise Fundamental Physical Laws (0.0090s)
8/29/2020 9:42:07 PM	Calculate Odds Of Success (0.0339s)
8/29/2020 9:42:07 PM	Briefly Panic (0.2104s)
8/29/2020 9:42:07 PM	Install Confidence Routines (0.2603s)
8/29/2020 9:42:07 PM	Bring Commander Interface Online (0.0997s)
8/29/2020 9:42:07 PM	Motivate All Crews (0.0399s)
8/29/2020 9:42:07 PM	Locating Available Networks (0.0329s)
8/29/2020 9:42:07 PM	Externalizing Patterns (0.0180s)
8/29/2020 9:42:07 PM	Hooking Externals (0.0090s)
8/29/2020 9:42:07 PM	Handlizing Hooks (0.0080s)
8/29/2020 9:42:07 PM	Disengaging Constants (0.0249s)
8/29/2020 9:42:07 PM	Late Axionic Computations (0.1117s)
8/29/2020 9:42:07 PM	Connecting to Fleet Command (0.0150s)
8/29/2020 9:42:07 PM	Thinking Of Advice (0.0110s)
8/29/2020 9:42:07 PM	Degaussing Advice (0.0189s)
8/29/2020 9:42:07 PM	Reading Alien Diaries (0.0120s)
8/29/2020 9:42:07 PM	Naming All Known Planets (0.0090s)
8/29/2020 9:42:07 PM	Remembering Speeds (0.0122s)
8/29/2020 9:42:07 PM	Prioritizing Targets (0.0100s)
8/29/2020 9:42:07 PM	Rebooting Sensor Arrays (0.0080s)
8/29/2020 9:42:07 PM	Unloading Prismatic Grid (0.0090s)
8/29/2020 9:42:07 PM	Thinking Of Objectives (0.0090s)
8/29/2020 9:42:08 PM	Inhibiting Visual Scans (0.0130s)
8/29/2020 9:42:08 PM	Synthesizing Vocals (0.0120s)
8/29/2020 9:42:08 PM	Investigating Map Signatures (0.0120s)
8/29/2020 9:42:08 PM	Ventilating Scenarios (0.0110s)
8/29/2020 9:42:08 PM	Decontaminating Targeting Systems (0.0109s)
8/29/2020 9:42:08 PM	Ejecting Tactical Core (0.0080s)
8/29/2020 9:42:08 PM	Calibrating Formations (0.0090s)
8/29/2020 9:42:08 PM	Intercepting Galactic Maps (0.0091s)
8/29/2020 9:42:08 PM	Discharging Colored Ions (0.0180s)
8/29/2020 9:42:08 PM	Replicating Ion Colors (0.0101s)
8/29/2020 9:42:08 PM	Faction Diagnostics (0.0133s)
8/29/2020 9:42:08 PM	Buffering Hackers (0.0170s)
8/29/2020 9:42:08 PM	Inverting Death (0.0080s)
8/29/2020 9:42:08 PM	Linear Field Variance (0.0100s)
8/29/2020 9:42:08 PM	Charging Marks (0.0100s)
8/29/2020 9:42:08 PM	Guarding The Posts (0.1076s)
8/29/2020 9:42:08 PM	Range Manifolds (0.0199s)
8/29/2020 9:42:08 PM	Purging ROFs (0.0100s)
8/29/2020 9:42:08 PM	Manipulating Speeds (0.0099s)
8/29/2020 9:42:08 PM	Detecting Projectiles (0.0090s)
8/29/2020 9:42:08 PM	Grouping Flow Fields (0.0100s)
8/29/2020 9:42:08 PM	Modulating Flow Field Groups (0.0170s)
8/29/2020 9:42:08 PM	Designing Fleets (0.0151s)
8/29/2020 9:42:08 PM	Thinking Of Technologies (0.0130s)
8/29/2020 9:42:08 PM	Categorizing Starboard Sensors (0.0189s)
8/29/2020 9:42:08 PM	Injecting Galactic Variables (0.0140s)
8/29/2020 9:42:08 PM	Gazing Into Starfields (0.0209s)
8/29/2020 9:42:08 PM	Blowing Up Distant Planets (0.1758s)
8/29/2020 9:42:08 PM	Categorizing All Planets (0.0110s)
8/29/2020 9:42:08 PM	Organizing Commands (0.0150s)
8/29/2020 9:42:08 PM	Calculating Firing Cones (0.0090s)
8/29/2020 9:42:08 PM	Maliciously Weakening Ship Parts (0.3008s)
8/29/2020 9:42:08 PM	Re-Aligning Objectives (0.0199s)
8/29/2020 9:42:08 PM	Sterilizing Test Chamber (0.0140s)
8/29/2020 9:42:11 PM	Disconnect All Space Elevators (2.4802s)
8/29/2020 9:42:11 PM	Issuing Orders (0.0090s)
8/29/2020 9:42:11 PM	Augmenting Infusers (0.0090s)
8/29/2020 9:42:11 PM	Infusing (0.0185s)
8/29/2020 9:42:11 PM	Post-Proton Surge (0.0130s)
8/29/2020 9:42:11 PM	Stimulate Modulation (0.0239s)
8/29/2020 9:42:11 PM	ArcenAssetBundleCache.InstantiatedObjects: 875
8/29/2020 9:42:11 PM	Load Surrogates (0.0891s)
8/29/2020 9:42:12 PM	Final Checks (0.5946s)
8/29/2020 9:42:12 PM	Load Historical Documents (0.0100s)
8/29/2020 9:42:12 PM	6.1 seconds total load time.
Boot up FleetOS (0.3s)
Install Confidence Routines (0.3s)
Maliciously Weakening Ship Parts (0.3s)
Disconnect All Space Elevators (2.5s)
Final Checks (0.6s)
8/29/2020 9:42:12 PM	Hello Steam user 'Sigma 7'
8/29/2020 9:42:15 PM	Start load save: G:/Games/SteamLibrary/steamapps/common/AI War 2/PlayerData/Save/Moderate Security Alert/neuter.save Source1: AnythingElse Source3: LoadingSaveGame
8/29/2020 9:42:15 PM	Finish load save in 308.8ms
8/29/2020 9:42:40 PM	Checking for Too Much AIP
8/29/2020 9:42:40 PM	AIP 0: Tulev Planet #1
8/29/2020 9:42:40 PM	Neutered: Tulev Planet #1
8/29/2020 9:42:40 PM	AIP 0: Jennisek Planet #2
8/29/2020 9:42:40 PM	AIP 0: Forbus Planet #3
8/29/2020 9:42:40 PM	Neutered: Forbus Planet #2
8/29/2020 9:42:40 PM	AIP 0: Ahnit Planet #4
8/29/2020 9:42:40 PM	AIP 0: Aldebaran Planet #5
ArcenDebugLog-neuter.txt (6,862 bytes)   

BadgerBadger

Aug 30, 2020 2:06 am

manager   ~0058284

AIPLeftFromControlling is the AIP price you pay when capturing it. This is for the cases where a minor faction might destroy the commands station, but you then capture it, so you need to pay AIP.

The issue is that I changed all the AI homeworlds to have 0 AIP left from controlling, so they're getting counted. It was requested not to make AI homeworlds charge you AIP when you capture them. So that needs to be factored in

Chris_McElligottPark

Aug 31, 2020 11:18 am

administrator   ~0058316

All right, here's the new code:

        public void Journal_TooMuchAIP( Faction faction, ArcenSimContext Context, ref int planetsOwned )
        {
            /* Warn the player about accruing too much AIP early */

            int planetsOwnedInner = planetsOwned;
            int planetsPaidFor = 0;
            int planetsNeutered = 0;
            World_AIW2.Instance.DoForPlanets( false, delegate ( Planet planet )
            {
                PlanetFaction pFaction = planet.GetPlanetFactionForFaction( faction );
                #region Check For If You Paid AIP For This
                if ( pFaction.AIPLeftFromControlling == 0 )
                {
                    //AI homeworlds never have AIPLeftFromControlling, per notes from Badger
                    if ( planet.PopulationType == PlanetPopulationType.AIHomeworld )
                    {
                        //if an AI homeworld is owned by players, then go ahead and count it
                        Faction aiHomeworldFaction = planet.GetControllingFaction();
                        if ( aiHomeworldFaction != null && aiHomeworldFaction.Type == FactionType.Player )
                            planetsPaidFor++;
                    }
                    else //non-homeworld AI planets can be safely counted
                        planetsPaidFor++;
                }
                #endregion Check For If You Paid AIP For This

                #region Check For Neutered Planets
                //consider planets where we overwhelm the enemy as being neutered, to handle third parties beyond the AI.
                if ( pFaction.DataByStance[FactionStance.Hostile].TotalStrength <
                     pFaction.DataByStance[FactionStance.Self].TotalStrength + pFaction.DataByStance[FactionStance.Friendly].TotalStrength )
                    planetsNeutered++;
                else //not considered neutered by dint of us or allies having overwhelming force there.
                {
                    //check for actual neutering based on guard posts
                    int reinforcementLocationCount = 0;
                    planet.DoForEntities( EntityRollupType.ReinforcementLocations, delegate ( GameEntity_Squad reinforcementPoint )
                    {
                        reinforcementLocationCount++;
                        return DelReturn.Continue;
                    } );
                    //if there are no reinforcement points left, or less than a third of them are left, consider the planet neutered
                    if ( reinforcementLocationCount == 0 || reinforcementLocationCount <= planet.MaxReinforcementPlacesEverSeenHere / 3 )
                        planetsNeutered++;
                }
                #endregion Check For Neutered Planets

                if ( planet.GetControllingFaction() == faction )
                    planetsOwnedInner++;
                return DelReturn.Continue;
            } );
            planetsOwned = planetsOwnedInner;
            int numForWarning = 4;
            if ( planetsPaidFor > numForWarning &&
                 (planetsNeutered - planetsPaidFor) < 2 )
            {
                World_AIW2.Instance.QueueLogJournalEntryToSidebar( "Beginner_TooMuchAIP", string.Empty, faction, null, null, Context );
            }
        }

Chris_McElligottPark

Aug 31, 2020 11:19 am

administrator   ~0058317

Thanks!

* Heavily reworked how Journal_TooMuchAIP calculates both how many planets you have paid AIP for, as well as how many planets are neutered. It was triggering the journal entry far too early, previously.
** Please see the code or here for details: https://bugtracker.arcengames.com/view.php?id=23609

Issue History

Date Modified Username Field Change
Aug 29, 2020 2:45 am Sigma7 New Issue
Aug 29, 2020 2:45 am Sigma7 File Added: neuter.save
Aug 29, 2020 4:26 pm Chris_McElligottPark Assigned To => BadgerBadger
Aug 29, 2020 4:26 pm Chris_McElligottPark Status new => assigned
Aug 29, 2020 4:26 pm Chris_McElligottPark Note Added: 0058270
Aug 29, 2020 10:13 pm Sigma7 File Added: ArcenDebugLog-neuter.txt
Aug 29, 2020 10:13 pm Sigma7 Note Added: 0058283
Aug 30, 2020 2:06 am BadgerBadger Note Added: 0058284
Aug 31, 2020 11:18 am Chris_McElligottPark Note Added: 0058316
Aug 31, 2020 11:19 am Chris_McElligottPark Assigned To BadgerBadger => Chris_McElligottPark
Aug 31, 2020 11:19 am Chris_McElligottPark Status assigned => resolved
Aug 31, 2020 11:19 am Chris_McElligottPark Resolution open => fixed
Aug 31, 2020 11:19 am Chris_McElligottPark Fixed in Version => 2.130 Redux: Dutch Cities and Softer Eyeballs
Aug 31, 2020 11:19 am Chris_McElligottPark Note Added: 0058317