Jump to content
  • 0

Need help with algorithm


Kenix

Question

12 answers to this question

Recommended Posts

  • 0

He means that, if the Player is on the Other Side of the Wall the Zombie just ignores the Wall and is just running in it.But Kenix wants to make the Zombie to go Around the wall and then attack the player..

( i don't know if it's even possible )

Link to comment
  • 0

Track the zombie movement, if it doesn't get any closer to the player in certain amount of time like 5 seconds check if the line of sight is clear https://wiki.multitheftauto.com/wiki/IsLineOfSightClear

If it is not clear force the zombie to check which side is better to avoid the object from, see how much free space you got on each sides, left and right.

In you picture there is more space on left so zombie goes there and gets around the box. Just force the zombie to go left untill it can get closer to the player again.

Not the best method but should work :D I used the same method in my A.I. Snake to make it avoid itself.

http://tg-mta.net/snakeyT/snake.html

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...