Platformer Pathfinding! - Devlog #1

Published: 24 July 2021
on channel: Zachary Newsom
10,024
400

I'm making a little platformer game all about being a primitive hunter-gatherer in a strange world. Best way to describe the concept is as a small-scale Monster Hunter in a 2D platformer format with less grinding and a more integrated story.


This first devlog is not really a devlog, but just an explanation for the pathfinding system I came up for this game.


Some disclaimers about this approach:
1. Can be slow with lots of nearby platforms (I cut off calculations between nodes if they're further than a set distance, so that can be good for rudimentary optimization).
2. Because of the speed, you shouldn't do this in the runtime of the program, pre-compute into a file and load on bootup (unless you're computing the raycasts on the GPU, or something). This means that any dynamic changes to the world will have to be locally recomputed.
3. The AI can't change their trajectory mid-flight. I decided to keep it simple and remove this capability for enemies because it complicated the issue even further.
4. Most importantly, this is not the best way to do it, I suggest looking around for more approaches to this problem before implementing it yourself. All I know is this one works for me.



I didn't really go to in depth in this video, so if you need more detail to create your own implementation ask me and I can probably get you some articles that I referenced -- or just scrounge them up on google.


[1] Article for finding non-colliding jump trajectory: https://gamedev.stackexchange.com/que...
[2] Other approach which allows for horizontal movement while in mid-air: https://gamedev.stackexchange.com/que...


On this page of the site you can watch the video online Platformer Pathfinding! - Devlog #1 with a duration of hours minute second in good quality, which was uploaded by the user Zachary Newsom 24 July 2021, share the link with friends and acquaintances, this video has already been watched 10,024 times on youtube and it was liked by 400 viewers. Enjoy your viewing!