View Issue Details

IDProjectCategoryLast Update
0021368AI War 2[All Projects] Bug - GameplayJul 12, 2019 12:43 pm
Reporterwm46Assigned Tox4000Bughunter 
Severityminor 
Status resolvedResolutionfixed 
Product Version0.873 Battlestation Overhaul 
Fixed in Version0.875 Counterattacks You Can Taste 
Summary0021368: AI Sending 0 Strength waves, leading to massive waves later
DescriptionI put on wave tracing, but it doesn't seem to help identify the problem. Attached are a save after a zero strength wave was sent, an autosave before then, and the log (which also includes zero strength waves against nanocaust).
TagsNo tags attached.

Activities

wm46

Jul 9, 2019 2:38 pm

reporter  

Autosave.900.save (582,882 bytes)
AfterWaveo.save (688,105 bytes)
ArcenDebugLog.txt (588,316 bytes)

wm46

Jul 9, 2019 4:05 pm

reporter   ~0052134

Added more debugging to the wave planner, found a bit more interesting info:

WAVE 1:

AI spending 10589.009765625 on Wave at 1804. Next spend attempt at 2404
 Planning a wave with budget 10589 isReconquestWave: False targetFaction: default requiredWaveToDefenseRatio: 0.5
Finding wave composition
getWaveComposition: budget: 10589 no ships specified, and 3 different ship types desired, ShipGroupCat = RoyalWaves
ShipGroup chosen from ship group category is: RoyalAttritionerGuardians
getWaveComposition: Adding RoyalFortifiedTeslaGuardian as a build choice for the incoming fleet. AI cost: 450 strength 441. We have now chosen 1 of our max of 3 different ship types
getWaveComposition: Adding RoyalGrenadeLauncherGuardian as a build choice for the incoming fleet. AI cost: 450 strength 524. We have now chosen 2 of our max of 3 different ship types
Current bag is empty, breaking out of ship picking loop
Sending wave with budget 10589 and approx strength 4052 at 2404 (interval 600 current time 1804) and gving 480 seconds of advanced warning

WAVE 2:

ChooseWaveTarget: warp gate planet Grove target planet DongarraDetermine wave type
getWaveComposition: budget: 3473 no ships specified, and 2 different ship types desired, ShipGroupCat = RoyalWaves
ShipGroup chosen from ship group category is: RoyalAttritionerGuardians
Current bag is empty, breaking out of ship picking loop
Planned wave: <color=#CC5500>AI (Royal) Wave </color> with. Wave budget 0. spawning on <color=#A1A1A1>Dongarra</color> from warp gate on <color=#CC5500>Grove</color> in 10m 0s This wave is against Nanocaust. advance warning to give 480. ai cost budget of wave 0

Both of these use the ShipGroup "RoyalAttritionerGuardians". but the second time it tries to pick from it it was empty. I made sure to add a tracing buffer if it detects that the ship group was null and didn't copy to the temporary drawbag.

wm46

Jul 9, 2019 4:11 pm

reporter   ~0052135

Actually, on a second look through the code I understand what is happening. Even though the Royal AI type is supposed to use lots of guardians in their waves, the Royal guardians are still bound by the wave planning max guardian types. This means that even if a wave is supposed to have 2 unit types, the max guardians of that wave is ( 2 / 3 = 0 ), and so if a Royal bucket is chosen the wave will be empty.

This also means for most Royal waves, the max unit types will be 2, because that's the maximum amount of guardians a wave can have.

wm46

Jul 9, 2019 4:14 pm

reporter   ~0052137

There's also a bug in the limiter for guardians in a wave:

                        if ( numGuardianTypesUsed > maxGuardianTypes || maxGuardianTypes == 0 )
                            continue;

Using > instead of >= means that for maxGuardianTypes = 1, there can actually be 2 guardians added to the wave before it starts preventing guardians from being added.

RocketAssistedPuffin

Jul 9, 2019 4:35 pm

developer   ~0052138

That seems strange. The Royal Guardians used in waves are just set up like normal Strikecraft groups, so that restriction makes no sense.

Unless that type is somehow set up to still use the normal Guardian logic, but I don't know why that would be.

BadgerBadger

Jul 9, 2019 6:37 pm

manager   ~0052139

There's probably a mix between old and new logic. The original Guardians in Waves code was quite different from what we seem to be trying to do now.

wm46

Jul 9, 2019 9:59 pm

reporter   ~0052140

Yeah, right now the code checks every ship being added for if it's a guardian or not:

                    if ( type.SpecialType == SpecialEntityType.AIGuardian && maxGuardianTypes != -1 )
                    {
                        if ( numGuardianTypesUsed > maxGuardianTypes || maxGuardianTypes == 0 )
                            continue;
                        numGuardianTypesUsed++;
                    }

And so even if a guardian is put in a wave drawbag, it will get ignored unless the wave rolled 3+ ship types in the wave.

x4000Bughunter

Jul 12, 2019 12:43 pm

administrator   ~0052205

Thanks!

* Logic in waves has been changed so that if there are any guardians in the normally-strikecraft section of the code, then it will just ignore them in terms of the "max guardians with a wave" logic goes.
** This lets the Royal Guardians spawn en masse as expected for the Royal AI type, instead of randomly sending 0 strength waves followed by apocalyptic ones later on.
** This is untested, but should in theory work.

Issue History

Date Modified Username Field Change
Jul 9, 2019 2:38 pm wm46 New Issue
Jul 9, 2019 2:38 pm wm46 File Added: ArcenDebugLog.txt
Jul 9, 2019 2:38 pm wm46 File Added: AfterWaveo.save
Jul 9, 2019 2:38 pm wm46 File Added: Autosave.900.save
Jul 9, 2019 4:05 pm wm46 Note Added: 0052134
Jul 9, 2019 4:11 pm wm46 Note Added: 0052135
Jul 9, 2019 4:14 pm wm46 Note Added: 0052137
Jul 9, 2019 4:35 pm RocketAssistedPuffin Note Added: 0052138
Jul 9, 2019 6:37 pm BadgerBadger Note Added: 0052139
Jul 9, 2019 9:59 pm wm46 Note Added: 0052140
Jul 12, 2019 12:43 pm x4000Bughunter Assigned To => x4000Bughunter
Jul 12, 2019 12:43 pm x4000Bughunter Status new => resolved
Jul 12, 2019 12:43 pm x4000Bughunter Resolution open => fixed
Jul 12, 2019 12:43 pm x4000Bughunter Fixed in Version => 0.875 Counterattacks You Can Taste
Jul 12, 2019 12:43 pm x4000Bughunter Note Added: 0052205