• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Crash] Game crashes as soon as AI launches an attack wave

Level 31
Joined
Dec 3, 2020
Messages
1,252
I'm currently working on my Invasion of Kalimdor Reworked campaign and while working on the mission "Chains of Blood" (12th mission where you kill Cenarius), well... it crashes as soon as an AI launches an attack wave.
The map is somewhat big and has quite a few of pre-placed units, could this be the reason? (patch 1.29.2 WE).
The AI (.ai) scripts I use are the same as the ones I always use for my maps (same structure). I do use AI which just constantly "suicides" units into the enemies and the game doesn't crash then, it crashes when specifically an AI launches an attack wave. I will attach all the scripts I use for the map and the campaign itself if anyone is interested enough looking into it.

Worst case scenario I'll just remove the AI attacking and constantly sends units that "suicide", although that's not the idea.

About the crash/bug: the game just freezes and shortly after that crashes.
 

Attachments

Last edited:
Well I only kept the main few AI which are the "normal" ones and yeah... game still crashes when one of them starts attacking. This wasn't always the case though (in super early versions of the map the game didn't crash when they attacked). I can try removing some triggers next.

I'm pretty sure it's not the issue, but I will double check. I do use "Enchanted Gemstone Obelisks" now on my map (the default ones, I just changed their HP and removed invulnerability)
 
I didn't even know that maps larger than 256x256 work on pre-Reforged patches. I'd consider if you need that big map in the first place. Maybe shrinking it a bit will solve your problem. From my experience, a lot of problems begin at 224x224 :P.

If you want to keep the size: first, modify scripts/common.ai and set trace_on = true to have more info what exactly AI is doing in the moment of freeze. Then you can track those traces in common.ai.

Unfortunately, there are plenty of edge cases causing AI to crash and tracking them is a pain in the ass. It's very likely that it's an issue of a big map, complex pathfinding or inability to find a path at all. You can try putting the target closer to attacker's base and see if it still crashes.

If above fails, time for heavy artillery.

I recall SuicideOnPlayer() regularly crashing on maps 224x224 or larger (although it was on Reforged). A workaround was not to use SuicideOnPlayer(), but SuicideOnPoint() or AttackMoveKillA(). I even made a utility function SuicideOnPlayerSafe that worked similarly to SuicideOnPlayer(), but without calling a crashing native function. You can try importing my version of common.ai under scripts/common.ai - first, try it with your original scripts (I also fixed some issues with infinite loops that also used to cause game freezes). If it still freezes/crashes, try replacing SuicideOnPlayer() with SuicideOnPlayerSafe().
 
Back
Top