Best components/graph/avoidance for 2D 'castle crashers' style game

  • A* version: 5.4.4

  • Unity version: 6.0.58f2

I’m struggling to find the right methods to achieve the movement I want in my game. It’s a 2D sidescroller with sprite sorting on the y axis. You control one character at a time. Currently I’m using recast graph, seeker, and followerEntity with local avoidance. Speficially, I’m having trouble with local avoidance. A few of the issues I’m having:

  • I’m getting a lot of sliding behaviour at the end of movement. Especially when moving on the y axis. See video.
  • Since followerEntity (and the other components, unless i’m missing something) rely on radius to represent character size, and my characters footprints are much wider than they are tall, I’ don’t know how to get good ‘stacking’ of characters in space. I.e. if the radius is too small, characters will get too close and intersect on the x axis, while too big, and they will have to move too far apart on the y axis.
  • I also get alot of this jarring slowdowns, speedups and ‘pendulum’ bounces, while the agent tries to find its way around nearby characters (see video 0:19-26). Unless other entities are moving, I need movement to be flawless - in this case both the sheep and the shepherd in white was static, and still they tried (somewhat ineffectively) to move out of the way, even though the player character should just have moved beneath them both - there was no need to go through them.

Maybe I have to create my own custom classes to have all of this work as i need it to? If anyone is available to lend some knowledge, I’d be deeply appreciative. Settings screenshots and video attached.

Try using Position Smoothing for these issues

I looked but I dooon’t think there’s much of a solution to this built into A*, except for…

This :smiley: There’s this information in the docs for how to build a movement script instead of using the built in one.