0 Favourites

objects overlapping while moving (capx inside)

  • Example

    I'm making a RTS type of game, and when units move around with path finding, they overlapped on each other.

    So I gave them a physics behavior, which made them separate once they had arrived. Which was good, and even looks nice.

    However, when they're moving to their destination, they still overlapped on the way.

    So I made them Solid while moving and gave them the 8-move behavior so they knew it. Which actually works...

    Now they don't overlap, and they behave neatly.

    But it looks awful...

    When two solid objects are colliding, they push each other away. So my objects are twitching all the way to their destination (and then solid is turned off, or they twitch there too)

    Is there a way to achieve the same results but without all the twitching?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • i feel this post is gonna disappear in the void =(

  • what is happening now, is the objects are moving on a path to the destination, when they overlap the objects are trying to push eachother out (using physics or solid) but at the same time they want to keep following the path, result is bad movement, so you need an extra behavior - ai

    it is called "avoidance" but its something you should program yourself, there are not many or no examples of such behavior in construct, you can look it up on the web - rts avoidance, avoidance steering

    what probably should happen if a collision is going to happen (invisible trigger), one object should decide to hold/stop the pathfinder movement until there is no collision, if you want the objects to keep moving, while there going to be a collision, then you need to steer/direct the object to a place where there is no collison

    it will take alot of coding i think, but it can be done, but its pretty advanced

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