• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Isometric collisions and pathfinding/navigation with paths

I'm new to paths and I don't know how they should be used in certain situations. This post might be all over the place since I'm still new at this. My game is an isometric sort of god-game that looks like Age of Empires, just to give you an idea. All movement is handled like this:

villager_male_adult (step event)
Code:
            if (mp_grid_path(global.grid, path, x, y, closestBush.x, closestBush.y, 1))
            {
                path_start(path, 1, path_action_stop, false);
            }
This is the path code that sends a villager to go gather food from a bush and stop when he gets there.

also in the create event I have

Code:
path = path_add();

mp_grid_add_instances(global.grid, rock, false);
to add the path and any rocks in the way

What would you do if a villager touched a solid object? You can't make it just stop because it's programmed to walk around everything on its way to its destination. After thinking about this for a long time, I realized that if I clicked on a really big rock, and a villager tried to get to the x, y of the middle of the rock, he wouldn't be able to. I'm not sure what would happen to test this because I can't figure out how to make things solid using paths for movement. Checking solid on anything makes the villager still pass through it. depth = -y for everything too if that's an issue but I don't think so.

Also, how would I make a villager, using a path, stop when it touched the mask (I think it's the mask) of the destination object in my code above?

something like...

if (path_collision(bush)) {stop path}

Would mp_potential_path be of some use here?
 
Top