Mihai Vasile
Member
Hey guys,
I`m trying to make a city builder and I have a problem with the pathfinding. I want to make the people walk only on roads.
For the time being I use the following setup:
1. An object that creates the grid on its Begin step and then has it destroyed on the end step. The same object defines what the no go tiles are through mp_grid_add_instances.
2. Path_start code on the object that moves (people in this case).
This works but of course the road system is not followed as the grid calculates a path that does not take this into consideration.
I tried defining empty space through mp_grid_add_instances but either it doesn`t work or I don`t know how to do this.
I thought of filling the map with obj_grass instead of tiling the map and then I can add obj_grass to mp_grid_add_instances. However I have a 6000x6000 room and filling it with 64x64 objects just for the background might not be wise for performance.
Is there a solution or am I approaching this the wrong way ?
I`m trying to make a city builder and I have a problem with the pathfinding. I want to make the people walk only on roads.
For the time being I use the following setup:
1. An object that creates the grid on its Begin step and then has it destroyed on the end step. The same object defines what the no go tiles are through mp_grid_add_instances.
2. Path_start code on the object that moves (people in this case).
This works but of course the road system is not followed as the grid calculates a path that does not take this into consideration.
I tried defining empty space through mp_grid_add_instances but either it doesn`t work or I don`t know how to do this.
I thought of filling the map with obj_grass instead of tiling the map and then I can add obj_grass to mp_grid_add_instances. However I have a 6000x6000 room and filling it with 64x64 objects just for the background might not be wise for performance.
Is there a solution or am I approaching this the wrong way ?