SC2Mapster Forums

Development > Triggers

Triggers and AI pathing

  • 13 posts
    #1 Nov 11, 2012 at 09:44 UTC - 0 likes

    I've been working on a map and have even reworked the layout a few times. Even have reworked the regions and points.

    I've tried both periodic events and ordering units in a region to attack to a point then that points in a new region and that region tells them to attack to the next point and so forth. Also I have tried to add the last created units to a group and issuing orders to them and then the next point after existing and so forth without periodic events or using unit enters region.

    However, they wont pass point "Attack 10" on the attached map even if I tell them to attack to point "Attack 11" or further. Then they will run back to their spawn then to point 10 then point 5 and sit there.

    I am trying to accomplish them to attack from point 1 to 2 to 3 and so forth with enemy buildings in their path and not break.

    Layout

    So my question is how to do I make smarter AI that can go from A to B to C... In SC1 it worked with no questions asked and in SC2 its apparently not that simple @_@.

    Thanks for the help

    #2 Nov 11, 2012 at 11:25 UTC - 0 likes

    The maps isn't exactly posted so we can't see the triggers, however there are several general things to correct this. I would first check to make sure that the point are saved into an array in the correct order without any repeats. If you want to stay away from trigger events, use an action defintion and a loop to issue order to each point as per the array; if needed you can have a wait action after to check until the unit is at the next point or general region and again just your premade loop to determine the next point in order. I might also just a while condition to make sure the unit is alive. Then again is almost sounds like your issue is more like an accidental pathing block or an incomplete loop.

    Last edited Nov 11, 2012 by hobbidude

    When I want your opinion...I'll give it to you!

    http://www.sc2pod.com/achievement.php?id=13361

    #3 Nov 11, 2012 at 11:45 UTC - 0 likes

    Since last time my explanation attempt failed miserably, this time while I was bored had made a map with more practical explanation. (Still it can make you confused since there is no comments between triggers and stuff.. Anyone else may find time for that and at the same time be clear what they want to say)

    Last edited Nov 11, 2012 by TwoDie
    Name Size MD5
    MoveLabyrinth.SC2Map 131.7 KiB 7614a3253cc7...

    http://img27.imageshack.us/img27/8882/abasizedr.jpg

    #4 Nov 11, 2012 at 20:46 UTC - 0 likes

    The problem isn't with them going from point to point, that works fine. Throw enemy units, structures (that block their path to the next point) that they have to attack to break after a while something goes wrong and they get to a certain point then just decide to turn around.

    @ TwoDie, it happened on your map as well when buildings were added to slow them down that they had to kill to move on.

    My Map

    It has nothing added to it but the initial spawn a few hundred lings, order them as a group called Zerglings (my names are clever) and tell them to attack point to point killing anything in their path. Oh their damage is 35000 just to speed things up.

    Name Size MD5
    Labyrinth.SC2Map 60.1 KiB fa51edb7e268...
    #5 Nov 11, 2012 at 22:15 UTC - 0 likes

    Heh I see now... my suggestion would be Laggy one but try making for every idle unit order to attack nearest building or to move to point and then search for buildings. (will try experimenting tomorrow with this issue more if required still)

    #6 Nov 11, 2012 at 22:44 UTC - 0 likes

    I was thinking of something like that for idle units but didn't want to cause the game to crap out cause it had to grab each unit and compute distances.

    SC1 AI was a lot easier and better than SC2s... You think with 10 years of dev time they would have improved things not made them worse D:!

    EDIT: So I can have them ordered to attack from start to finish and they will perfectly do so. But throw in buildings that block their path and its just a giant hiss fit. I feel like it has something to do with their pathing and it being blocked but not really sure.

    EDIT2: Ran it with no buildings. Built some that didnt completely block their paths and they acted normal but if I built a row of structures that blocked their path then they couldnt figure out what to do.

    Last edited Nov 12, 2012 by RogueSniper
    #7 Nov 12, 2012 at 10:40 UTC - 0 likes

    Have been experimenting and done now that if entered the region they will gain orders to move forward than current region so managed them to Loop between 10 and 11 regions :/ Mostly likely you need to remake map layout and make more liner and less corrners on it. Set one specific size ramps which makes paths, mostly likely they search then for nearest path to point and they go arround all the map to reach small gaps between them and reaching point..

    Name Size MD5
    Labyrinth.SC2Map 80.9 KiB 8f82a0605513...
    #8 Nov 12, 2012 at 20:04 UTC - 0 likes

    Well Ill work on the layout, but I was hoping not to have a bland layout but if thats all I can do to get the AI working correctly then I guess Ill have to. Now I see why no one's remade any Volcano/Tsunami/Lava run maps from SC1. D:! I got so far on the data just to have the AI hate me...

    I might just scrap it until HotS or LotV(protoss one) to see if they updated the AI, but probably not knowing blizzard.

    Thanks for all the help though, just too bad we couldn't have the AI from SC1 which worked just fine.

    #9 Nov 12, 2012 at 20:32 UTC - 0 likes

    Well we havent tried all our chances to make that work. Still there is a chance with making AI Computer Player using attack waves to order units to go through that path or even other options in this matter.

    #10 Nov 12, 2012 at 21:21 UTC - 0 likes

    Okay thought of something what if X amount of units reaches a point. They die and a new trigger is ran that says spawn at the new point where all your friends died and then attack to the next point(s) then repeat essentially causing those already existed to die and no longer have orders that causes them to be confused.

    I dont know how well this would work though. Imma see if I can do something like this and test its capabilities.

    #11 Nov 12, 2012 at 21:31 UTC - 0 likes

    @RogueSniper: Go

    not seems like you inventing something new here. But after reading your post though about idea of passed points build a blocker behind the units so they would be trapped by buildings behind and in front only they couldnt go back because it wouldnt be breakable and at the same time invisible wall?!.

    Last edited Nov 12, 2012 by TwoDie
    #12 Nov 13, 2012 at 00:12 UTC - 0 likes

    Well I tried it and got them to get to Attack 12 but throw any new buildings in their way and they try to go back to their previous point even though they were told to patrol or attack to the next point...

    EDIT: Trying the invulnerable walls to see if that helps.

    EDIT2: adding walls after reaching the region before the target point works. Invulunerable walls causes them to move up regardless of whats in their path and what their path is (usually straight)! YAY @_@ So happy.

    Thank you x100000.

    It may not be pretty or efficient but it works and thats all i care about

    Last edited Nov 13, 2012 by RogueSniper
    #13 Nov 13, 2012 at 07:06 UTC - 0 likes

    Glad that helped. :)

  • 13 posts

You must login to post a comment. Don't have an account? Register to get one!