Hi! Im currently working on a simple Status effects system for my game. My question is What is more performance friendly?
A single Server script that iterates through all player Characters and their body parts (i use a custom made per limb health system)OR Individual scripts for each player that controls their own character and body parts? (it would pull the code from a module script)
I use collection service to “apply” effects then based on that the script would choose the right functions to execute.
So which approach is better? Any help is appreciated!
Yes, currently im not really worried about performance itself, but having to rewrite an entire system just because its hard to manage / unperformant. Better to be safe than sorry, and ask the forums LOL.
Fair point, but it is hard to know unless you actually implement it first both ways. Even an O(n²) algorithm can be faster than a O(1) algorithm, for example.
I’d guess that a single player controller is more performant, but the logic is probably going to be more complicated there, and in Luau generally the simplest solution you can find to something is going to be the more performant, so…
Yeah, good point. I guess for now im going to settle with a Single script approach (mostly due to code management) and see how well it performs. if it doesn’t go well i will just switch…