libertyordeath Posted Thursday at 04:37 AM Share Posted Thursday at 04:37 AM (edited) This likely is true for LE as well, but i only have AE to verify, so i'm posting this in the SE category. This is something every player should know and pay the time to read, because it fully explains "Why are Skyrim scripts so slow on my super fast rig? And how to do something about it, instead of randomly tweaking miracle settings." BACKGROUND: PapyrusTweaks has an INI option to change the maximum Ops/Frame for Papyrus-scripting. Notice this is a maximum - if there's less to do in a frame, then the maximum isn't used. Notice also the famous Papyrus UpdateBudgetMS setting in Skyrim.INI, which sets a maximum time limit per frame. Again: If there's less to do in a frame, the allocated time budget isn't fully used. So quick summary so far: Via PapyrusTweaks and Skyrim.INI, we can define how much CPU speed Papyrus gets per frame at maximum - either in ops or millisecs. Also notice most Papyrus scripts run on Skyrim's main-thread/core - which is retarded, but hey, that's Bethesda and Creation Engine for you. There is a secondary thread for Papyrus scripts, called "ExtraTasklet", but i'm not sure how exactly it works. And a quick look at any CPU performance graph tool (like Afterburner) will tell you: Either that second thread runs on the main core too, or it's not helping much to offload stress from the main core. OPS/FRAME VERSUS TIMEBUDGET: The more techie-minded folks among you might wonder: Why the fuck is there an ops/frame limiter at all? The time-budget setting already takes care of Papyrus not eating into other game-tasks, such as rendering, audio and physics. And it's a far more effective method, because CPU-speed varies from computer to computer, but time is a constant: 60 FPS is 16ms per frame, no matter what CPU you have. So why is there an Ops/Limit at all? Dunno, it's Bethesda. But it is the answer to "Why does Skyrim not take advantage of my faster cores": Vanilla SSE limits Papyrus to 100 ops per frame. Yes, you heard that right: SSE's scripting engine runs at 0,0001 MHz - regardless of hardware! PapyrusTweaks by default raises this to 500 ops/frame (0,0005 MHz) - a five-fold increase - but look at your Skyrim modsetup in MO2: Is it five times bigger than vanilla Skyrim? No, it's far more. I run a relatively light and highly optimized Skyrim modsetup compared to others, and i have measured it to have 19 times the scriptload of vanilla SSE. So the default value in Papyrus Tweaks is completely insufficient for 99% of users. Even the recommended maximum of 2000 ops/frame is likely insufficient for most. Now before you go and raise that number to ludicrous speed, there's a few things to keep in mind: 1. This is Bethesda. The engine and internal was not designed for raising this number arbitrarily high. 2. 0,0001 Mhz Papyrus speed does not equal 0,0001 CPU speed. Papyrus is ridiculously slow and inefficient. Way back when i tested and optimized Oblivion scripts, i found design-flaws in the interpreter so pathetic, it made BASIC look like a hyper advanced VM. One papyrus op likely equals thousands of CPU-cycles. 3. It's unclear how the ops-limit is related to the earlier mentioned "ExtraTasklet". For example it could be, that if the ops-limit is reached and there's more to do, the extratasklet again gets time and ops allocated. Effectively your Papyrus would run in "emergency mode" all the time, allocating both the normal time budget and extra tasklet time budget, which likely would translate to regular stutters ingame. PAPYRUS PERFORMANCE IS EXPONENTIAL, NOT LINEAR: The two questions still unanswered are: 1. How do you recognize a stressed PapyrusVM? 2. How do you recognize when Papyrus has enough juice? The answer to those questions will surprise most players. At least they surprised me. SSE has a script performance profiler. Everyone has a tool to show core utilization. And we have our own eyes: We can see on gameload how long the HUD takes to initialize. We can see when talking to an NPC, how long it takes for the "New quest" message to appear. We can see how long it takes for a sexlab scene to start. We can see in general how "snappy" the gamelogic reacts to player actions. Those are the tools of the trade: If Skyrim gamelogic does not feel "snappy" in most situations, then Papyrus is bottlenecked. Next check core utilization in taskman or afterburner: If the maincore is below 90%, but gamelogic does not feel snappy, then you have a Papyrus bottleneck. It really is that simple. So this leads to the question: Is it running out of time, or running out of ops? If you do not run above 80 FPS and have left your time-budget settings in SKYRIM.INI at the default (or only changed it by +/- 1ms), then time should not be the issue. It's ops/frame in the PapyrusTweaks.INI. So how much do you raise it? Intuitively you may think raising it 25% will make everything 25% faster. NOT TRUE. Papyrus performance scales exponential. For example, i raised my ops/frame from 1800 to 2300, and everything became FOUR TIMES FASTER. Sexlab scenes now start in 2 seconds instead of 8secs. The HUD initializes on gameload in 0,3 secs instead of 1,5secs. Every game interaction suddenly is snappy. I don't know why this is the case. The only theory i can come up with is: When Papyrus is saturated, things start to pile up like in an understaffed workplace: Undone work gets pushed to the next frame, and then again to the next frame, until there's a lull in the workload and all the accumulated extra work can finally be done. That's the only plausible explanation i can come up with. On the upside, this makes it very easy even for unskilled users to find the right ops/frame value: Simply keep raising it in steps of 200 until you notice a sudden jump in snappiness and responsiveness. Then do not raise it further, because of the previously mentioned unknown factors. Once your game is snappy, it may be worth downloading the skyrim papyrus profiler, and check if there are mods that constantly take up papyrus time. I was surprised to find for example, that "A Matter Of Time" - a fucking onscreen clock - is hammering Papyrus every frame. Switched to Simple Clock and now it barely ever appears in the performance graph. Edited Thursday at 05:08 AM by libertyordeath 1 Link to comment
MadMansGun Posted Thursday at 05:29 AM Share Posted Thursday at 05:29 AM we already know this, there's a mod to deal with it: https://www.nexusmods.com/skyrimspecialedition/mods/77779? 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now