• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Crash] Map keeps crashing with no clear reason

Status
Not open for further replies.
Level 13
Joined
Dec 19, 2020
Messages
237
Hello everyone!

I'm making a campaign which currently consists of six playable maps and an interlude. The last map gives me troubles. The situation is the following:
- I finished my map and started making the AI of the bases. I currently have three AI's. When testing the map, it crashed. I was not thrown out of WC3, but the screen froze, the game stopped and I could't move the mouse. This didn't happen when I did not have an active AI. So I started experimenting.

I noticed that the AI for two of the players (Snow and Lavender) make the game crash if they attack. The AI of the Light Blue faction does not cause this problem.
So: One AI is functioning, two others keep crashing the game if they get the order to attack. If they do not get the signal to attack (and only defend) then the game doesn't crash.

I tried to find out what makes the game crash, but I'm not getting any further. If someone has suggestions/solutions for this, please let me know :)

I've added my my campaign file and two of the AI's to this post. The map in the campaign file is called 'map14 Fading Starlight'.
The first AI: 'Frostfang Clan' is the functioning AI. The second AI: 'Army of the Sun' is one of the AI's which I think causes a problem.
If someone needs additional information, feel free to ask here or in a private message.

Regards.

// ==========================================================================
// Frostfang Clan - Light Blue
// ==========================================================================
globals

player enemy = PlayerEx(14)

constant integer Peon = 'o00Q'
constant integer Pillager = 'o00X'
constant integer Hunter = 'o00Y'
constant integer Pulverizer = 'o00Z'
constant integer Shaman = 'o010'
constant integer Wolf = 'n00T'
constant integer War_Wolf = 'o019'
constant integer Cromash = 'N00R'
constant integer Elder = 'o01U'
constant integer Ram = 'h00N'
constant integer Wolf_Rider = 'o602'
constant integer Gorfax = 'O00F'

constant integer Stronghold = 'o00K'
constant integer Great_Hall = 'o00H'
constant integer Fortress = 'o00T'
constant integer Barracks = 'o00V'
constant integer Altar = 'o00U'
constant integer Burrow = 'o018'
constant integer Blacksmith = 'o00W'
constant integer Temple = 'o011'
constant integer Wolf_Den = 'o012'
constant integer Ice_Tower = 'o013'
constant integer Glaive_Tower = 'o014'

endglobals

//============================================================================
// main
//============================================================================
function main takes nothing returns nothing

call CampaignAI(Burrow, null)
call SetReplacements(15,15,15)
call SetPeonsRepair (true)
call SetSlowChopping (true)

//*****************************
//*Building/Defense
//*****************************

call SetBuildUnitEx(1,1,1, Fortress)
call SetBuildUnitEx(5,5,5, Peon)
call SetBuildUnitEx(11,11,11, Burrow)
call SetBuildUnitEx(1,1,1, Altar)
call SetBuildUnitEx(1,1,1, Blacksmith)
call SetBuildUnitEx(2,2,2, Barracks)
call SetBuildUnitEx(2,2,2, Temple)
call SetBuildUnitEx(2,2,2, Wolf_Den)
call SetBuildUnitEx(7,7,7, Peon)
call SetBuildUnitEx(2,2,2, Ice_Tower)
call SetBuildUnitEx(1,1,1, Glaive_Tower)

call CampaignDefenderEx(1,1,1, Pulverizer)
call CampaignDefenderEx(2,2,2, Wolf_Rider)
call CampaignDefenderEx(2,2,2, Hunter)
call CampaignDefenderEx(2,2,2, Shaman)
call CampaignDefenderEx(1,1,1, War_Wolf)
call CampaignDefenderEx(2,2,2, Wolf)
call CampaignDefenderEx(1,1,1, Elder)
call CampaignDefenderEx(1,1,1, Cromash)
call CampaignDefenderEx(1,1,1, Gorfax)

call WaitForSignal()

//* Wave 1A *
call InitAssaultGroup()
call CampaignAttackerEx(1,1,1, Elder)
call CampaignAttackerEx(2,2,2, War_Wolf)
call CampaignAttackerEx(3,3,3, Hunter)
call CampaignAttackerEx(2,2,2, Shaman)
call CampaignAttackerEx(3,3,3, Wolf_Rider)
call CampaignAttackerEx(1,1,1, Cromash)
call SuicideOnPlayer(M7,enemy)

loop

//* Wave 1 *
call InitAssaultGroup()
call CampaignAttackerEx(3,3,3, Wolf)
call CampaignAttackerEx(3,3,3, War_Wolf)
call CampaignAttackerEx(4,4,4, Hunter)
call CampaignAttackerEx(1,1,1, Shaman)
call CampaignAttackerEx(1,1,1, Elder)
call SuicideOnPlayer(M6,enemy)

//* Wave 2 *
call InitAssaultGroup()
call CampaignAttackerEx(3,3,3, Ram)
call CampaignAttackerEx(4,4,4, Pillager)
call CampaignAttackerEx(3,3,3, Hunter)
call CampaignAttackerEx(2,2,2, Pulverizer)
call SuicideOnPlayer(M6,enemy)

//* Wave 3 *
call InitAssaultGroup()
call CampaignAttackerEx(3,3,3, Wolf)
call CampaignAttackerEx(2,2,2, Elder)
call CampaignAttackerEx(2,2,2, Hunter)
call CampaignAttackerEx(2,2,2, Shaman)
call CampaignAttackerEx(2,2,2, Wolf_Rider)
call CampaignAttackerEx(1,1,1, Gorfax)
call SuicideOnPlayer(M7,enemy)

//* Wave 4 *
call InitAssaultGroup()
call CampaignAttackerEx(1,1,1, Elder)
call CampaignAttackerEx(2,2,2, War_Wolf)
call CampaignAttackerEx(3,3,3, Hunter)
call CampaignAttackerEx(2,2,2, Shaman)
call CampaignAttackerEx(3,3,3, Wolf_Rider)
call CampaignAttackerEx(1,1,1, Cromash)
call SuicideOnPlayer(M7,enemy)

endloop
endfunction
// ==========================================================================
// Army of the Sun - Lavender
// ==========================================================================
globals
player user = PlayerEx(10)

constant integer High_Elven_Worker = 'n00Y'
constant integer Swordsman = 'hhes'
constant integer HE_Archer = 'nhea'
constant integer Ballista = 'e003'
constant integer Lieutenant = 'nbel'
constant integer Judicator = 'h603'

constant integer Elven_Hall = 'h008'
constant integer Elven_Keep = 'h009'
constant integer Elven_Castle = 'h00A'
constant integer Hunters_Quarters = 'e000'
constant integer Research_Centre = 'e001'
constant integer HE_Farm = 'nefm'
constant integer HE_Barracks = 'nheb'
constant integer HE_Altar = 'h00R'
constant integer HE_Mill = 'h601'
constant integer Earth_Tower = 'negf'
constant integer Sky_Tower = 'negm'

endglobals

//============================================================================
// main
//============================================================================
function main takes nothing returns nothing
call CampaignAI(HOUSE, null)
call SetReplacements(5,5,5)
call SetPeonsRepair (true)
call SetSlowChopping (false)

//*****************************
//*Building/Defense
//*****************************

call SetBuildUnitEx(1,1,1, Elven_Castle)
call SetBuildUnitEx(2,2,2, High_Elven_Worker)
call SetBuildUnitEx(3,3,3, HE_Barracks)
call SetBuildUnitEx(9,9,9, HE_Farm)
call SetBuildUnitEx(1,1,1, HE_Mill)
call SetBuildUnitEx(1,1,1, HE_Altar)
call SetBuildUnitEx(1,1,1, Research_Centre)
call SetBuildUnitEx(3,3,3, ARCANE_SANCTUM)
call SetBuildUnitEx(2,2,2, Hunters_Quarters)
call SetBuildUnitEx(1,1,1, ARCANE_VAULT)
call SetBuildUnitEx(10,10,10, High_Elven_Worker)
call SetBuildUnitEx(4,4,4, Earth_Tower)

call CampaignDefenderEx(2,2,2, SPELL_BREAKER)
call CampaignDefenderEx(3,3,3, Judicator)
call CampaignDefenderEx(1,1,1, Lieutenant)
call CampaignDefenderEx(2,2,2, HE_Archer)
call CampaignDefenderEx(2,2,2, PRIEST)
call CampaignDefenderEx(1,1,1, SORCERESS)
call CampaignDefenderEx(1,1,1, BLOOD_MAGE)

call WaitForSignal()

loop

//* Wave 1 *
call InitAssaultGroup()
call CampaignAttackerEx(3,3,3, HE_Archer)
call CampaignAttackerEx(3,3,3, Swordsman)
call CampaignAttackerEx(1,1,1, Lieutenant)
call CampaignAttackerEx(3,3,3, Judicator)
call CampaignAttackerEx(2,2,2, Ballista)
call SuicideOnPlayer(M6,user)

//* Wave 2 *
call InitAssaultGroup()
call CampaignAttackerEx(2,2,2, HE_Archer)
call CampaignAttackerEx(3,3,3, SPELL_BREAKER)
call CampaignAttackerEx(1,1,1, Lieutenant)
call CampaignAttackerEx(2,2,2, Judicator)
call CampaignAttackerEx(2,2,2, PRIEST)
call CampaignAttackerEx(2,2,2, SORCERESS)
call SuicideOnPlayer(M7,user)

//* Wave 3 *
call InitAssaultGroup()
call CampaignAttackerEx(3,3,3, HE_Archer)
call CampaignAttackerEx(2,2,2, SPELL_BREAKER)
call CampaignAttackerEx(1,1,1, BLOOD_MAGE)
call CampaignAttackerEx(3,3,3, Judicator)
call CampaignAttackerEx(2,2,2, PRIEST)
call CampaignAttackerEx(1,1,1, SORCERESS)
call SuicideOnPlayer(M7,user)

endloop
endfunction
 

Attachments

  • Tale of the Two Brothers - Part Two (1).w3n
    41.3 MB · Views: 8
Level 21
Joined
Dec 4, 2007
Messages
1,478
I don't really know much about the ai editor.
But, since you got close to fixing it (or point to the culprit), why not trigger the ai instead? Or look for ai tutorials, maybe the solution is buried somewhere.
Cool terrain and use of assets btw!
 
Level 13
Joined
Dec 19, 2020
Messages
237
Hi A]mun!

But, since you got close to fixing it (or point to the culprit), why not trigger the ai instead?
I honestly don't know how to trigger an AI. I always import JASS scripts and it has worked fine up till now. That's why I try to find out where the problem comes from. I think it is the AI, but it could also be a problem in the map itself (which could lead to me recreating this map :sad: )

Or look for ai tutorials, maybe the solution is buried somewhere.
I will, although it would be strange. As you might have noticed, all my scripts are build the same, in every map I've made so far. Why it keeps crashing by specific AI scripts, I don't know.

Cool terrain and use of assets btw!
Thanks! I've put a lot of time in collecting all models.

Regards.
 
Level 21
Joined
Dec 4, 2007
Messages
1,478
Probably a shot in the dark here, but why is the player number 10 in your second spoiler?
Lavender should be player 20?!
Also why is it player user and not player enemy (or perhaps 'ally') like the frostfang clan in spoiler 1?

// ==========================================================================
// Army of the Sun - Lavender
// ==========================================================================
globals
player user = PlayerEx(10)



// ==========================================================================
// Frostfang Clan - Light Blue
// ==========================================================================
globals

player enemy = PlayerEx(14)
 
Level 13
Joined
Dec 19, 2020
Messages
237
Hi A]mun!

Probably a shot in the dark here, but why is the player number 10 in your second spoiler?
The player 'user' is a self-created term for the targeted player which the AI must attack. So, the script says that the AI (player 20) should attack player 10 (light blue in this case). It does not mean that the AI is meant to be run by player 10 or so.

Also why is it player user and not player enemy (or perhaps 'ally') like the frostfang clan in spoiler 1?
To answer this, it is important to keep my answer on the other quote in mind. To make an AI attack a player, you can either mention the player itself in the script or give the target a name. The last option is more attractive, because you can switch from target by only changing the spoiler 'player user = PlayerEx(10)' instead of changing the player at every attack wave.

The name of the target can be everything. I use both the terms 'user' or 'enemy'. Hence the difference.

Hopefully this does answer your questions. Thanks for the input but I fear this is not the cause of the crash :( :sad:

Regards.
 
Level 28
Joined
Feb 18, 2014
Messages
3,580
The AI script looks fine the problem might be somewhere else like in the tech requirement it is possible that the AI is trying to train a unit that doesn't have the necessary requirements which causes the crash. Or maybe there is a faulty model in one of your units which may also cause the crash. My suggestion is to remove the attackers one by one until you identify which one is causing the problem.
 
Level 13
Joined
Dec 19, 2020
Messages
237
The AI script looks fine the problem might be somewhere else like in the tech requirement it is possible that the AI is trying to train a unit that doesn't have the necessary requirements which causes the crash. Or maybe there is a faulty model in one of your units which may also cause the crash. My suggestion is to remove the attackers one by one until you identify which one is causing the problem.
Hi Warseeker!

I will make the mystery even bigger. I've made a new map, copied the terrain and the units in it and let the AI run. Nothing crashes. All attack waves are functioning. This makes me think that the map is either in an imported file (probably a doodad, because I did not copy those yet) or in the map itself. how this has happened, I don't know. I hope it stays this way, because I can continue finishing my map, but it doesn't solve the original problem of course. :ogre_rage:

Regards.
 
Level 18
Joined
Mar 16, 2008
Messages
721
i had a similar problem where the game got really laggy. it was due to some loop in the ai script never ending or something. if i had to take a guess, it would be "call WaitForSignal()" are you sending any commands to the AI with a trigger? perhaps it is waiting for a command that never happens and also looping that function, so it just builds up and lags/crashes. IDK.

also your map crashes my world editor.
 
Level 13
Joined
Dec 19, 2020
Messages
237
Hi Gnuoy!

player user = PlayerEx(10)

i had a similar problem where the game got really laggy. it was due to some loop in the ai script never ending or something. if i had to take a guess, it would be "call WaitForSignal()" are you sending any commands to the AI with a trigger? perhaps it is waiting for a command that never happens and also looping that function, so it just builds up and lags/crashes. IDK.
I've placed all AI scripts in a trigger which sends also the signal. The trigger is run with an order from the melee initilization trigger. So I guess it gets the signal. Also, the AI starts building an attack wave, which indicates that it receives the signal.

also your map crashes my world editor.
That's strange. Maybe it has to do with the version of WC3? I'm using patch 1.29, so maybe you're editor is from another patch.

Regards.
 
Level 18
Joined
Mar 16, 2008
Messages
721
just taking guesses here, maybe someone else knows better. maybe try moving the order out of map initialization, maybe the script isn't initialized yet when the order gets sent? also for the army of the sun script, HOUSE isn't defined in global variables?

are those the entire scripts above?
 
Level 13
Joined
Dec 19, 2020
Messages
237
ybe try moving the order out of map initialization, maybe the script isn't initialized yet when the order gets sent?
In previous maps, was this not the case and did the AI function fine. However, during my tries to solve this problem, I have placed the AI orders in a different trigger. The game still crashed. A good suggestion though :)

also for the army of the sun script, HOUSE isn't defined in global variables?
'HOUSE' is the raw code for the farm in WC3. That is a bug in the script though, because food is made by the HE_Farm instead of the normal farms. Fellow Hiver Trycex alerted me on this bug, so I repaired it. Sadly, this was not the problem causing the crash as well...

are those the entire scripts above?
Yes. These scripts are the standard script formats I use (I learned those from Turnro's YouTube channel).

Regards.
 
Level 13
Joined
Dec 19, 2020
Messages
237
i'm stumped then, i'd ask Turnro, he usually responds, or Nowow
I know how you feel, because this was the reason to start this thread for me.

will make the mystery even bigger. I've made a new map, copied the terrain and the units in it and let the AI run. Nothing crashes. All attack waves are functioning. This makes me think that the map is either in an imported file (probably a doodad, because I did not copy those yet) or in the map itself.
Luckily, the new map functions as it should do. I get the impression that the map itself was corrupted in some kind of way and that the AI attack waves were a trigger (although I do not know why). I will continue testing the map, slowly adding more AI scripts, triggers and doodads. If I find something new, I will post it here.

Regards.
 
Status
Not open for further replies.
Top