Will every actor have their own personal copy of everything?Īll NPCs will likely be actors with a script in them that only has 3 lines of code since all logic is inside modulescripts and uses metatables to keep stuff object-oriented and easily reusable. Will this duplicate all the target adding/removing from a target list for every thread?Īnd what happens to that list of available humanoids/targets if the thread ends or is synchronized again? However I’m not sure what exactly happens if a module script is require()'d on another thread. To optimize my NPCs so I can have 100s of them, I want to do the target seeking and pathfinding logic multi-threaded. Players and NPCs are added to a target list when spawned and removed when dead or despawned. Now, since doing a :GetAllChildren() every single time I want to look for the nearest target is slow, I have another modulescript somewhere that keeps track of all players/entities that are added that have humanoids. I use metatables to implement object oriented programming like so: local entity = I’ve been looking into using parallel Lua to optimize NPCs for a project, but there isn’t a whole lot of clear information about the workings of parallel Lua and module scripts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |