I have been coding for a least a year now and have started to make an RPG with some friends. I want to make pathfinding for the enemies, but I know Roblox pathfinding is unreliable at best. I have searched the dev forum, but all of the solutions are complex and don’t make sense to me. What would be the best way to create reliable pathfinding?
If you could explain one of the following systems to me that would be great:
- Spatial Mapping
- Goal-Based Vector Feild Pathfinding
- Flow Feild Pathing
The type of pathfinding to go with really depends on your needs. However, in the examples you’ve posted only 1 of those is actually pathfinding (with two of the “pathfinding” options being the same thing)
So 1. and 2. are the same thing, Octrees are one of many ways to perform spatial mapping.
3. and 4. are the same thing with two different names for it. Vector Field pathfinding is typically more desirable if you have many units trying to reach the same goal, it’s goal oriented rather than unit oriented.
5. is a technique for flocking, boids model animals like fish and birds and how they move together in a flock.
Could you maybe elaborate a bit more on your needs? Typically RPGs only feature a handful of units where you would see diminishing returns from Vector Field pathfinding so unless you have a group of 50+ units going after a player at once that may not be the best option for you. Vector Field pathfinding is typically a better fit for games more like an RTS, where you instruct a large group of units to go to a rally point.
Tell us a bit about your game and what you want your NPCs to do, how they operate with respect to each other, etc.
In my game there are challenging enemies that you usually will only have to face one at a time but there will be circumstances with more. The game is very dodge based where the enemies are lethal, relentless and have strong area attacks. Enemies will be able to collide with the player and each other. No Npc’s will be attacking anything that is not a player.
I wouldn’t recommend pursuing something like vector field pathfinding for this particular use-case.
I will say that you’re most likely going to benefit the most by using Roblox’s built in pathfinding solution. It does have its flaws but many of those can be corrected relatively easily. If your map becomes particularly complex and Roblox’s pathfinder is incapable of getting into certain areas you can always add invisible parts and PathfindingLinks and PathfindingModifiers to help it get into difficult to reach areas. This does require a lot of manual work and the potential for things to go wrong in the future when you make slight changes to your map, but the odds of your own pathfinding solution being able to handle every case is unlikely as well.
I’ve managed some really neat results with Roblox’s pathfinder just by using invisible parts, it’s actually pretty cool what it’s able to do with a bit of help.
If you’re feeling particularly crazy about making your own pathfinder then I’ll start by saying that it’s a long road to creating something scalable, not to discourage you from trying by any means. If you’re curious about ways to go about doing that though, I’m willing to come up with a decent outline that might be helpful for you. It’s worth noting that it will be very technical though.
you are not alone on this
everyone has been wanting a roblox pathfinding alternative for forever, the reason there is not any alternatives is, because it’s complex as heck as you mentioned yourself.
if you really need this pathfinder, you are likely gonna have to do it yourself.
if your enemies don’t need to climb any hills and whatnot, i suggest to make an A* based algorithm, otherwise i cannot help you.
Thank you for the advice both of you, I will look into A* based algorithms and trying invisible parts.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.