klen11's Forum Posts

  • 6 posts
  • The grid is 10x10.

    Yeah that could work, but keep in mind you can't cancel that request, so some will continue to look for that command even if you issue new commands.

    I am not new at coding by hand but I am new at Construct 2, but I am getting the hang of things =]

  • Those are actually some good ideas metatronx.

    I was already planning on grouping, but not the invisible node creator. That is cool.

    My point for this test is actually to test the CPU usage of the AI by creating unreal circumstances, like 1000 objects with AI. Grouping them at this point would be counter-intuitive.

    I can do the thing with the nodes, but would it not cause more CPU usage that each 1000 units are requesting a path to that point? Though, I do think you are right. Whenever I make all 1000 units find a path that doesn't require avoiding obstacles, they all find a path and move at the same time. Once there is a path required, they start to move at a pace of about 10 units per second, which makes the units look like a smooth river with good coding. The units only start moving on the path once the "path to" has triggered as a path found.

    So it may indeed help increase how many units can move at once to a far path by using an invisible unit to create nodes on the way to the path, but it could create choppiness as all 1000 units try to find a path to the next, nearby node, on every node they reach. I will do some tests.

    Here is an example link, follow these instructions first.

    Test your theory and you will see it works.

    To test my problem,

    when game starts, click near the entrance of the spiral.

    All units should move ok to that spot.

    After they arrive, click inside the spiral.

    They will form a river and start moving towards that spot.

    While they are moving, try clicking outside of the spiral near an open field where no obstacles exist.

    The units that had not found a path yet will move there first, then find the more complicated path after computing and then move back to the inside of the spiral.

    https://dl.dropboxusercontent.com/u/205 ... index.html

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you make lots of objects find a path through solids, not all will find a path instantly.

    Some will wait till it triggers that they found a path.

    If some of the units are still calculating the path and you click somewhere that is easier to calculate, they will move there first. After moving, the initial calculation for a path triggers the move along path yet again, making the unit move to the first waypoint rather than staying on the second.

    I tried thinking about adding a global way point trigger to let the AI know not to follow any old commands, but I have not been able to get it just right yet.

  • Damn, I expected that after buying a License I would get more support.

    Is there really no way to cancel the request to find path to something?

    If not, can it be implemented.

  • Gotcha.

    Doing find path again didn't clear out the previous path, it just creates another order on top of the current order that it follows if it is easier, then after following that second order, it goes back to following that first order.

    I even tried disabling and enabling pathfinding, but nothing.

  • Hello, I am stress testing pathfinding on Construct 2 and I would like to know if there is a way to cancel the request to find a path and replace it by finding a path to something new.

    I have a condition that triggers actions when path is found under each of the 1000 objects, the only problem is that if I click somewhere else, they end up trying to find a path to the new location, some move, but by the time they arrive to the second destination, the found path triggers for the first path and makes the units move from the second point to the first point again.

  • 6 posts