View Issue Details

IDProjectCategoryLast Update
0020891AI War 2[All Projects] Bug - GameplayJan 24, 2019 6:56 am
ReporterRocketAssistedPuffinAssigned ToBadgerBadger 
Severityminor 
Status resolvedResolutionfixed 
Product Version0.810 Brace for Cross Planet Attack 
Fixed in Version0.810 Brace for Cross Planet Attack 
Summary0020891: CPA budget doesn't appear to be spent properly
DescriptionI don't have much right now...just started looking into why CPAs are either tiny or don't seem to exist. The only debug information I've gotten so far is this:

1/20/2019 2:07:05 AM Trying to spend CPA budget of 233992.008789063 at 14403. DoForReal False
1/20/2019 2:07:54 AM Trying to spend CPA budget of 241623.112304688 at 14703. DoForReal True
1/20/2019 2:07:54 AM After launching CPA, my remaining budget is 222351.112304688

What it spent is smaller than what normal waves are right now. There have been reports (and my own experience) of CPAs being...uneventful. Feels like the Reconquest thing again (i.e a large part of AI budget is missing).

Looking at the code doesn't say much...I tried massively increasing the attempts left to place things, with no difference. Only thing seems to be:

while ( factionExternal.StoredStrengthByBudget[AIBudgetType.CPA] > 0 && possibleDeploymentPoints.Count > 0 && attemptsLeft > 0 )

I can only guess it ran out of deployment points? Reads almost like it uses Reinforcement points i.e Guard Posts?

 List<GameEntity_Squad> possibleDeploymentPoints = new List<GameEntity_Squad>();
 faction.Entities.DoForEntities( EntityRollupType.ReinforcementLocations, delegate( GameEntity_Squad entity )

I'll keep trying and just update this as personal notes and in case someone smarter at this thing can figure it out. I have no idea what I can do though - not getting much information.
TagsNo tags attached.

Activities

BadgerBadger

Jan 20, 2019 1:30 am

manager   ~0050722

The code that actually spawns units for a CPA is
            while ( factionExternal.StoredStrengthByBudget[AIBudgetType.CPA] > 0 && possibleDeploymentPoints.Count > 0 && attemptsLeft > 0 )
            {
                GameEntity_Squad entity = possibleDeploymentPoints[Context.RandomToUse.Next( 0, possibleDeploymentPoints.Count )];
                EntityContentsRecord record = entity.Contents[Context.RandomToUse.Next( 0, entity.Contents.Count )];
                if(faction.SpawnNewUnit( Context, entity.Planet, entity.WorldLocation, record.ContainedType, record.ContainedType.MarkFor( faction\
 ), EntityBehaviorType.Attacker_Full, -1, null ) == null) // to have it launch the CPA against something other than the humans, replace that -1 wi\
th the target index
                {
                    attemptsLeft--;
                }
                factionExternal.StoredStrengthByBudget[AIBudgetType.CPA] -= record.ContainedType.MarkStatsFor( faction ).StrengthPerSquad;
                entity.ChangeContents( record.ContainedType, -1 );
                if ( entity.Contents.Count == 0 )
                    possibleDeploymentPoints.Remove( entity );
                launchedSomething = true;
            }

This loop will pick random reinforcement location and will hopefully put new units into it. It's not obvious to me why it should work correctly though.

RocketAssistedPuffin

Jan 20, 2019 5:57 am

developer   ~0050723

Yea I found that. I'll keep poking it...by chance maybe find the solution.

RocketAssistedPuffin

Jan 20, 2019 9:04 am

developer   ~0050724

Last edited: Jan 20, 2019 12:39 pm

View 3 revisions

I *think* I found it...I've attached a log with my own debug lines.

It seems to only spawn one unit for each reinforcement location, then remove it as a possible spawn point. You can see the budget dropping by small amounts, which I've confirmed is the cost of a single fleetship, as well as losing a deployment point, so one point = one ship spawned.

The loop ends when it runs out of deployment points, so if it has 75 points, it can only spawn 75 units.

If this is the problem, I don't know how to fix it.

EDIT: I saw a planet have only the Station left as a reinforcement point, and as expected it spawned a single ship for the CPA. And I'd also note that putting a debug line for the attempts part shows it doesn't seem to decrease it at all - it stays at 100 no matter what happens.



CPADeploymentProblem.txt (15,090 bytes)
1/20/2019 1:48:59 PM	Current directory used: D:/Arcen/AIWar2/
Process Count = 0 so PlayerDataDirectory used: D:/Arcen/AIWar2/PlayerData/
1/20/2019 1:49:00 PM	No resolution change was required.
1/20/2019 1:49:00 PM	Applied graphics settings: 
AntialiasingMode:x2
UseSoftParticles:False
BillboardsFaceCameraPosition:False
AnisotropicMode:ForceEnable
TextureQuality:Full
1/20/2019 1:49:00 PM	Applied Framerate Type: 60 FPS (vsync: 0 targetFPS:60)
1/20/2019 1:49:00 PM	Failed to load GameObject 'assets/arcenui/_customuis/sidebarclosed.prefab' from bundle 'arcenui'
1/20/2019 1:49:04 PM	ArcenAssetBundleCache.InstantiatedObjects: 777
1/20/2019 1:49:04 PM	Game Version: 0.810
graphicsDeviceType in use: OpenGLCore
graphicsDeviceVersion in use: OpenGL 4.5.0 NVIDIA 391.35
graphicsMultiThreaded: False
graphicsShaderLevel: 50
operatingSystem: Windows 8.1  (6.3.0) 64bit
graphicsDeviceName: GeForce GTX 750 Ti/PCIe/SSE2
graphicsDeviceID: 4992
graphicsDeviceVendor: NVIDIA Corporation
graphicsDeviceVendorID: 4318
graphicsDeviceVersion: OpenGL 4.5.0 NVIDIA 391.35
graphicsMemorySize: 1968
maxTextureSize: 16384
npotSupport: Full
processorType: Intel(R) Core(TM) i5-4460 CPU @ 3.20GHz
processorCount: 4
processorFrequency: 3193
systemMemorySize: 8144
supportsImageEffects: True
supportedRenderTargetCount: 8
supportsComputeShaders: True
supportsShadows: True
usesReversedZBuffer: False
1/20/2019 1:49:04 PM	6.4 seconds total load time.

SetDirectoriesToBeUsed (1.2s)
Calculate FInt Sqrt Arrays (0.4s)
LoadFinalSFXStuff (0.3s)
PlanetDefinitionTable (0.3s)
GameEntityTypeDataTable.InitVisualBits (1.6s)
SurrogateTableTable (0.5s)
1/20/2019 1:49:05 PM
Hello Steam user 'RocketAssistedPuffin'

  at System.Environment.get_StackTrace () [0x00000] in <f826c2584fc94ec19a48a6576640bdc5>:0 
  at Arcen.Universal.ArcenDebugging.ArcenDebugLog (System.String Message, Arcen.Universal.DebugLogDestination Destination, System.Boolean IncludeStackTrace, Arcen.Universal.Verbosity Verbosity) [0x00000] in <371fc104c94a4724860239623ea95520>:0 
  at Arcen.Universal.ArcenDebugging.ArcenDebugLog (System.String Message, Arcen.Universal.DebugLogDestination Destination, Arcen.Universal.Verbosity Verbosity) [0x00000] in <371fc104c94a4724860239623ea95520>:0 
  at Arcen.Universal.ArcenDebugging.ArcenDebugLog (System.String Message, Arcen.Universal.Verbosity Verbosity) [0x00000] in <371fc104c94a4724860239623ea95520>:0 
  at ArcenGameController.Update () [0x00000] in <2e2dcd579b104a688d65707e5c206ad7>:0 

1/20/2019 1:49:38 PM	Successfully opened host socket
1/20/2019 1:49:43 PM	Trying to spend CPA budget of 233992.008789063  at 14403. DoForReal False
1/20/2019 1:50:21 PM	Trying to spend CPA budget of 241634.584960938  at 14703. DoForReal True
1/20/2019 1:50:21 PM	This many 75 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241634.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 74 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241626.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 73 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241602.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 72 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241578.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 71 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241573.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 70 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241549.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 69 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241534.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 68 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241495.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 67 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241487.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 66 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241463.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 65 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241424.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 64 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241409.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 63 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241385.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 62 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241361.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 61 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241322.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 60 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241283.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 59 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241268.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 58 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241229.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 57 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241221.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 56 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241182.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 55 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241169.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 54 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241145.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 53 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241137.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 52 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241122.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 51 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241114.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 50 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241109.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 49 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241094.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 48 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241081.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 47 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241066.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 46 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241027.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 45 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 241003.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 44 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240979.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 43 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240940.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 42 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240916.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 41 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240892.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 40 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240853.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 39 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240838.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 38 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240823.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 37 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240808.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 36 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240784.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 35 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240745.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 34 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240740.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 33 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240727.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 32 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240688.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 31 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240673.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 30 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240634.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 29 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240595.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 28 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240556.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 27 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240543.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 26 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240519.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 25 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240495.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 24 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240471.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 23 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240432.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 22 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240408.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 21 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240393.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 20 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240354.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 19 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240315.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 18 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240300.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 17 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240292.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 16 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240268.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 15 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240229.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 14 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240224.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 13 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240200.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 12 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240176.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 11 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240163.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 10 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240155.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 9 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240131.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 8 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240092.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 7 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240053.584960938 after deploying something!
1/20/2019 1:50:21 PM	Entity Count 0! Remove CPA Deployment Point!
1/20/2019 1:50:21 PM	This many 6 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240014.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 5 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 240001.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 4 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 239986.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 3 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 239971.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 2 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 239956.584960938 after deploying something!
1/20/2019 1:50:21 PM	This many 1 possible deployment points!
1/20/2019 1:50:21 PM	This much budget 239932.584960938 after deploying something!
1/20/2019 1:50:21 PM	After launching CPA, my remaining budget is 239927.584960938
1/20/2019 1:50:27 PM	PLAYER DISCONNECTED 0.0.0.0=>0
CPADeploymentProblem.txt (15,090 bytes)

BadgerBadger

Jan 21, 2019 3:34 am

manager   ~0050737

I'll look into it later this week. It seems like this code is just not correctly putting units inside guard posts;

                 if ( entity.Contents.Count == 0 ) <=== this always seems to be 0
                    possibleDeploymentPoints.Remove( entity );

Perhaps there are some assumptions about "units inside units" that are being violated.

BadgerBadger

Jan 23, 2019 11:47 pm

manager   ~0050740

Try replacing the line
                 entity.ChangeContents( record.ContainedType, -1 );
with
                 entity.ChangeContents( record.ContainedType, 1 ); //note the - sign is removed

See what happens

RocketAssistedPuffin

Jan 24, 2019 6:56 am

developer   ~0050741

Tested, confirmed it works. CPA budget is being spent fully, I can see the ships spawn at reinforcement points as expected, then they show all the usual threat behaviours, including things like rushing the station, retreating into other wormholes, etc.

Balance remains to be seen however. I'll look into that today possibly.

Issue History

Date Modified Username Field Change
Jan 19, 2019 9:33 pm RocketAssistedPuffin New Issue
Jan 20, 2019 1:30 am BadgerBadger Note Added: 0050722
Jan 20, 2019 5:57 am RocketAssistedPuffin Note Added: 0050723
Jan 20, 2019 9:04 am RocketAssistedPuffin File Added: CPADeploymentProblem.txt
Jan 20, 2019 9:04 am RocketAssistedPuffin Note Added: 0050724
Jan 20, 2019 9:26 am RocketAssistedPuffin Note Edited: 0050724 View Revisions
Jan 20, 2019 12:39 pm RocketAssistedPuffin Note Edited: 0050724 View Revisions
Jan 21, 2019 3:34 am BadgerBadger Note Added: 0050737
Jan 23, 2019 11:47 pm BadgerBadger Note Added: 0050740
Jan 24, 2019 6:56 am RocketAssistedPuffin Assigned To => BadgerBadger
Jan 24, 2019 6:56 am RocketAssistedPuffin Status new => resolved
Jan 24, 2019 6:56 am RocketAssistedPuffin Resolution open => fixed
Jan 24, 2019 6:56 am RocketAssistedPuffin Fixed in Version => 0.810 Brace for Cross Planet Attack
Jan 24, 2019 6:56 am RocketAssistedPuffin Note Added: 0050741