Hi. I’ve been using a*pathfinding to setup some demo scenes for my game.
Background on my game
It is just like a top down, 2D game. Its a linear game but there are open spaces where combat will happen in some places and exploration will happen in others. I’m using a*path for AI for enemy unit movement. I also have a sidekick type unit that follows the player character around, and so I use the grid graph to path for that unit also.
My questions
To make things work I’ve basically just been expanding the width and depth of the pathfinder to cover my entire play area, since its all contained in one space. This of course works fine for demos, but as its time to expand the game and add traversal throughout many areas, I’ve been starting to think about how to manage it across the entire game. I’m struggling to conceptualize how to manage the Pathfinder across the game and am looking for some pointers.
Scanning the entire map seems like it would be a pretty expensive thing to do. I assume since the world is mostly static that I could scan it and store those graphs somewhere and load them when necessary, but that seems complex.
It seems like I would need the pathfinder to basically follow the player unit so that we’re only scanning things within a certain range, but even then how would I determine when to update the graph? It seems like it might be equally as expensive to scan a new graph every few seconds?
I searched the forums and didn’t quite see questions about this. I’d really appreciate a pointer in the right direction and even some examples out there if they exist. I’m looking to get the pro version, so if examples exist there then that is also fine too
Thanks,
Daniel