GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Enemy Movement/Patrols and chasing

Hey Guys,

I have been searching the forums on enemy movement and patrols. Lots of info, some dating back a few years. Wondering if anyone can tell what the best and mont efficient way to handle enemy moment in the current game salad.

Currently I am using very basic patrols and movement for my RPG ...this is how I am currently do int ( )

However I sometimes run into problem with my enemy getting stuck between walls, trees etc. For some of my enemies this works great, but others not so much.

I guess what I am asking, what is the current best practice to achieve a smooth enemy chase behavior in and RPG game with obstacles.

Comments

  • IceboxIcebox Posts: 1,483Member
    edited June 2016

    Jamie mentioned in the video that it has limitations minute 17:00 , your actor might get stuck and he showed a method to avoid that as much as possible. I think pathfind gives smooth enemy chase im not sure and i dont know how to use it :) but you will find tutorials and templates i think. This method should work, its easy to do and you can do adjustments to make sure your actors dont get stuck.

  • jamie_cjamie_c ImagineLabs.rocks Posts: 5,541Member

    Yeah, that tutorial is pretty simple and basic but should work if your map is not too congested with blockage. In it I use circular collision shapes on the scenery items and enemies so they will kind of 'slide' around each other and not get stuck on corners. You might be able to plan your maps so things don't get hung up, it may just take some time to get it right.

    If you want more advanced pathfinding you'll probably need to look into the A* pathfinding like @Icebox mentions above.

  • RThurmanRThurman Posts: 2,824Member, Sous Chef, PRO
  • jamie_cjamie_c ImagineLabs.rocks Posts: 5,541Member
  • quinn221quinn221 Posts: 280Member

    @Icebox and @jamie_c I do understand it is basic and has litmations and Jamie I think you are right, I can get it to work if I plan out the maps. I want to find out more about pathfinding, but most of the links I click on are broken. I have been looking for a basic tutorial on it but have not found one yet. A few months back saw one, but now I can't find it

    @RThurman is is cool, going to have to look more into it!

  • RThurmanRThurman Posts: 2,824Member, Sous Chef, PRO

    @quinn221 -- Yes its pretty fun stuff. You also might want to check out @Socks entry that is just two comments down from mine. He shows some really fun examples.

    For me, the idea is to give actors their own personalities, quirks, and habits. Then the user can exploit those subtile quirks to manipulate the outcome of the game. (Or at least to stay alive for a little longer.)

    This is what gave Pac-Man its really cool vibe -- even though you were on the edge of panic, if you stayed cool and collected you could exploit the ghost's quirks to live another two minutes.

    “This is the heart of the game. I wanted each ghostly enemy to have a specific character and its own particular movements, so they weren’t all just chasing after Pac Man in single file, which would have been tiresome and flat.” -- Toru Iwatani, Pac-Man creator

Sign In or Register to comment.