User Tag List

Results 1 to 4 of 4

Thread: making enemy avoid obstacles without pathfinding object?

  1. #1
    Clicker Fusion 2.5Android Export ModuleFirefly 3D Module

    Join Date
    Sep 2010
    Posts
    577
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    making enemy avoid obstacles without pathfinding object?

    Hey! In my game I'm making (Action RPG) I have been able to make the enemies chase after the player and attack him when close enough. Sometimes resulting in various conditions for the player as well, like poisoning for example. I searched through the forums but couldn't find exactly what I was looking for.If I walk away from the enemy and stand behind a tree or a fence or whatever, the enemy keeps walking and walking against the tree/fence as it tries to walk through it.

    I solved this with a bunch of, probably un-necessary ("If player position is... + enemy position is.....") then I put an object to the left or right of the tree/fence for the enemy to follow instead, and on collision with that object he returns to follow the player. It works pretty good but it is extremly much work if you have a frame with lots of obstacles and many enemies. I guess everybody will say "Use the pathfinding object" but I can't understand anything about that D**n object hehe...I'm completely lost with it. Is there a better way for me to make the enemy avoid obstacles or is my method the only non pathfindingobject way? I'm asking now before doing more un-necessary coding

    Thanks!

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A very basic algorithm is to use line of sight, record the last place that the enemy could establish line of sight, and then create a node at the location. Move the enemy towards that node, and once it's reached, try to establish 'line of sight' again and repeat.

    It's somewhat more realistic because the enemy would lose sight of a player rather than having a kind of 'ESP' allowing them to navigate to the player flawlessly regardless of line-of-sight.

    The drawback is lots of enemies will all bunch up around the nodes, rather than move in a group-like behaviour like the flocking object can achieve. Also enemies will act kind of dumb if they can't establish line of sight, rather than investigate further down the hallway to determine possible locations of the player, so you may need to create some predefined patrol paths that enemies can adapt to if they lose line-of-sight.

  3. #3
    Clicker Fusion 2.5Android Export ModuleFirefly 3D Module

    Join Date
    Sep 2010
    Posts
    577
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Not sure what to do really haha but thanks for the answer

  4. #4
    Clicker Fusion 2.5 DeveloperSWF Export Module

    Join Date
    Sep 2006
    Posts
    511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't quite get the pathfinding object either.
    Sounds like you already have a solution.
    Maybe you should group your objects to make it so you only have to do the rules once.

Similar Threads

  1. Pathfinding Object - Setting Actives as Obstacles
    By Catastrophic in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 8th May 2014, 12:08 AM
  2. How do I avoid that an object(ball) goes through the obstacle?
    By ineke in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 17th October 2012, 01:30 PM
  3. Making obstacles that move
    By ac3raven in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 20th July 2011, 01:15 AM
  4. pathfinding - detecting obstacles professionally
    By integrality in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 22nd October 2006, 01:02 AM
  5. Making unchanging enemy id's
    By LazyCoder in forum File Archive
    Replies: 4
    Last Post: 24th September 2006, 05:36 AM

Posting Permissions

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