Best way to create movement path

0 favourites
  • 7 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • Hi all, I need to create hundreds of paths to move objects around my square play area. What is the fastest way to create them while also being less demanding of computing power? For example, if I create 100 timelines, are they more energy intensive than 100 tilemaps with pathfinding? Thank you!

  • Ashley likes to post this link:

    construct.net/en/blogs/ashleys-blog-2/answer-own-performance-925

    I imagine with hundreds of moving objects the performance will not be very good with either method. You might want to think of some ways to optimize this.

  • Ashley likes to post this link:

    https://www.construct.net/en/blogs/ashleys-blog-2/answer-own-performance-925

    I imagine with hundreds of moving objects the performance will not be very good with either method. You might want to think of some ways to optimize this.

    Hi, My mistake, I meant to say that I have to create 100 movements, but only 5 works at a time with a maximum of 5 objects moving at the same time.

    So, it makes no difference whether you use one or the other technique in terms of the resources the processor uses?

  • If only 5 objects will be moving at a time, then you shouldn't worry about the performance. (unless you notice issues with it)

    But there is another question - if you need 100 different routes, how do you conveniently create and store them? Making them by hand and saving as timelines, for example, is going to be a tedious task.

    In the game I'm currently making, I am storing NPC routes in a JSON file as a list of waypoint coordinates. I made a small "route editor" project for that.

  • If only 5 objects will be moving at a time, then you shouldn't worry about the performance. (unless you notice issues with it)

    But there is another question - if you need 100 different routes, how do you conveniently create and store them? Making them by hand and saving as timelines, for example, is going to be a tedious task.

    In the game I'm currently making, I am storing NPC routes in a JSON file as a list of waypoint coordinates. I made a small "route editor" project for that.

    Can you give me some advice on how to make one or if there is any tutorial or guide. Thanks ☺️

  • You mean the route editor? Its interface may be very simple like: on "A" key pressed create a waypoint sprite under mouse cursor, on "D" key destroy a waypoint sprite under mouse cursor. And the sprites have drag&drop behavior, so you can move them.

    Then press a button to export all waypoint sprites to a string of coordinates. The resulting string may look like this, each pair of numbers representing waypoint X and Y:

    100,100;120,200;200,120;300,300

    Or it can be a JSON array:

    [{"x":100,"y":100}, {"x":120,"y":200}, {"x":200,"y":120}, {"x":300,"y":300}]

    Then in your main project you need to parse these strings or split them using tokenat() to extract these coordinates.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You mean the route editor? Its interface may be very simple like: on "A" key pressed create a waypoint sprite under mouse cursor, on "D" key destroy a waypoint sprite under mouse cursor. And the sprites have drag&drop behavior, so you can move them.

    Then press a button to export all waypoint sprites to a string of coordinates. The resulting string may look like this, each pair of numbers representing waypoint X and Y:

    100,100;120,200;200,120;300,300

    Or it can be a JSON array:

    [{"x":100,"y":100}, {"x":120,"y":200}, {"x":200,"y":120}, {"x":300,"y":300}]

    Then in your main project you need to parse these strings or split them using tokenat() to extract these coordinates.

    Hi, I am creating my movement system. The movements I need horizontal, vertical and obligual.

    I have created a grid with tilemap and each tile is 16x16 px.

    I am now asking two things:

    - How do I know which tile I have clicked?

    - How do I colour a tile differently when I mouse over it?

    By doing this I make a long vertical line, a horizontal line and an obligatory line appear on the clicked tile so it is easier for me to create the movements.

    Eventually I will make the code available to everyone.

    I'm a beginner and I'm eager to learn.

    Thank you all

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