2D Collision Questions

Hi Aron ! great job on the library so far, keep it up !
Went with the PRO last year, however I didn’t need to use it until now, so since I’m just starting, I have a few newbie questions :slight_smile: My game is a top view 2D game, and I using the latest stable version ( not the beta ).

  1. What script should I use for multiple enemies moving in 2d ?
    If I use AIPath , it will give me errors, apparently it’s made for 3d only - or I can’t get it to work
    If I use AILerp , multiple units will pass through one another ( even if I add box collider 2d and rigidbody 2d )
    I know the 2d RVO is in early dev, so I’m not sure whether to ask for that or if I’ll run into bugs later.

  2. I’d like the player to move independently ( not staying on exact points on the grid ) , can it still be possible for opponents that follow the grid to move towards the player ?
    I’m thinking of finding the nearest grid point to the player and having a path to that point, would there happen to be a class for that ?

  3. Can I use different 2d colliders with the objects ? For example I’d need player projectiles to hit the AI controlled units.
    And the added question here would be : is there a way for me to add “knockback” or even an “explosion pushback” effect that would move the respective unit, and then it would go back on track ?

Thank you in advance

Hi

  1. Unfortunately in the beta there is currently no included movement script that both works for 2D and works with RVO. So you would have to write your own or modify the existing ones (not AILerp though, since it simply interpolates along the path, it would be very hard to get it to work with RVO).

  2. Sure, the target can be any point. Set Seeker -> StartEndModifier -> Start/End Point settings to the appropriate values. You do not need to find the closest point on the grid manually, however you can do so using AstarPath.active.GetNearest(point).

  3. You can use Unity physics settings to exclude collisions between different layers.
    For a knockback effect you should usually just be able to move the unit, possibly disabling movement while it is moving, but for the most part it should just work. (this is assuming you use the beta rvo however, the non-beta rvo will not like that at all).

Hi Aron, I’ll probably have more questions on this thread later, just wanted to say thanks for the reply :slight_smile: .

As a question that doesn’t mean to add pressure, I’d like to ask :
4 . Will we have a version of A* in the future working for 2d with proper agent movement ? How about RVO ? and if so… when ? :slight_smile:

5 . If I am to rewrite a part of your library for 2d -= I specifically need the RVO for 2d =- where would I start ? would it be an arduous task ? My estimation is that I’ll need to do that in about a year from now :slight_smile: .

6 . A bit offtopic : the game I’m working on now is 2d however uses your library with agents I’ve written. I plan the release on Steam Q1 next year. If my game raises to your quality standards, would it be possible for my game to be displayed on your “made with A*” games list ?

4, 5. Support for 2D RVO is already included in the beta version (not release candidate), see http://arongranberg.com/astar/download. It’s probably best to start with that one anyway since it has a bunch of other changes to the RVO system.

  1. Sure, that would be possible.