Submissions by saluk tagged postmature

A submission for Make games. 188

Working on how to design my tile sections for the astar optimization.

A submission for Make games. 187

I did some bonus dev last night turning the astar query into a coroutine. When the behavior tree node wants to find a path, it runs the function to find a path, but the return value is a code object rather than a path. On subsequent runs of that node, it will execute the function a little bit further. I can adjust how many iterations of the astar loop are executed per npc per frame; a further optimization would be to have those executions happen centrally in a way that I can have the number of iterations a fixed amount no matter how many npcs are in a scene.

In this way, the framerate will never be affected by pathfinding, higher numbers of npcs will be able to be supported. As population grows, the npcs will be slower to make decisions to start moving, but the gameplay will stay smooth.

This is probably not as useful as hierarchy will be but it was pretty easy to implement.