Hello Guest

Author Topic: Follower Algorithm  (Read 3018 times)

zeteginara

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Follower Algorithm
« on: February 24, 2014, 04:02:00 pm »
So, I'm making a 2D top-down RPG like Earthbound.

One hard thing that I can't really wrap my head around is the party-following system.  In Earthbound, your party acted kind of like a snake, with each character following the other perfectly, going around corners and such.  I'm attempting to recreate that, and I'm at a loss.  I might be over thinking it.

There are a couple ways I'm thinking of doing this:

1.  Each time the followee moves, record exactly how the object moved that frame, and have the follower move that much.  One problem I'd have to solve is to not send movements into collided objects, so that the party doesn't become 'bunched up'.  Not sure how to deal with that.

2.  Have each party follower execute an a* following algorithm on the followee.  This raises some performance red flags in my head, as well as tells me that it won't work quite right; distance would naturally form in the party and we still have the collision to deal with.

Again though, I might be overthinking this a lot.  Are there any examples in which this was done?