Platformer Pathfinding! - Devlog #1
HTML-код
- Опубликовано: 3 июн 2024
- 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: gamedev.stackexchange.com/que...
[2] Other approach which allows for horizontal movement while in mid-air: gamedev.stackexchange.com/que... - Видеоклипы
This is super sophisticated! This is exactly the kind of thing I wanna add to my game, I'm gonna try to mimic what I've seen here
That's a super cool game mechanic. Thanks for sharing!
This devlog is better than my first devlog
thanks for the excellent video
Would really like a 2D Monster Hunter (referring to Capcoms bestseller - one of my favorite games). Do keep posting.
Good vid, very interesting
Thanks a lot man,
I have tried platformer pathfinding like 5 times in the past but the jumping part was always wonky.
Used the resources you mentioned, and now its (almost) perfect.
Please share the script 🙏
Would you mind sharing the code that worked for you?
Thank you! Do you have a Github repo for this?
Good job!
Nice research!!
Very cool video. How did you go about testing for collisions along the jump path? I’ve considered using a series of box casts along the path but was wondering what you experimented with?
most likely you will not answer, but have you thought about the grid? I'm trying to set up A* right now and found a couple of use cases for ground creatures in the platformer genre. But I just started programming a couple of days ago, so I can't do much. In general, Grids can be configured with gizmos, wouldn't that be a more advanced option compared to point movement?
Damn, I was hoping this would be a tutorial, because I need a good pathfinding system, but I can't find one. all the others have bugs the creators never bothered to fix, or their channel is abandoned.
i really need that to
I've watched this vid several times now, hoping to pick up something new each time. Is there any way you can share your code for this elegant solution?
Hey great video. Not sure why you never continued the devlog. I would love to see more in depth on on the AI you made. I've tried doing something similar and so far the math has proved to be to difficult for my poor brain to get right.
I've been just way too busy with school and other hobbies that I've had to put the project on back burner until the summer. If you have any specific questions about the math feel free to ask, I don't know if I'll be able to help but I can probably point you in the right direction.
@@zachary_newsom Well just in general I was hoping for a big of code example and implementation. I've derived a lot of the formulas from the links you provided, but getting them all to work nicely together wasn't working out for me. I ended up backlogging it for now and came up with a simpler solution, but it doesn't do what I want it to. It would be amazing if you had a repo of some of the code to look at, but that's asking a lot I'm sure.