How do I avoid collisions between similar Objects in Real-Time?

1 favourites
  • 2 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • Hi,

    I checked lot of C3 Demo Games in the last hours, but the main Problem for RTS Games remains.

    Still objects cannot avoid colliding with other object during moving a pathfinding path.

    Is there any working solution available?

    PS: In Unity, this is a simple behaviour for one or groups of objects.

    Best Regards :-)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Best I can come up with is a custom solution. Basically we’ll need a way to follow a path even if the object is pushed off the path. The path finding behavior kind of has a fixed path that the object follows so that’s not usable as is.

    If the units are moved with say the physics behavior they can push each other out of the way. Then to move along a path you change the velocity as needed. It’s simpler said than done but the concept is called “steering behaviors”. There’s one that steers to follow a path but I haven’t implemented a working solution of that yet. Another idea is to divide the map into a grid and do a flood fill from the goal to the other grids. Each time you store the direction from the previous grid position. So what you essentially get is a path from all grid locations to one. Then you can just set the velocity based on where the object is positioned.

    There are other solutions too. But nothing super simple comes to mind with the tools construct provides.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)