Skip to content

Skirmish AI never builds anything when playing as a new Shockwave general (Armor/Salvage/Special Weapons) #335

Description

@gpherai

While testing the fix from #297 (build 9464033b..., PR #330) against a full Shockwave 1.201 install, I found a separate, unrelated bug.

Summary: When the skirmish AI is assigned one of Shockwave's 3 new generals (not present in vanilla Zero Hour), it does nothing for the entire match — no units, no buildings beyond the starting Command Center + worker, no movement. Confirmed consistently within 40s–100s of game start. AI opponents using any of the 9 original Zero Hour generals behave normally regardless of the mod, and I was able to play as any of the new generals myself against a non-Shockwave AI without any issues on the human side.

Environment: GeneralsX Zero Hour, Linux Flatpak, commit 9464033b701216f92f0561093fbc791c7156229c52d469e22a842cc1e82d9ba2 (PR #330 CI build), Fedora 44, Shockwave 1.201. Only tested on Linux — haven't verified Windows/macOS.

Test matrix:

Player general AI general AI activity
Armor (new) random passive
Superweapon (old) random passive
Laser (old), mod disabled GLA random active
Laser (old) random active
Armor (new) Armor (new) passive
Superweapon (old) China Infantry (old) active
Laser (old) Salvage (new) passive (0 buildings at 1m40s)
Air Force (old) China Special Weapons (new) passive (0 buildings at 1m)
China Special Weapons (new) Vanilla USA (old) active
Salvage (new) Vanilla USA (old) active

Pattern: AI passivity depends entirely on the AI's own assigned general, never the human player's. All 3 practically-selectable new Shockwave generals (Armor/USA, Salvage/GLA, Special Weapons/China) reproduce this as AI, 3/3. All vanilla generals tested as AI (Superweapon, Laser, China Infantry, vanilla USA) work normally, 4/4. A 4th new general ("Boss General") exists in the mod's data but isn't selectable in the normal skirmish lobby — likely a scripted General's Challenge boss — so not tested.

Possible lead (not a confirmed root cause): AISkirmishPlayer::newMap() (GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp:1076-1089) matches the AI's Side string against TheAI->getAiData()->m_sideBuildLists. No match → the loop falls through silently (only a DEBUG_ASSERTLOG, compiled out in Release) and the build list stays permanently empty — matching the symptom exactly.

I confirmed the mod does ship correct data for all 3 affected generals in Data\INI\Default\AIData.ini inside !Shw_scripts.big (extracted directly from the BIG archive):

=== AmericaArmorGeneral: 142 lines, 20 Structure entries ===
  SkirmishBuildList AmericaArmorGeneral
    Structure Armor_AmericaCommandCenter
      Location = X:501.22 Y:546.25
      ...
    ... (19 more Structure entries) ...
  END ;SkirmishBuildList FactionAmericaArmorGeneral

=== GLASalvageGeneral: 121 lines, 17 Structure entries ===
  SkirmishBuildList GLASalvageGeneral
    Structure Salv_GLACommandCenter
      ...
    ... (16 more Structure entries) ...
  END ;SkirmishBuildList FactionGLASalvageGeneral

=== ChinaSpecialWeaponsGeneral: 128 lines, 18 Structure entries ===
  SkirmishBuildList ChinaSpecialWeaponsGeneral
    Structure Spec_ChinaCommandCenter
      ...
    ... (17 more Structure entries) ...
  END ;SkirmishBuildList FactionChinaSpecialWeaponsGeneral

So this isn't a gap in the Shockwave content itself — all 3 blocks are present and well-formed.

That same file path (Data\INI\Default\AIData.ini) also exists in the base game's INIZH.big (62907 bytes, only the 9 vanilla generals, vs. 79521 bytes in the Shockwave archive) — a naming collision between the mod's override and the base archive. However, a similarly-colliding shared file, Data\INI\PlayerTemplate.ini (also duplicated between !Shw_ini.big and INIZH.big), loads correctly (all generals selectable), so it's not simply "the mod's override never wins" — something more specific to this file/lookup seems to be involved. Couldn't narrow it down further without a debug build.

Happy to test a patched build or attach full logs / the extracted AIData.ini files from both archives if useful.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions