Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

pathfinder grid for 2d sandbox game

Discussion in '2D' started by Pedrodelrei, Nov 5, 2016.

  1. Pedrodelrei

    Pedrodelrei

    Joined:
    Mar 31, 2015
    Posts:
    2
    Hello, i'm creating a survival sandbox 2D game and I need a way to make a pathfinding grid through all the map or something like a "moving grid", that follows the camera (so that nearby npcs can move around). I'm using the A*pathfinder and when i generate a 100x100 nodes grid the fps falls dramatically, so i'm guessing i should go for the second option. Do anyone have any clue about how to make it work?
     
  2. absolute_disgrace

    absolute_disgrace

    Joined:
    Aug 28, 2016
    Posts:
    253
    How often are you calling the pathfinding algorithm? Is it possible to reduce the number of calls you are making?
     
  3. Pedrodelrei

    Pedrodelrei

    Joined:
    Mar 31, 2015
    Posts:
    2
    I will test that. I thought the fps drop was because of the high number of nodes