Pathfinding question

0 favourites
  • 2 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

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