• 🏆 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] Help with Leaks & AI

Status
Not open for further replies.
Level 16
Joined
Feb 20, 2013
Messages
280
Just implemented AI to my map: http://www.hiveworkshop.com/forums/maps-564/conquest-v4-4-a-233660/?prev=status=a&u=terren05

Problem is, and i am not sure if this is related to AI only since i cant test with enough people, but when theres alot of AI, the game starts to have these mini freezes every few seconds. Tested it with a friend and he also have it, so not related to my computer. My initial theory was that it was leaks in my triggers causing this problem, so i set out to try and fix them. I cleaned out a few leaks, but saw no changes in performance.

Not sure why this problem is being caused. What i would like help with is, indentifying the problem, or and maybe go over all my triggers,(Not that many.) and try and fix leaks if thats causing the problem. If not, they would still need to be cleaned out, and i have not much experience in that field. You will be credited and +rep for you assistence.
 
My guess is that your AI is fine. If its working but has some lag, thats not an editor AI problem. Your problem might be leaks in other triggers. I can't dl your map right now. Try posting the triggers. Also, read "things that leak." If you use unitgroups, locations or playergroups this might be the problem. Leaks are fairly easy to fix. If you can't figure it out, someone here can help. Post the triggers and I can take a look. Remember to use [hidden="trigger][/hidden] tags.
 
Level 16
Joined
Feb 20, 2013
Messages
280
Anybody posting here, please download the map, start it up with 11 AI players, and wait a few minutes. Then suddenly you will start to have mini freezes, every few seconds, and after a while huge freezez, that last long time. I have noticed this occurs around when the build order tells AI to make this unit if it have this resource, but might be coincidence. Could you also just take a look at map and the triggers before posting and asking questions that could be anwsered that way. There are only 2 AI triggers, 1 to enable the script, and 1 to give AI some resources. Rest of triggers are income/control point, commands stuff, which i have tried to remove leaks in, and i belive i succeded, but still no diffrence in the lag problem, as most of these were minor leaks that occured rarely. If anybody could go through the triggers and clean out leaks, ask questions if you have any related to the trigger and what it's supposed to do, and see if that helps with the lag. I will try to make a test AI Script without conditions and see if that have anything to do with it.
 
Post the triggers with
and
  • tags. This will get you an answer fastest. Some people are on devices without TFT or WE and could help if they saw the triggers. Also, you are the one asking for help, you should provide the best way for people to help you. If you set rules for people to help you, they probably just won't bother. Did you read [URL="http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/"]this? [/URL] Do you have any unitgroups, locations, or playergroups?
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
The problem is caused by the AI being unable to find a suitable clear location to place a building or a clear path from its base (or where its army is) to a valid target. It gets into a performance intensive state as it tries to find a path or build location resulting in the game being forced to drop frames until the routine hits some sort of complexity limit.

The only solution is to make easy paths around the map (no blockages or islands) and give the AI a lot of space to build in while not requesting it build so much it runs out of space. Yes this is a problem with the standard Melee AI as well.

You can trigger this behaviour by putting any melee AI on an island where they lack enough room to build and cannot leave to attack the player. Insane AI are especially prone to this as they issue more actions and request more buildings.

StarCraft II also suffers this with its AI (or used to at least).
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
I imagine the best way to solve the problem is to restrict the number of buildings the AI makes to a bare minimum and throw in build speed bonuses (from a trigger systems) to allow a building to act as multiple copies. So instead of building 2 slaughter houses, you build 1 but halve the time it takes to make units by setting the starting progress of the unit to 50%. This will reduce the number of buildings needed while still giving the AI the same production power.

Turn off any form of AI army attack routine if you plan on placing him in an island. Instead use trigger scripts to get the AI to load into transports and unload on the landmass of the enemy before issuing attack routines. This is highly complex to do so is why most maps avoid dealing with that.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
TriggeringUnit should get the unit that starts training. Remember that the unit being trained only exists once training is complete.

Try either of
UnitSetUpgradeProgress
UnitSetConstructionProgress

Hopefully one of them changes current training progress. Otherwise you will need to create a second unit every time the AI trains 1 unit and remove the resources using triggers.
 
Status
Not open for further replies.
Top