Pathfinding question

Get help using Construct 2

Post » Thu Aug 17, 2017 3:32 am

Im making a top down game with a massive spaceship. The spaceship has normal wasd movement while using custom controls that give me spaceship like movement

When I zoom into the spaceship the interior becomes visible showing the inside of the spaceship in a top down view.

Now, I need NPC's that are capable of going from 1 resource to another and another if possible random NPC movement while I pilot the spaceship

Basically, if an object is moving, is there a way to make pathfinding finding npcs ignore the fact that the object that they're on is moving and continue to do pathfinding work?
B
51
S
33
G
19
Posts: 59
Reputation: 14,294

Post » Thu Aug 17, 2017 5:18 am

One solution for this is to have your spaceship actually static in terms of position, and have your controls actually move all the other objects around it and rotate the entire layout.

Another involves setting up a custom pathfinding system that allows for node positions to be pinned/updated with movement of your ship. This can be done in conjunction with the built in pathfinding behavior, as that allows you to access the node coordinates. Basically use the pathfinding behavior to calculate the path, then your own movement system by creating invisible helper objects at each node that are pinned to the ship, and have your NPC's ( which are also pinned to the ship) move towards each node object in succession.

Third way is just to recalculate pathfinding every tick. Definitely not recommended, unless the scope of your game is very, very, small.
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458


Return to How do I....?

Who is online

Users browsing this forum: luckyrawatlucky, R0J0hound and 21 guests