[strike]I give up trying to write my own algorithm for this and to be honest its the only thing stopping me from being able to make a game on ROBLOX… So I’m here’s what I’m willing to pay for:
A system that will use nodes to find the closest player to the zombie and follow the shortest path to that player.
And I need the zombie to stop moving along the said path if it sees a player in its direct line of sight, and if it does it will stop following its path and will follow that player in a dumb AI matter (just simple Humanoid;MoveTo() will do) until the player is either dead or out of sight/range, and then it will go look for another path back to the nearest player. The system must be able to run 25 AIs through a 500+ node poly grid without any lag on the server.
10,000 R$ is all I have, and I’m really needing this to be done.[/strike]
Job well done VolcanoINC, thank you.
Enjoy your payday.
What’d be really cool is a NavMesh pathfinder – always wanted one of those. I’d be willing to shell out the same amount of money if someone made a NavMesh pathfinder whose navmesh could be created with a plugin.
I’m optimizing it currently. @GuestCapone, how much faster, roughly, do you need the pathfinding to be than it currently is with my plugin? I have a few ideas to reduce the time taken to pathfind to a small fraction of what it currently is.
I’m optimizing it currently. @GuestCapone, how much faster, roughly, do you need the pathfinding to be than it currently is with my plugin? I have a few ideas to reduce the time taken to pathfind to a small fraction of what it currently is.[/quote]
Yours isn’t slow, or to me it doesn’t seem slow… It just script lags the server to a standstill whenever I request 5 or more paths a second. (for the initial startup of the server, waiting 1 second in-between each request doesn’t seem to help either.) I only make each AI request a new path every 60 seconds or if they find a player they will follow the player until its out of range and if they can find the last node they were sent to, they will head back towards it or request a new path back to the targeted player, thats what I currently have.
I might be doing something wrong, feel free to check out the file below to see if I am or not.
(P.s. this is a slightly modified volcanoINC’s pathfinder module I’m using, I gave up writing my own.)
I’m optimizing it currently. @GuestCapone, how much faster, roughly, do you need the pathfinding to be than it currently is with my plugin? I have a few ideas to reduce the time taken to pathfind to a small fraction of what it currently is.[/quote]
Yours isn’t slow, or to me it doesn’t seem slow… It just script lags the server to a standstill whenever I request 5 or more paths a second. (for the initial startup of the server, waiting 1 second in-between each request doesn’t seem to help either.) I only make each AI request a new path every 60 seconds or if they find a player they will follow the player until its out of range and if they can find the last node they were sent to, they will head back towards it or request a new path back to the targeted player, thats what I currently have.
I might be doing something wrong, feel free to check out the file below to see if I am or not.
(P.s. this is a slightly modified volcanoINC’s pathfinder module I’m using, I gave up writing my own.)[/quote]
No, this is definitely my pathfinder being slow. It doesn’t seem slow because you don’t really notice the 0.2 second delay whenever you use ‘test path’. However, trying to find 5 paths per second will cause the server to be busy for an entire second, and if you go beyond that, things get even worse.
I didn’t have these issues before, but your node system is more complex than the ones I have tested with, and I was testing on an insanely fast computer when I made this.
I’m updating the pathfinder to be more efficient. It currently carries a lot of overhead that I can avoid.
This StackExchange post’s answer does a good job of explaining it, but in short NavMesh pathfinding allows for more organic pathfinding.Oblivion used node-based pathfinding, and Bethesda upgraded to navmesh for Skyrim I assume for this very reason. You have AI moving throughout a whole room rather than predefined paths. It also clearly defines what you shouldn’t be able to walk into.
Hmmm. You could place specially named simi-transparent blocks in your map to define where AI’s can’t go, then put those blocks in a model and make it a child of the path-finding script, which isn’t in the workplace so the blocks never show. On load the script uses the blocks to make it’s navmap then deletes them. When you want to modify the map you just drag the model back to the workplace and make your changes, dragging it back to the script when you’re done. I’m using a similar method to define audio regions on my island only using spheres which define the fade-in/fade-out min/max distances for the ambients.
GAH! Stop giving me interesting things to think about, I don’t need more distractions!
Quick update: I changed my pathfinder a little bit, and it is currently 4x faster than it was before. It also caches the paths it finds, so requesting a path between the same two nodes takes a little effort the first time, but is then nearly instantaneous.
You could pre-calculate all paths when the server starts, and I have implemented a function to do this.
I will be uploading the updated plugin as soon as I make a few other fixes to prevent people from using the module in a way that kills performance (don’t worry, you’re not one of those people).
Give them to me. I just spent an hour writing a node-based A* pathfinder.
If you’re worried about calculating paths costing too much, don’t keep calculating them. Store all of the paths and reference them, cause they’re not going to change, and there can only be nodes*(nodes-1) paths to calculate.