1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

Execution time . What is acceptable for a script that people may use on multi play

Discussion in 'Programming (In-game)' started by Mollymawk, Mar 6, 2019.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Mollymawk

    Mollymawk Apprentice Engineer

    Messages:
    124
    I only play solo( because i mostly play with scrips ) so i don't really know what happens on multi play servers.
    Im trying to keep execution times low with peaks only 10ms. Quite often 1ms or less. Also using dynamic refresh rates. And restart timer blocks so things are only done when they are needed.

    What do i need to aim at with a published script. When does it stop being a usfull script and turn into a lag machine.

    I expect the answer is 'it depends'
     
  2. Malware

    Malware Master Engineer

    Messages:
    9,867
    10 milliseconds is way, way, way too much, even for spikes. The game has a grand total of 16 milliseconds execution time per frame to do everything, including game logic, physics, all programmable blocks and rendering. Even 1 millisecond is too much if constant.
     
  3. Mollymawk

    Mollymawk Apprentice Engineer

    Messages:
    124
    Thanks. Good to know. But most workshop scripts are way worse than that. I put exec time test on quite a few.. and thought i was coming in well under the bar..even the good ones move a lot of work into Program() i guess people dont measure thier initialisation.

    With the script i am worrying about. Most of the time it shows 0.0000 ms. Sometimes 0.9 ms but not sure why, as its doing the same thing.. just after recompile it shows 6ms for a couple of scans.

    I never really worried about it before as i just write stuff for myself but i published my script and someone said they are using it on a shared server.
     
  4. Malware

    Malware Master Engineer

    Messages:
    9,867
    "Most"? I can't believe that. If this is true, then I understand why the PB has gotten such an unfairly poor reputation.

    The "just after compile" bit is because it's doing something called JIT compilation, which is the final compilation stage to native code. There isn't much you can do with that.
     
Thread Status:
This last post in this thread was made more than 31 days old.