Let's say I'm trying to create an RPG world with numerous near-identical monsters. In the case of AI, would it be more efficient to have a script per monster or a single script somewhere else that handles all of them abstractly, but in a multi-threaded fashion?
For sake of passing the not-a-question filter:
r.Stepped:connect(function()
--Do AI stoof
end)
tl;dr: Single multi-threaded script or multiple single-threaded scripts?
Also, is it more proper to refer to them as coroutines or threads?
The most efficient way would most likely be a single thread for all the monsters. However, for this question I suspect that multiple coroutines would likely be faster (as multiple scripts will run on multiple threads, anyway, and have different global environments and require the actual Script object)
I'm thinking a good way would be having a ModuleScript in each monster and have one base script to control all of the monsters in case you want some monsters to have different AI as different monsters but have the same basic functions.