mikewesthad / navmesh

A plugin for path-finding in JS using navmeshes, with wrappers for Phaser 3 and Phaser 2
MIT License
355 stars 40 forks source link

Any plans on adding tools for dynamic meshes? #27

Open malahaas opened 3 years ago

malahaas commented 3 years ago

I'm making a game where obstacles can be placed during run time. Right now I've added a very simple grid generator that saves tile removals and regenerates the NavMesh from a new array, but it definitely starts to slog pretty quickly as tile count increases. I know I could make improvements by making a smarter tile generator, but just wondering if there are resources that already exist for this kind of thing (or if you have plans around this concept) so I'm not reinventing the wheel.

malahaas commented 3 years ago

Another issue I've worked around is being able to set the destination point within an unwalkable tile. Basically I want to wander around obstacles until the last one which I can "enter". For now I've just calculated an entrance point on the edge of the unwalkable tile and used navmesh to get there then move the rest of the way 'manually.' Anyway, these are my 2 use cases that I need to work around and was just wondering if you've though about these types of things. The library was super helpful and I very easily got pathfinding up and running in my Phaser 3 game from none. Thanks!

mikewesthad commented 3 years ago

Glad it helped with getting things up and running. Some initial thoughts:

malahaas commented 3 years ago

Good thoughts.

Both these issues come from the fact that the game's a city builder, so you place a building and characters have to be able to get to it and interact with it, but also it should remove the grid area it was placed on so pathfinding routes around it. This is all super early development for me, so I have lots of other things to be working in the meantime ;-D

mikewesthad commented 3 years ago

Hmm, I'll have to think on these this weekend. Thanks for sharing your thoughts. Sounds like an intriguing game.

By the way, pull requests are totally welcome, so if you feel motivated to dig in any changes, feel free.

malahaas commented 3 years ago

Ugh, for some reason Github has stopped sending me email notifications so I just saw this.

I'll keep that in mind. Right now my focus is on using a reactive loop for my game logic (a slightly modified version of SAM architecture). Right now I'm having fun trying to use the benefits of SAM in an arena I don't think it was intended for. The main benefits would be the almost 'built-in' ability to save replays.

mikewesthad commented 3 years ago

Heh - no worries. Sounds good. I just started a push to get the library converted to typescript so that I can start looking into improvements more seriously (and in a more maintainable way). I'll keep this thread updated as I go.

Ah, intriguing. I hadn't heard of SAM, though I see some similarities to Redux-like approaches. Thanks for sharing. Will have to do a closer read of it some time.

mikewesthad commented 3 years ago

Slowly plugging away at these issues. A few updates here:

malahaas commented 3 years ago

Awesome, thanks for the update. I just did YAMR (YET ANOTHER MAJOR REFACTOR ;-P) but I think I'm about ready to start working on art and a tutuorial level.

mikewesthad commented 3 years ago

Heh, I've definitely been there 👍🏽