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

A question about the AI editor

Status
Not open for further replies.
Level 15
Joined
Nov 26, 2005
Messages
1,151
Hi, recently I've been learning what the AI editor can do and can't do. I have managed to set up a decent AI that can rebuild its units and structures and attack properly.

My question is: Can I make the AI do more things simultaneously? For example if I kill all of its units, it will start making only peons and after all 15 peons are done than it starts making grunts. Same with training units, it might have 2 barracks, 2 spirit lounges and 1 beastiary but only trains from 2 of them at a time. Can I make the AI use all its available training facilities to match its building priorities?
 
Level 14
Joined
Jun 15, 2016
Messages
749
Hi, recently I've been learning what the AI editor can do and can't do. I have managed to set up a decent AI that can rebuild its units and structures and attack properly.

My question is: Can I make the AI do more things simultaneously? For example if I kill all of its units, it will start making only peons and after all 15 peons are done than it starts making grunts. Same with training units, it might have 2 barracks, 2 spirit lounges and 1 beastiary but only trains from 2 of them at a time. Can I make the AI use all its available training facilities to match its building priorities?

Hold on a minute, you confused me. You said you made a decent AI then after that you also said you can't make it properly.

You should try to add more conditions for training each units to suit you need. I really do not understand what you need. Make a private conversation with me, maybe i can help.
 
Level 12
Joined
Jun 15, 2016
Messages
472
You can make an ai that does things simultaneously, but not with the ai editor.

The build order which you create in the ai editor actually goes to an integer array which stores your building priorities. Another internal function called iirc BuildLoop then goes over the array and orders to produce the buildings/units/upgrades in the list one by one, when necessary (i.e. when it's not built and the player has enough resources and all).

Directly regarding your question: the ai operates on something called "threads". What threads do, is they allow simultaneous actions by the ai. Your building priorities list is being updated periodically, and the building function checks for things that need producing periodically as well. These two functions operate on different threads, allowing for simultaneous action.

I suppose you could try simulating another building priorities array by seeing how the ai functions do it, but it won't be easy...
 
Status
Not open for further replies.
Top