Hi everyone, I would like to get your opinions on your method of determining if your code needs to be optimized. I used to rely on the script performance window in studio, but my only issue is that the script activity is different depending on the quality of the device your playing on. For example, on my better computer a script will have an activity level of 0.3%, but on the older computer it would be 2%. So what other methods do you guys use to determine if your code needs to be optimized.
Hi, I do not understand what you mean. What are you referring to when you say your “script has an activity level of x%”? Usually scripts are best optimized by following the best course of logic your script can follow to operate on the best outcome to what you want to program, meaning the functionality of what you want to achieve is done in the best way possible.
First off you shouldnt try to make your game perfectly suitable and non-laggy on every platform, thats just nearly impossible, optimize the game to your pc’s standards because most people probably have an either better or a bit worse pc than yours most likely so go off what you have
There is a window you can enable in studio call script performance, go to view and select script performance, from their it will tell you the acitivty level of the script, the activity level is basically cost of whatever the script is doing.
I would suggest taking a look at the MicroProfiler. This is good at telling you how long different lines of code are taking. If lines are taking too long on lower end devices, you could conciser optimising them for those devices.