User Tag List

Page 4 of 4 FirstFirst ... 2 3 4
Results 31 to 36 of 36

Thread: Is there any competent Zombie AI?

  1. #31
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    668
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    here's what i meant:
    Attached files Attached files

  2. #32
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,183
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by casleziro View Post
    here's what i meant:
    Ah nice thanks!

    This is starting to become a really solid example of zombie AI I think and a huge help! Is it possible you, MuddyMole or someone else could put in some comments in the events of what the events do? I want to study this and learn it so I can work from all this later and know what is actually going as I have never done these kinds of movements or events before and need to really try to learn it inside out.

    The only obvious thing I see missing now is a good way to adjust the "layering" of the zombies on the fly so that the ones that have the greatest Y cordinate are in front of the ones with the lesser Y cordinate. What would be the best method to do this? Should the layer object be used for it, or is that unnecessary?

    I guess it could be done with just running a constant fastloop for every Y cordinate from top to bottom and then if it finds a zombie at that Y cordinate it puts it in the front, but that sounds really slow for performance and not an optimal method?

  3. #33
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,329
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    https://1drv.ms/u/s!Atq7cUIJ7uexnzmN...rlFLn?e=GvYNrY

    To be honest, there's a LOT that could be changed to make it smoother and less buggy, but it was really just to demonstrate the basic idea.
    And yes, the layer object is your best bet for sorting, even though it's not great.

  4. #34
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,183
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MuddyMole View Post
    https://1drv.ms/u/s!Atq7cUIJ7uexnzmN...rlFLn?e=GvYNrY

    To be honest, there's a LOT that could be changed to make it smoother and less buggy, but it was really just to demonstrate the basic idea.
    And yes, the layer object is your best bet for sorting, even though it's not great.
    Thank you!

    I noticed though that the Layer object is in the frame now but there is no event on it?

    What sort of things could be adjusted to make it smoother and less buggy and are they hard to do if I learn how all this works?

  5. #35
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,329
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Oh, I never meant to leave that extension there (was just checking something).
    Well, it's really more a lot of ideas that could be tried - some of which might help; some of which might make it worse...

    For example, I've been experimenting a bit with collision-detection between circles and map tiles (stored in an array), using maths rather than any built-in method. It's pretty maths-heavy, but the nice thing about it, is that you can find the precise point at which they collide, which could be useful in various ways. For example, you could easily get the surface normal, to make the zombie turn the right way to avoid walls (or for making objects bounce realistically off walls). You could also take the distance into account when prioritising zombie behaviours - so if a zombie is very close to a wall, avoiding the wall will be its top priority; if it's a little further away, avoiding the wall and avoiding other zombies will have equal priority; if it's very far away, avoiding zombies and moving towards the player will be top priorities.

    As I said before, I'd try to create vectors representing various "forces" that determine where a zombie moves, and then multiply them by their priority rating, before adding them all up to get a final movement vector.
    eg.
    - CurrentMovementVector
    - VectorTowardsPlayer
    - VectorAwayFromZombie (one vector for each nearby zombie)
    - VectorToAvoidWall

    That part should be relatively easy as long as you have a reasonable grasp of vectors (eg. know what a unit vector is, how to find the length of a vector, how to multiply a vector by a scalar, etc).

  6. #36
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,183
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MuddyMole View Post
    Oh, I never meant to leave that extension there (was just checking something).
    Well, it's really more a lot of ideas that could be tried - some of which might help; some of which might make it worse...

    For example, I've been experimenting a bit with collision-detection between circles and map tiles (stored in an array), using maths rather than any built-in method. It's pretty maths-heavy, but the nice thing about it, is that you can find the precise point at which they collide, which could be useful in various ways. For example, you could easily get the surface normal, to make the zombie turn the right way to avoid walls (or for making objects bounce realistically off walls). You could also take the distance into account when prioritising zombie behaviours - so if a zombie is very close to a wall, avoiding the wall will be its top priority; if it's a little further away, avoiding the wall and avoiding other zombies will have equal priority; if it's very far away, avoiding zombies and moving towards the player will be top priorities.

    As I said before, I'd try to create vectors representing various "forces" that determine where a zombie moves, and then multiply them by their priority rating, before adding them all up to get a final movement vector.
    eg.
    - CurrentMovementVector
    - VectorTowardsPlayer
    - VectorAwayFromZombie (one vector for each nearby zombie)
    - VectorToAvoidWall

    That part should be relatively easy as long as you have a reasonable grasp of vectors (eg. know what a unit vector is, how to find the length of a vector, how to multiply a vector by a scalar, etc).
    Ok thanks! , I have actually never heard of movement vectors as far as I know. Do you have any pointers on where to start learning about it? Examples or tutorials etc?

    As for the Layer Object, would just an always event that sort by Decreasing Y do it? It works, but not sure if there is a better way to do it?

Page 4 of 4 FirstFirst ... 2 3 4

Similar Threads

  1. Need help with Top Down Zombie AI
    By CheatingPenguin in forum Fusion 2.5
    Replies: 9
    Last Post: 2nd April 2018, 01:09 AM
  2. Does this module have competent gamepad implementation?
    By Alpha17x in forum Universal Windows Platform Module 2.5
    Replies: 3
    Last Post: 31st July 2016, 09:52 AM
  3. Zombie AI?
    By Pixzel in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 25th November 2012, 06:51 PM
  4. free zombie
    By willow in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 2nd November 2010, 08:38 PM
  5. 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
  •