*** I separate the Calculation and Movement sequences into two different scripts, then bridge the data between them through global variables (which speeds things up vastly). ***
SYNOPSIS: Using scripts with repetitive and overly-intense timing will affect the entire game's performance. ALSO: any mod that contains something that is expected to happen very rapidly and repetitively enough to cause over-stacking (eg: an extensive onHit event during an intense fire-fight).
Problems this causes includes, but is not limited to: visible lag of scripted movement, loss of responsiveness of User-controls, breakage of quests, Papyrus errors (which are a separate issue, see the thread below), freezing of the script and even the game itself, and certain functions not performing or firing as expected (such as setVehicle or translateTo).
Scripts which are potentially affected by this would contain any kind of repetitive loop; such as registerForUpdate, registerForSingleUpdate, nested functions, and repeating quest-stages. While/endWhile loops are especially problematic because they have no limit as to how fast they actually run, and will do so at TOP speed... which quickly amounts to being TOO fast.
The following data shows in-game frames-per-second rates (fps), while the scripts are running at a certain rate (the second number, eg- .11). The second number, in these tests, indicate how fast the registerForSingleUpdate(MovePerf) is set to; where MovePerf are the second numbers below. This does NOT mean this is how fast the script is actually running, but how quickly the new onUpdate fires AFTER the preceding code has finished. The script will NEVER actually run at that specific interval - even if the onUpdate is empty... simply because it takes time to actually open that event, then run the regForSingle function.
= May cause UserControl-lag, variable/alias non-filling (errors and/or visible lag), and/or misfiring from over-stacking. Over-stacking may cause certain functions or actions to keep performing after a stop/finish-function has been completed; which affects the NEXT time the script is run.
** These results are VERY consistent and reproducible (at least on my machine). **
- These effects are not only manifest during repeat script-starts, but also during real-time, in the form of visible lag or erratic movement.
(The CalcScript actually has its stop-sequence set to end TWO SECONDS after it's done... without this wait, these thresholds would be MUCH higher. The MoveScript ends after 3sec, to allow the CalcScript to finish first.)
25fps at .11 and less (stopped here as 25fps is WAY too slow for anything I want to do, so no need to go further)
30fps at .09 and less
(anything below 30fps will have visible lag/flicker, regardless of script-speed, so is generally undesirable)
35fps at .09 and less
40fps at .08 and less
45fps at .06 and less
50fps at .06 and less
55fps at .03 and less
60fps at .02 and less
= May cause a script to run TOO fast; either causing 'None' errors (because of misfiring/stack-dump) or excessive stack-dumps (which WILL cause ALL scripts to temporarily stop running, freeze the game, or outright CTD).
** These results aren't as consistent as control-lag (yet ALWAYS show those lag-symptoms, except at 45+ fps). **
- CalcScript is almost ALWAYS the one that has errors; presumably because the relative slowness of the MoveScript (translateTo is one of the slowest things goin', at least from what I've seen). [don't forget a regForSingleUp doesn't run at that rate, but however long it takes to finish running PLUS that rate]
- Multiple attempts to reproduce results found a +/- 0.01sec tolerance.
- These effects manifest in real-time, usually as soon as the script is started; and also include visible lag and erratic movements, as well as the movement seeming to freeze (that is.. if you're superLucky).
25fps at .06 and less
30fps at .06 and less
35fps at .06 and less
40fps at .06 and less
45fps at .06 and less
50fps at .06 and less
55fps at .06 and less
60fps at .06 and less
***** Obviously my system cannot reliably run scripts faster than 0.06sec (+/- .01), regardless of fps rate; therefore, in my case, it is presumably a CPU-speed limitation. Real-time logging indicates my CPU only hits 50% total usage during the occasional spike (probably during cell-loads); and only 2 of 4 cores (a known limitation of Skyrim)... presumably systems with 2+ cores running at faster-than-mine speeds would see better times (and/or if more than 2 cores may be safely and effectively used). *****
[DETAILS]
- This tests a dozen and a half global variables, moving one object and Player (the extra variables are for more objects, not used during this test; left in to simulate extra system-load).
- CalcScript includes advanced math functions (square-root, sine, etc), which determine present position and movement offsets based on User-controlled speed and direction; many extras were left in to simulate extra system-load... enough to move 4 objects (each with a unique position/destination), and compensation/limitations for different speeds/etc.
- Player-based controls are done in a hidden quest, which is set to repeat during each iteration to poll Player's movement (based on conditionals); fired from the CalcScript (since it uses that 'raw' data).
- The (pureCK) test-mod is a simple/lowPoly platform which Player is scripted to control and travel on; top speed is 300gu per translateTo (the function used for the actual movement).
- The platform is an activatorObject and has both the Calc and Movement scripts attached to it, both start simultaneously with onActivate events and are set with the same fire-rates.
- RegisterforSingleUpdate drives both scripts, both set to the intervals indicated below; no States or Aliases were used.
Testing Procedure:
(after having created the test-mod in CK v1.524; and using Notepad++ to compile the scripts)
1- set the scripts' fire-rates to the test target
2- adjust detail levels to achieve the target fps rate; primarily with the Low & High detail buttons, then individually changing Shadow Detail level, AA, AnisoFiltering, FXAA, and Blur Radius
3- 'coc' from the Title/Main Screen to the cell in which is pre-placed a Ref of the platform Activator
4- position Player near the platform, then adjust heading (mouseLook-direction) to achieve the target test-rate (look toward the ground = higher fps, look straight/more detail = lower fps)
5- activate the platform; wait until scripted notifications indicate both scripts have started
6- Player moves forward (to increase the 'speed' of the movement) until top-speed is indicated by notif
7- adjust Player's heading to achieve and maintain the target fps (same as above, looking toward more detailed areas if fps is too high, the ground if too low); take note of actual in-game performance/'jumpiness'
8- after a few seconds of maintaining the target fps, Player 'sneaks' to trigger the scripts' stop-sequence
9- still maintaining target fps, User waits until both scripts' notifs indicate they have finished
10- open the console then select the platform, do a 'showvars'
11- find the variable in CalcScript which determines whether it has finished (set to 0 during the stop-sequence)
** If it's not 0 then the scripts have over-stacked and functions continued to run more than 2secs after the stop-sequence was DONE. **
12- do a 'qqq', and check the Papyrus log for actual stack-dumps or 'None' errors
** I intentionally removed any checks which would/should prevent those 'None' errors, so as to see better without elaborate tracing/logging/etc. **
*** The above is only one person's findings and may be subject to change from session to session; possibly affected by circumstance such as GPU & CPU core temps, as well as the specific nature and intensity of any scripts being run (not to mention using a saveGame, as opposed to 'coc' from the Title/Main Screen). Keep in mind that these results were gleaned without ANY other scripts running, certainly not with any full of errors and over-zealous timing.. as many tend to be. ***
- All the above was tested using Skyrim v1.526, without ANY other mods or INI tweaks, and using FRAPS for fps
= Tested with an i5 2.27, 4gig DDR3 sysRAM, nVidia GTS360m with 1gig dedi vidRAM, 7200rpm SATA harddrive, Win7
(with Skyrim, the GPU is ALWAYS the bottleneck in my system, NOTHING else even comes close)
Related Thread:
http://forums.bethso...me-performance/
Edited by SLuckyD, 23 June 2012 - 06:05 PM.
Sign In
Create Account



Back to top

Terms of Service