• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

AI not doing anything

Status
Not open for further replies.
Level 4
Joined
Feb 9, 2016
Messages
137
Guys please help me, I am creating a melee map for myself so I won't get bored but the AI won't do anything. I just put the buildings down already so they only have to build the buildings but they are not doing anything. Please help.
 
Level 14
Joined
Nov 30, 2013
Messages
926
Does your Melee map has this default trigger?
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Use melee time of day (for all players)
      • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
      • Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
      • Melee Game - Set starting resources (for all players)
      • Melee Game - Remove creeps and critters from used start locations (for all players)
      • Melee Game - Create starting units (for all players)
      • Melee Game - Run melee AI scripts (for computer players)
      • Melee Game - Enforce victory/defeat conditions (for all players)
Or the AI's race is custom?
 
Level 4
Joined
Feb 9, 2016
Messages
137
Yes it does have that trigger. It is just the default Undead race. I only changed the building's models and name of the units. I thought that it was because i never placed any trees near their base was the issue because lack of resources so I added a trigger that would give them 300k resources. Still that did not work so I placed some trees in their base and still they do not do anything but harvest gold.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
Guys please help me, I am creating a melee map for myself so I won't get bored but the AI won't do anything. I just put the buildings down already so they only have to build the buildings but they are not doing anything. Please help.

You DON'T need to put any buildings, you just need the player starting location and it will build the Town Hall and starting units automatically.
 

Attachments

  • 2016-12-14_195247.jpg
    2016-12-14_195247.jpg
    352.5 KB · Views: 146
Level 4
Joined
Feb 9, 2016
Messages
137
Yeah i know that but the AI only builds like 2 per building type but I want it more so it would be more challenging for me to take down because of they will create units faster. Besides it is no fun if I destroy them with just 1 invasion at least if I put the buildings already they don't have to rebuild.
 
Level 14
Joined
Nov 30, 2013
Messages
926
Yeah i know that but the AI only builds like 2 per building type but I want it more so it would be more challenging for me to take down because of they will create units faster. Besides it is no fun if I destroy them with just 1 invasion at least if I put the buildings already they don't have to rebuild.
Then use an AI Editor if you want to create a challenging AI.
 
Level 4
Joined
Feb 9, 2016
Messages
137
Ok but how do I make the AI revive a default melee hero that was summoned to be revived if they die?? or any hero that dies for that matter using the AI editor??
 
Level 14
Joined
Jun 15, 2016
Messages
753
Ok but how do I make the AI revive a default melee hero that was summoned to be revived if they die?? or any hero that dies for that matter using the AI editor??

You need a working Altar with working heroes. In AI Editor, you have to order AI to train those heroes first, Use "Summon first/second/third hero", they will automatically train those dying heroes whenever they have enough resources and meet all tech-tree requirements. Similar with building number, you have to order AI to construct them in right priorities, add many buildings as you like, they will automatically build them back whenever destroyed. AI Editor works both for summoning, training and reviving any objects you put into the list and will follow strictly to those numbers.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
Do be aware that the reason the Melee AI builds so few troop production buildings is because that is all the troop production buildings they can fund, especially at lower difficulties where they have a mining handicap. One does not need 20 barracks or crypts when you can only keep 2-3 constantly producing.

If you want them to be tougher you are going to need to make them cheat. Such as resource bonuses, cheaper unit production, no upkeep, no food cap etc.

For the really best AI you will need to write an AI script directly with JASS. This can be confusing and certainly is not something for beginners. The AI editor AI is good enough to get a computer to do something, but is terrible when it comes to making them play well.
 
Level 12
Joined
Jun 15, 2016
Messages
472
You can make your ai train units faster even in the ai editor, it's just tedious work. The ai doesn't queue units, and will only start training one when it has the following: enough resources, a structure that is not currently training anything and food.

Let's say you want the ai to train 2 grunts and a shaman. If you train the 2 grunts first and have just one barracks, then the ai will start training one grunt, then only after it finished training it the second grunt and the shaman will start training. So if you want to make that happen faster you'll make your build order that way: 1 grunt, 1 shaman, 1 grunt.

That might not make a lot of sense but that's how it is...
 
Level 12
Joined
Jun 15, 2016
Messages
472
Custom JASS written AI can probably work around that.

Maybe if you play around enough with SetProduce(), but I don't think it was ever tested, or even needed in ai. After all, it has it's own sort of queue. I think the easiest way to speed things up real good will be to replicate the whole building arrays and common.ai building functions and create a faux building order for units from each building. Problem is each build order will require it's own thread.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
Maybe if you play around enough with
SetProduce()
, but I don't think it was ever tested, or even needed in ai. After all, it has it's own sort of queue. I think the easiest way to speed things up real good will be to replicate the whole building arrays and common.ai building functions and create a faux building order for units from each building. Problem is each build order will require it's own thread.
Unlike StarCraft II where the building queues are integrated, WC3 AI simulates them to some extent by adding them to an array an iterating through it.
 
Level 25
Joined
May 11, 2007
Messages
4,650
Put down 2 Undead players.
Set both team players to the same color with triggers.

Voilá, now you've got a bigger base and you can ignore the AI editor, it's pesky.
 
Last edited:
Status
Not open for further replies.
Top