• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] AI Editor: Units keep retreating for no reason

Level 2
Joined
Dec 20, 2015
Messages
6
Out of curiosity I just wanted to test the capabilities of the AI editor on a custom map for personal use.

For the most part, it does exactly what I needed it to do though, every once in a while the AI retreats for no reason. The AI returns to the base only to go back and resumes its task again of attacking, which causes some delays.

It looks like there may be another order conflicting with the attack order.

Can someone point in the right direction on how to fix this?

Here is the script. Can someone take a look at this and help me pinpoint the cause of units retreating prematurely?

I'm still looking into this. Any help would be appreciated.

So far after tinkering with the script only FormGroups seems to be making a difference but messing with that disables the movement altogether.
I'm assuming the AI keeps returning back to form a new group before relaunching its assault despite the current group not being defeated yet.

Update: problem solved added 1 line of code to find a new target

// Attack the target and increment attack wave
if (target != null) then
call AttackTarget( target, setAlly )
call AttackWaveUpdate( )


set target = null // I added this 1 line here in case anyone else has a similar problem
 

Attachments

  • Capture.PNG
    Capture.PNG
    24.7 KB · Views: 18
  • Capture2.PNG
    Capture2.PNG
    24.1 KB · Views: 18
  • 2024-05-17 16-04-19.mp4
    17.7 MB
  • Gray.ai
    14.7 KB · Views: 2
Last edited:
Level 2
Joined
Dec 20, 2015
Messages
6
Could be that the target they were aiming was defeated while they were on their way, so they just cancelled? The map looks quite large and dense so I wouldn't be surprised if they tried to go help somewhere and just give up
Actually upon further testing the AI works just fine initially. I noticed that problems only start to occur once he trains new units. After the training is complete he goes back to base to regroup with the new units.

As for the targeting issue there is an AI for the enemies to constantly train new units as well so they should always be another target. Yes, the map is big but most of the other players are allies (only 2 enemy players)

Perhaps you can take a look the map?
 

Attachments

  • MZA W AI UP .w3x
    8 MB · Views: 0
Top