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

[AI] AI priority issues

Status
Not open for further replies.
Level 14
Joined
Dec 12, 2009
Messages
1,027
I'm currently working on adding an AI to an altered melee map (Erebus) using the AI Editor. Everything goes as planned until several units are killed. The units are replaced, but the AI ceases progressing along the priority list.

It won't rebuild a base if I destroy everything but its primary structure.

The Melee option on the 1st tab is unchecked. I'm not using any conditions anywhere, and there is only 1 repeating attack wave. The script is started via trigger.

I've checked through all of the AI Editor tutorials on THW, TheHelper, wc3c, and on one or two other sites, and found nothing relating to my problem.

On a side note, why doesn't the AI use Zepplins or similar transports?

\\//xx\\//
 
Level 14
Joined
Dec 12, 2009
Messages
1,027
You should be able to export the script from the map.

Erebus [Builder]

We made some changes to allow it to run smooth, but we're open to suggestions on improving it. Note that food is never an issue. The script doesn't recognize the starting food available [50] nor the food produced by upgraded Necronage structures. [food provided goes 4,6,8]

//\\oo//\\
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
The GUI AI editor is probably a piece of junk like GUI triggers. I advise looking into a custom AI script as that may allow you to code the AI to catch these situations or to keep reserved food / resources incase this happens.

You basically need to write code to manage the AIs level of development. If a regression occurs, then it should probably drop all future tasks and even cut back on millitry until their main is restored (or is being restored) to working condition. I thought the GUI AI did something like this but it sounds like it is hitting a block like resource/food management or conflicting piorities (build X before Y where X needs Y and Y is now dead).

Remember that WC3 AI is not the same as AI from games like empire earth... The WC3 AI actually needs food, gold and wood to make stuff. Where as the empire earth AI was only bound by population limit. Thus you have to plan their economy carefully.
 
Level 13
Joined
May 11, 2008
Messages
1,198
i didn't know there was a gui ai editor...if you are coding in jass i hope you're using the custom.ai file, or whatever that file is that holds the list of ai functions. even with that file, there's no one that really knows what all those functions do afaik unless they work at blizzard, and they aren't forthcoming about what those functions do afaik. kindof have to guess.
 
Level 20
Joined
Feb 24, 2009
Messages
2,999
The GUI AI editor is probably a piece of junk like GUI triggers.

Not true, it's limited, but it's far from junk the above problem probably has an easy solution, it won't be food related either seeing as buildings don't require food T_T - actually - saying that, your units could be tying up the priority queue.
GUI AI condition variables can't be specific, only generic (in terms of units/buildings needed), so I don't see how that could be a problem either.
I'll have a look in a minute.


EDIT:Ok from intial inspection I'd say mckill2009 has a very good point, what's probably happening is your AI is creating base+units, your then killing the base and select units near the top of the priority tree (say slaves), now the AI will try and replace these slaves before buildings, but if the food is full from other units, e.g. assassins (lower priority units) I it won't be able to - and I do believe - GUI AI is indeed limited in that regard, it cannot 'skip' priorities, if they have no condition.

To fix it, you'll need to firstly list some more food production buildings before the majority of units are made and then add several extra highly CONDITIONED priorities at the very top like:

Fissure? (If number of units > x (where x is a high number, representing a large force)), (Number of type fissures, owned by player = 0 (to prevent it being a duplicate)), (and any other conditions to make it only built in the above situation, the more specific you are the better).

AI is a very tricky business, it's all about tying up loose ends you have to account for every situation you can in as many ways as you can.
Use conditions in excess, even in the GUI editor good AI is perfectly possible you just need lots and lots of conditions on each priority, which of course is a very lengthy process.. Hope that helped somewhat.

Most people think priorities are the key, that's false, priorities are often the cause of bad AI, conditions make good AI, you can never use too many and don't be afraid to have hundreds of priorities as long as their conditioned properly (very cryptically)!
 

Attachments

  • aiscript.jpg
    aiscript.jpg
    90.8 KB · Views: 128
Last edited:
Level 14
Joined
Dec 12, 2009
Messages
1,027
I saw the script and I realize that the max food is 18, from what I know, you cant build anymore units above food 18, the AI will stop building when it reaches peon #2...

I suggest that you make food first before creating units OR make conditions on when the unit will be a priority...

Food isn't an issue. The AI always has enough food. We checked to see if it would build 'red' units if it had the resources/food and it did.

The GUI AI editor is probably a piece of junk like GUI triggers. I advise looking into a custom AI script as that may allow you to code the AI to catch these situations or to keep reserved food / resources incase this happens.

You basically need to write code to manage the AIs level of development. If a regression occurs, then it should probably drop all future tasks and even cut back on millitry until their main is restored (or is being restored) to working condition. I thought the GUI AI did something like this but it sounds like it is hitting a block like resource/food management or conflicting piorities (build X before Y where X needs Y and Y is now dead).

~I'm not sure what you mean by 'custom AI script'. Are you referring to editing the script in JASS (I saw a tutorial or two on this).

~I'm aware that it starts from the top (highest priority) and works its way down. I assumed it would. WE've tweaked the code with several conditions since the OP and have managed to avoid the situation listed in my OP. It currently seems to rebuild itself just fine, but I think I have a few conflicting priorities and/or poorly set priorities. From what has been posted, the AI can't move down the list until it gets what it's trying to.

Not true, it's limited, but it's far from junk the above problem probably has an easy solution, it won't be food related either seeing as buildings don't require food T_T - actually - saying that, your units could be tying up the priority queue.
GUI AI condition variables can't be specific, only generic (in terms of units/buildings needed), so I don't see how that could be a problem either.
I'll have a look in a minute.


EDIT:Ok from intial inspection I'd say mckill2009 has a very good point, what's probably happening is your AI is creating base+units, your then killing the base and select units near the top of the priority tree (say slaves), now the AI will try and replace these slaves before buildings, but if the food is full from other units, e.g. assassins (lower priority units) I it won't be able to - and I do believe - GUI AI is indeed limited in that regard, it cannot 'skip' priorities, if they have no condition.

To fix it, you'll need to firstly list some more food production buildings before the majority of units are made and then add several extra highly CONDITIONED priorities at the very top like:

Fissure? (If number of units > x (where x is a high number, representing a large force)), (Number of type fissures, owned by player = 0 (to prevent it being a duplicate)), (and any other conditions to make it only built in the above situation, the more specific you are the better).

AI is a very tricky business, it's all about tying up loose ends you have to account for every situation you can in as many ways as you can.
Use conditions in excess, even in the GUI editor good AI is perfectly possible you just need lots and lots of conditions on each priority, which of course is a very lengthy process.. Hope that helped somewhat.

Most people think priorities are the key, that's false, priorities are often the cause of bad AI, conditions make good AI, you can never use too many and don't be afraid to have hundreds of priorities as long as their conditioned properly (very cryptically)!

Alright, thanks. This has given me some ideas. If Crabby and I run into some more problems we'll be sure to post.

It's a shame though that almost no-one knows enough about the AI editor to explain how to use it (and not just what it does).

//\\oo//\\

It would be alot easier if I had an established build present for it. The AI builds fast, but I can easily outbuild it...
Another issue I've run into is the frame rate "lag" caused by redicolous micro. It's forced us to reduce the AI's army to about 50 units. (The max available is usually around 180)

Is there anything I can do to reduce this and increase the size of the AI's army, or is it something I can't really change?
 
Level 20
Joined
Feb 24, 2009
Messages
2,999
I might write a detailed tutorial on making an ai in the editor, many people struggle with and the current tutorials merely explain functions/layout.

As for the speed, you shouldn't be able to outbuilding it seeing as AI doesn't need to 'move the mouse' it will always be faster if well setup/programmed.
So you'll need to shuffle your trees around, lack of speed will arise when a priority is holding it up.

I've never heard of the lag... How many teams of ai are there, just the one ?

I mean think logically, melee can have 11AI without lag, GUI editor ai is compiled into script so although slightly less customisable it shouldn't be any less efficient and most certainly not to that extent!!
 
Level 14
Joined
Dec 12, 2009
Messages
1,027
By outbuilding, I mean I can easily keep the AI out of my base in the game. It's crippled by the fact it will never have more than 4 unit-producing structures. I usually have about 20/base.

The AI will build faster then players new to the game and be challenging for players unfamiliar with the units. I haven't set a build strat for myself yet. When I do, I'll transfer it to the AI.

I see the lag in regular melee games. With 11 AI armies and myself, especially when being ordered to engage, the frame rate will drop. If 4 AI aren't wiped out by the time T3 is reached, I have to shut down the game. saw it on my older computer and still see it on my (much) newer laptop.

The framerate issue I looked up, and found that it was the result of a massive number of units moving on a map. It's a processor issue from what I understand.

You can have as many AI in-game as you want. We set it up for all players.

//\\oo//\\
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
As far as I know, WC3 AI are impossible to lag unless you do something stupid and code their script badly or complexly (lots of loops, etc). I have done 6 on 6 games with 6 AI against 6 humans and no performance problems were present on my old computer.

In Starcraft II, the AI is easy to cause to lag. If you are in an unreachable by land location, the AI spazes out and will dramatically reduce framerate to be near unplayable until you land stuff that is reachable or you kill most of their ground units.
 
Level 14
Joined
Dec 12, 2009
Messages
1,027
As far as I know, WC3 AI are impossible to lag unless you do something stupid and code their script badly or complexly (lots of loops, etc). I have done 6 on 6 games with 6 AI against 6 humans and no performance problems were present on my old computer.

In Starcraft II, the AI is easy to cause to lag. If you are in an unreachable by land location, the AI spazes out and will dramatically reduce framerate to be near unplayable until you land stuff that is reachable or you kill most of their ground units.

I was refering to the standard game, not custom. Whenever I play a 6v6, 3v3v3v3, or 2v2v2v2v2v2 match in Icecrown or Divide and Conquer, I get frame rate drops, to the point where I can barely shut the game off. It's the worst during battles.

The games I'm refering to have me, and 11 AI players.

If it is bad coding, what can be done to fix it? (I'd like to get the AI in my map to use a full sized army, approximately 180 units)

//\\oo//\\
 
Level 13
Joined
May 11, 2008
Messages
1,198
I was refering to the standard game, not custom. Whenever I play a 6v6, 3v3v3v3, or 2v2v2v2v2v2 match in Icecrown or Divide and Conquer, I get frame rate drops, to the point where I can barely shut the game off. It's the worst during battles.

The games I'm refering to have me, and 11 AI players.

If it is bad coding, what can be done to fix it? (I'd like to get the AI in my map to use a full sized army, approximately 180 units)

//\\oo//\\

180 units? are you talking 300 food, or what? because that's a lot of units.
 
Level 14
Joined
Dec 12, 2009
Messages
1,027
180 units? are you talking 300 food, or what? because that's a lot of units.

Each player has up to 200 Souls [food] at their disposal. Typically, there are 10-20 towers with the rest units. (Everything costs 1 Soul, except hero which is free) The AI is currently set to max out at 60 Souls, with 10 of them being towers. The framerate is an issue I only see in games with alot of melee-style AI.

It's not the AI coding is basically what he's saying.
What's your pc spec?

The home computer is:
Intel Core2 CPU 6400 @ 2.13 GHz, 2 GB of RAM.
The video card: NVIDEA GeForce 9600 GT

My laptop:
Intel Core2 Duo CPU P8700 @ 2.53GHz with 6GB of RAM
Video Card: NVIDIA GeForce GTX 260M

//\\oo//\\
 
Last edited:
Status
Not open for further replies.
Top