Physics + platform + pathfinding Coctail

0 favourites
  • 5 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Hi!

    I'm working on a physics based platformer where enemy bot follows player climbing on a solid rock. I'm trying to write some AI to make bot follow a player and avoid obstacles by jumping but it's harder than I though. Is there any examples of using pathfinding methods in a Physics world?

  • It's not recommended to use Physics together with other non-physics behaviors, but it's possible if you do it with caution.

    If you are using Platform or similar behavior to move an object, make sure that Physics behavior on this object is disabled. And when Physics is enabled, disable Platform. Don't move objects with enabled Physics using non-physics methods or by changing their position directly (like "Set X", "Move at angle").

    .

    Pathfinding plugin doesn't work well in platformer games, it's better suited for top-down view. Making enemy AI in platformer can be a tricky task, you can search the forum for some examples, try these links:

    construct.net/forum/construct-2/how-do-i-18/-how-do-i-frequently-asked-que-41236

    scirra.com/store/royalty-free-game-templates/super-platformer-ai-2462

  • Thank you very much for your answer and useful links!

    I had to refuse to use Pathfinder as it is inadequate in the physical world.

    I also refused to use Platform, cos my bot have to physically interact with other objects during the move.

    I realized the movement by increasing the speed of the bot (it just jumps all the time). I have no idea how to use force for movements(as many people advice). Using impulses was not smth I was looking for cos it's too complex to control.

    However, there is a very good plugin for implementing the movement if you can't use custom moves or platform: rexrainbow.github.io/C3RexDoc/plugins.md/site/rex_rotateto/index.html

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Rex's RotateTo addon is still incompatible with Physics. You should try using only Physics actions to move Physics objects. For example, for rotation use "Set angular velocity".

    Impulse is a momentary thing, like kicking a ball. You apply it once.

    Force is continuous, like pushing a box. You need to apply it on every tick.

  • Rex's RotateTo addon is still incompatible with Physics. You should try using only Physics actions to move Physics objects. For example, for rotation use "Set angular velocity".

    Impulse is a momentary thing, like kicking a ball. You apply it once.

    Force is continuous, like pushing a box. You need to apply it on every tick.

    I didn't use Rex's RotateTo and I was upset I had not found it before. But as it's not compatible with Physics it turns out that everything was not in vain =)

    Thanks for this additional info!

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