• 🏆 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!

[AI] (Insane Mode) Undead is Building too many Necropolis

Status
Not open for further replies.
Level 3
Joined
Feb 16, 2008
Messages
20
Hello guys. This is my first post here. I want to ask why is it that the Undead (in Insane Mode) builds too many necropolis. This sometimes happens after they survive an attack in their base. Also, the Undead doesn't build banshees and only necromancers. But when I looked at the AI undead in ROC, there is that instruction

Code:
if farms < 7 then
        return
    endif
    if banshees then
        call SetBuildUnit( 3, NECRO     )
        call SetBuildUnit( 2, BANSHEE   )

I extracted this undead AI and used it in the map through triggers. I changed the 7 to 6 in the if statement. The result was the undead trained banshees earlier than expected. I think the Undead AI in Frozen throne is boring because they don't train (or give importance to) spell casters (except the Obsidian Statue) not like humans. Even Orcs train at least 1 shaman and 1 witchdoctor per wave.

So now, how do I extract the Undead AI in Frozen Throne ?
 
Level 5
Joined
Oct 27, 2007
Messages
158
Hello guys. This is my first post here. I want to ask why is it that the Undead (in Insane Mode) builds too many necropolis. This sometimes happens after they survive an attack in their base. Also, the Undead doesn't build banshees and only necromancers. But when I looked at the AI undead in ROC, there is that instruction

Code:
if farms < 7 then
        return
    endif
    if banshees then
        call SetBuildUnit( 3, NECRO     )
        call SetBuildUnit( 2, BANSHEE   )
I extracted this undead AI and used it in the map through triggers. I changed the 7 to 6 in the if statement. The result was the undead trained banshees earlier than expected. I think the Undead AI in Frozen throne is boring because they don't train (or give importance to) spell casters (except the Obsidian Statue) not like humans. Even Orcs train at least 1 shaman and 1 witchdoctor per wave.

So now, how do I extract the Undead AI in Frozen Throne ?

There's a bug in the AI scripts where the AI will get stuck in a building loop at town x when the main town's gold mine has run dry. Expansion town indexes (except for the main base) get shifted when an expansion mine collapses. I explained the bug in another thread here about infinite burrows. Maybe you're encountering a similar problem.

The entire AI file for Undead can be found in the war3x.mpq file under Scripts\undead.ai
If the AI script instructs the AI to build Banshees (they're included in both RoC and TFT) it will build them when the right scripted conditions are met. The following code snippet is from the TFT undead.ai script.

JASS:
    if c_food_used >= UPKEEP_TIER2-10 and c_gold < 2000 then
        return
    endif

    // extra troops
    //
    if c_citadel_done >= 1 and c_tomb_done >= 1 then
        call SetBuildUnit( 1, OBS_STATUE )
        if b_sphinx_ok then
            call SetBuildUnit( 1, BLK_SPHINX )
        endif
    endif

    if c_temple_done >= 1 then
        call SetBuildUnit( 4, NECRO     )
        call SetBuildUnit( 2, BANSHEE   )
    endif

    if c_citadel_done >= 1 and c_tomb_done >= 1 and b_sphinx_ok then
        call SetBuildUnit( 2, BLK_SPHINX )
    endif

The build_sequence function constantly changes the build instructions for units. It could very well be that the AI has enough time to build the Status/Destroyers but not the casters that are scripted to build next. When training units Blizzard uses a function that only proceeds to the next unit in the array to be trained when it has the desired count of the current unit requested. There's also a food/gold condition checked at tier2 whether or not to build extra units. Although not likely that this is causing the problem, but it could be. I suggest putting some debug messages in the script and check whether or not the units are added to the build queue.
 
Level 3
Joined
Feb 16, 2008
Messages
20
hello there


thank you for your helpful response and for pointing out where I can extract the ai I needed. I solved now as to how the undead will train banshees and necros by inserting "call SetBuildUnit( 2, BANSHEE )" within the minimum force and reducing the number of gargoyles they build. It worked because I observed that the undead is always desperate and conserving too much resources so they always send their minimum force to attack an enemy's camp. :grin:
 
Status
Not open for further replies.
Top