Roblox supports parallelism using the actor model. This means that the pathfinding algorithm can run in the background, freeing up resources to do other things.
Read Parallel Luau.
Roblox supports parallelism using the actor model. This means that the pathfinding algorithm can run in the background, freeing up resources to do other things.
Read Parallel Luau.
Additionally, Native Luau could increase performance even more. It does this by compiling your code into actual machine code, or “native” code, instead of running it using the Luau interpreter. There are some restrictions:
--!native
comment to a client script, it will be ignored.Ok, but i dont get the actor thing. How can that improve my pathfinding performance if it runs on 1 script only?
Actors run code simultaneously to speed up your game. This means that the game can still do other things while your pathfinding algorithm runs.
To use it, place your script in an Actor. Then:
task.desynchronize()
-- Run the pathfinding calculations here.
-- It will run parallel to anything else, like the game's rendering engine, so the game doesn't slow down.
task.synchronize()
-- Update the Workspace here.
that solution doesnt really help with improving the pathfinding. I mean i want to make my pathfinding be less heavy, that is all. i am only testing the pathfinding and nothing else right now. I am looking for a faster calculations because all the suggestions above didnt really make my pathfinding faster
Is it possible that you could “distribute” calculations over multiple frames? I see you’re running the calculation every second, so you should be able to reduce the amount of calculations on a single frame, and into smaller chunks.
I have no idea how you could do this, but it’s an idea…
then you could throw in parallel lua in some way or another.