I know nothing about pathfinding beyond reading the debhub page on it.
“ComputeAsync” sounds like a resource intensive function. Since the target is always moving, I would be calling ComputeAsync at each waypoint the NPC reaches.
Would I be able to have 100 NPCs on the map targeting players at once?
Also I found this thing called “A*”. Is it better/faster than Roblox pathfinding? Should I look into it more?
Also I want NPCs to be able to pathfind up ladders.
Okay but no one is answering my original questions.
How performant is this?
Can I have hundreds of NPCs pathfinding players (constantly calling ComputeAsync) at the same time?
What the heck is “A*” and should I use it?
How do I get it to work with ladders?
It depends on what method you use for your npcs. OOP will help you maintain a good performance. There should be a tutorial on that if you don’t know what it is. It’s a pathfinding method which uses a service so obviously it’s quite performant, but don’t let that scare you into thinking you can’t use it at all. You just have to make sure that you use it in an efficient way.
Every NPC will need it’s own path because each NPC is in a different location and each player is in a different location. There is no way that I can consolidate the pathmaking into “less paths” using OOP.
Each npc will need it’s own path, I’m just saying it depends on how you make your npc script. That’s what determines how performant it is.
If you’re not looking to reduce performance then why are you asking if the pathfinding is performant or not? I’m confused… It’s a service that generates points for your npc to go so it’s pretty self explanatory yes it is performant (depending on how much it’s used like every piece of code on roblox) I already told you that from the post above if you can read.
Constantly recalculating paths for multiple npcs is bad for performance overall. Just having a lot of npcs in general isn’t good, especially if you want mobile players to play.
A* is a different method of pathfinding that doesn’t use Roblox’s service. I don’t think it’s actually all that better for performance, and also, it’s mainly used for flat surfaces only
For ladders, there’s no built-in way to detect them. Maybe using the pathfindingmodifer passthrough and raycasting, you can manually script in a climbing system?
also, OOP npc programming is most commonly used to get rid of the need for humanoids in npcs, which improves performance by a lot
because I want to increase the performance of my game not reduce it. The only time I can think that I would want to reduce it is if I am making a “lag simulator”
Okay so I wont look into it unless I have a need to
Can you elaborate, you are basically saying “making NPC’s without humanoids is more performant”?
A* (or A-Star) is pathfinding for 2d space, It’s used in 2d grid games, like Tower Defense games, so It’s not probably faster than original pathfinding and It’s complicated to make and use, so I recommend using PathfindingService
He’s telling you as it sounds bro, also OOP is useful for having 1 script that manages the entire bunch of NPC’s you have in your game. It’s very useful and has less performance cost.
I will mess around with pathfinding and see if I can make a system that’s hopefully lag free. (idek if it lags to begin with, maybe I can have a thousand NPCs without lag and I’m asking for support unnecessarily )