My Game Pellet and What I Learned about AI Pathfinding

This was my first game jam and man was it a blast. So far I've played over 50 new titles all made this weekend and that's not even an eighth of all there is to learn. Game jams are definitely a great way to learn and pick up new skills. My game Pellet was a major undertaking for me because under the hood it contained scripts I struggled to properly implement in the past, particularly A*, a derivative of Dijkstra's algorithm. My friend @circle (https://ldjam.com/users/circle) here on LDJAM I think summarized most of the ideas which I learned through practice and I wanted to make a blogpost sharing these helpful tips for any other developers out there who are struggling with, or are curious to experiment with AI Pathfinding and formulas like A*:
1) Don’t keep checking the path. You need to set a timer for each entity, and update the path when it hits zero. Otherwise, just let your enemies go in the “wrong” direction for a while.
2) Not all enemies need to be pathfinding during gameplay, you can just set some of the enemies to be moving in mostly random directions and the players won’t notice because they’re being chased by the “smart” enemies.
3) You can, and should, consider having shifting behavior based on proximity to the player. It’s way cheaper to have your game check distance then to go through full pathfinding algorithm. You can either count the number of tiles if you’re using a grid system, or use a distance formula, I like Euclidean - sqrt((x1-x2)^2+(y1-2)^2).
4) Don’t be afraid to use a less complex algorithm for enemies if you’re strapped for time. Your player doesn’t know what’s going on under the hood, and so long as the illusion of enemies thinking and trying to reach you is there, it doesn’t really matter how you did it.
Anyway if you want to check out the game here it is!
https://ldjam.com/events/ludum-dare/50/pellet


Use the link below to reach out to our artist network:
https://twoshoesdigitalmedia.com/contact/
Check out the game I made for Terry Davis Operating System TempleOS https://ldjam.com/events/ludum-dare/51/ezekiel
Check out the game I made for https://ldjam.com/events/ludum-dare/51/ezekiel TempleOS 
Play it here https://ldjam.com/events/ludum-dare/51/ezekiel
Play it here https://ldjam.com/events/ludum-dare/51/ezekiel

Play it here https://ldjam.com/events/ludum-dare/51/ezekiel
Play it here https://ldjam.com/events/ludum-dare/51/ezekiel
Play it here https://ldjam.com/events/ludum-dare/51/ezekiel
