User Tag List

Results 1 to 10 of 10

Thread: Need help with Top Down Zombie AI

  1. #1
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)

    Join Date
    May 2016
    Location
    Canada
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Need help with Top Down Zombie AI

    Hello everyone.

    I created a simple game where there is an Active object (the player) and it has custom 8 directional movement and it is unable to pass through Active objects I give the "obstacle" qualifier to.

    I now want to add zombies. I want them each to have their own circle, and once the player is in that circle, the zombie will chase them.

    I also want to make the zombies smart enough to walk around buildings to walk through entrances like the player would have to, as opposed to them trying to walk through walls and getting stuck.


    I don't know how to give each zombie it's own separate circle that follows it to detect when the player is inside it, and I don't have a clue on how to make path-finding for the zombies, especially in a non-grid format.


    Any ideas?

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Gradius's Avatar
    Join Date
    Jul 2015
    Posts
    117
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Checking the distance from the player to a zombie and getting the zombie to react can be easily achieved using the Advanced Direction Object (check the example files that come with the object for help), but path finding is a little more involved. A user named Erkabubben made a very cool example which might help get you started, you can download it from this thread: https://community.clickteam.com/threads/90084-Multiple-pathfinding-with-Pathfinding-Object?highlight=multiple+pathfinding

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module
    Nippe's Avatar
    Join Date
    Oct 2011
    Location
    Sweden
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by CheatingPenguin View Post
    I don't know how to give each zombie it's own separate circle that follows it to detect when the player is inside it
    Connect a circle to a zombie by storing the ID of the zombie as an alterable value for the circle. This way you can always refer to the "parent" in events related to the circle.

    Use ForEach loops to loop through multiple zombies.

    Check out my Example: example_zombieparent.mfa

  4. #4
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)

    Join Date
    May 2016
    Location
    Canada
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Nippe View Post
    Connect a circle to a zombie by storing the ID of the zombie as an alterable value for the circle. This way you can always refer to the "parent" in events related to the circle.

    Use ForEach loops to loop through multiple zombies.

    Check out my Example: example_zombieparent.mfa
    Thanks, I took a look at your example at it almost worked perfectly, except there was one issue.

    I did a test to give each zombie a circle that turns orange when the player is touching it, and reverts back to black when the player leave it.

    Currently, if the player walks from one circle to another without ever leaving either circle, both circles will remain orange until the player isn't touching any circle at all.

    Here is a clip I took so you can see what's going on: https://i.gyazo.com/03c52afd47de60cb...64f1186dd7.mp4

    Any ideas?

    Thanks for the help

  5. #5
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)

    Join Date
    May 2016
    Location
    Canada
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Gradius View Post
    Checking the distance from the player to a zombie and getting the zombie to react can be easily achieved using the Advanced Direction Object (check the example files that come with the object for help), but path finding is a little more involved. A user named Erkabubben made a very cool example which might help get you started, you can download it from this thread: https://community.clickteam.com/threads/90084-Multiple-pathfinding-with-Pathfinding-Object?highlight=multiple+pathfinding
    Thanks, I've looked at it a bit and it seems very confusing.

    I'll toy around with it a bit and see how it goes.

  6. #6
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)

    Join Date
    May 2016
    Location
    Canada
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe I fixed the issue just by removing the "If Player isn't overlapping the Circle" event.

  7. #7
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)

    Join Date
    May 2016
    Location
    Canada
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay so I took a look at the path-finding example by Erkabubben and modified for real-time path-finding by zip2kx and managed to import their method into my game.

    I modified it a bit so the cells are 16x16 instead of the default 32x32 in the example.

    Everything seems good, except the real-time path-finding chooses to avoid narrow spaces and instead wants to take the long way around to get to the player.

    Here are two short clips demonstrating this:
    https://i.gyazo.com/55bf6d6bbf28528c...ce80661a02.mp4
    https://i.gyazo.com/cd3b2a8c40bb7311...6ef06b50d5.mp4


    I don't understand why the path-finding events are scared to go in narrow spaces and really would appreciate it if somebody pointed me in the right direction.

    If it helps, here is my .mfa file:
    http://www.mediafire.com/file/e5y6t3...d5/Example.mfa

    Thanks!

  8. #8
    Clicker Fusion 2.5Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    zip2kx's Avatar
    Join Date
    Jun 2015
    Posts
    780
    Mentioned
    17 Post(s)
    Tagged
    0 Thread(s)
    If this is the example i uploaded it's a bit broken sadly. Also doublecheck the hotspots of your objects, especially the obstacle tester object and see if the hotspot is set to 0,0.

  9. #9
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)

    Join Date
    May 2016
    Location
    Canada
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I checked and made the "pathfinding_playerpos" object have a hot-spot of (0,0) and checked the "pathfinding_obstacle_tester" object but the hotspot was already (0,0).

    I'm getting the same results, any other suggestions?

  10. #10
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)

    Join Date
    May 2016
    Location
    Canada
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, if anybody has an example of path-finding that is commented out so I could understand, please share it with me. I'd really appreciate it!

    I don't fully understand the method I'm currently using so it's hard for me to fix issues with it.

    Thanks

Similar Threads

  1. Zombie ai help needed
    By Noziaaa in forum Fusion 2.5
    Replies: 2
    Last Post: 28th November 2016, 08:55 PM
  2. Zombie AI?
    By Pixzel in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 25th November 2012, 06:51 PM
  3. Zombie Swarm
    By Sumo in forum SWF/Flash Export Module Version 2.0
    Replies: 4
    Last Post: 30th October 2011, 11:54 AM
  4. Zombie AI
    By jhonson in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 28th October 2008, 12:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •