How do I create enemies with more precise movement?

0 favourites
  • 5 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • I'm trying to create enemies that are following simple waypoints.

    Why are my enemies' movements slowly becoming more inconsistent over time when using MoveTo behavior?

    See the video link example

    streamable.com/yv9ilh

    (acceleration/deceleration is 0 and speed 150)

    Is there a simple way to create enemy waypoint movements that are more precise?

  • In general most behaviors the motion is good enough, but seldom 100% precise. I think what happens is the moveto behavior discards the overshoot.

    Anyways, here's a way to do near perfect path motion so the object's stay spaced the same. They are transparent and next to each other so if it would show desync if it happens. Additionally you can toggle that disabled action to avoid even more numeric drift.

    The gist is it moves in direction of a waypoint, and when the waypoint is passed it carries over the extra motion when it moves toward the next node.

    dropbox.com/s/5bg83cgrpv9k8tn/node_path_follow2.capx

    Edit:

    And the idea can be taken further. This one supports any speed.

    dropbox.com/s/vow1i2x2rcteee6/node_path_follow3.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is your target sprite origin in the right place? Or are you targeting an image point?

    If you use move to direct and handle your own waypoints, it should be more precise, but they'll slow down and stop at each waypoint.

    Otherwise if you need precision you can try using tween instead, which will be exact.

  • Is your target sprite origin in the right place? Or are you targeting an image point?

    If you use move to direct and handle your own waypoints, it should be more precise, but they'll slow down and stop at each waypoint.

    Otherwise if you need precision you can try using tween instead, which will be exact.

    Is it possible to send me an example, using tween behaviour instead to create waypoints?

  • In general most behaviors the motion is good enough, but seldom 100% precise. I think what happens is the moveto behavior discards the overshoot.

    Anyways, here's a way to do near perfect path motion so the object's stay spaced the same. They are transparent and next to each other so if it would show desync if it happens. Additionally you can toggle that disabled action to avoid even more numeric drift.

    The gist is it moves in direction of a waypoint, and when the waypoint is passed it carries over the extra motion when it moves toward the next node.

    https://www.dropbox.com/s/5bg83cgrpv9k8tn/node_path_follow2.capx?dl=1

    Edit:

    And the idea can be taken further. This one supports any speed.

    https://www.dropbox.com/s/vow1i2x2rcteee6/node_path_follow3.capx?dl=1

    Thank you! I will look into these examples.

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