• 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!

Fixed pathfinding or not?

NazGhuL

NazTaiL
Hi! Standard top down 2d game, no physics enabled.

I tried something different. Instead of choosing a path on a grid and force my 'enemies' to follow it strictly, I force them to 'move toward' the next free 'cells' in sight by emulating a gamepad input by the player. Using the same rules as the player like collision, slippy ice and bouncing walls. I just need to provide a speed and a direction. When destination is reached, change the direction toward the next one, ect. That needs more tweeking, because you have to take the friction in mind. (Circling enemy around a point on ice!)

What makes you choose between a more fixed pathfinding and a more 'physics' like one. (It's been a while since I used gms physics in a game, if I remember correctly you can't really manipulate x and y, you better use impulse and torque, etc...)
 

Yal

šŸ§ *penguin noises*
GMC Elder
What makes you choose between a more fixed pathfinding and a more 'physics' like one
"Physicsy" pathfinding looks more natural, and it's easier for enemies to recover if they get off the path (e.g. if you knock them back). The more the game can adapt to you going off the rails, the less buggy it will feel.
 
Top