RTS movement + Collisions

This forum is currently in read-only mode.
From the Asset Store
Run and Jump in 3 Dimensions! Take your platformer to the next level!
  • Hello everyone!!!

    I am developing a TDS game, and i faced a problem with collision detection. I will try to explain the problem.

    I have a player, and some enemies. What i want - to make a sort of AI, so when enemy sees the player, he will start moving to player's position. The problem is that RTS movement behavior does not have collision checking, so the enemies' sprites overlap each other, as well as the player. Can you recommend me any solution to this problem?

    Thanks a lot.

  • Turret behavior perhaps?

  • You can use Custom Movement's collision checking... (maybe custom movement's "push out" controls hold the key you're looking for?)

    Also, setting "object type to avoid" in RTS behaviour, with the object to avoid being the object its-self might give you a "good enough" result.

  • Thanks for the answers.

    I tried "object type to avoid" but the result is not that good, push out also did not help.

    Is there any way to use Physics and RTS together?

    I seached the forum but did not find any good example of a TDS game. Could you help me to find one?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • hmm. Just tried the custom movement "bounce" action. Actually gave a better result than push out, you should try that.

    Edit: I don't think physics behaviour is really compatible with any other movement plugins...

    Edit: Nevermind, bounce gives pretty poor results with lots of units.

  • Thanks, but now i have a different problem. Bounce works realy well with squares, but when i apply it to my sprites, it does not work. How can i solve it? Can i use some kind of custom collision mask as in Physics behavior?

  • A custom (square?) collision mask or bounding box might solve the problem. (Yes you can).

  • The problem is that RTS movement behavior does not have collision checking, so the enemies' sprites overlap each other, as well as the player

    You should check the "Solid" attribute on both player and enemy sprites.

  • Actually "object type to avoid" is the best way to go, but it wont help any if you don't change the cell size to bigger than the sprite.

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