Lumenflower
Yellow Dog
I'm currently working on a project in which the player can build a small, multi-levelled environment (think FTL with several layers) and certain 'minions' navigate it autonomously. Successive floors are connected by staircases. The problem is that I don't know how to approach writing the pathfinding scripts for these minions.
I'm experienced in mp_grids and the related functions but I feel like a more adaptable, custom setup would be required here. It's clearly not as simple as just seeking out a set of 'up' or 'down' stairs and navigating to them, as there's no guarantee that this would produce an efficient (or even possible) path.
It seems the most effective method would be to use a node-based map of the environment and write a custom pathfinding algorithm to navigate it. I have a good idea of nodes and pathfinding in a mathematical sense but I have no idea how to store and retrieve the information involved effectively in GM. It seems each node would require a bunch of information such as an index, x, y, z, and some list of all the nodes it's connected to.
Anyone who's approached this challenge before - how did you tackle it? I'm sure all I need is a push in the right direction and I'll give it a bloody good go at figuring out myself
~Druid TC
I'm experienced in mp_grids and the related functions but I feel like a more adaptable, custom setup would be required here. It's clearly not as simple as just seeking out a set of 'up' or 'down' stairs and navigating to them, as there's no guarantee that this would produce an efficient (or even possible) path.
It seems the most effective method would be to use a node-based map of the environment and write a custom pathfinding algorithm to navigate it. I have a good idea of nodes and pathfinding in a mathematical sense but I have no idea how to store and retrieve the information involved effectively in GM. It seems each node would require a bunch of information such as an index, x, y, z, and some list of all the nodes it's connected to.
Anyone who's approached this challenge before - how did you tackle it? I'm sure all I need is a push in the right direction and I'll give it a bloody good go at figuring out myself
~Druid TC