INI Settings (Papyrus)

From the Fallout4 CreationKit Wiki
Revision as of 00:41, 19 January 2020 by imported>DavidJCobb (→‎sAdditionalImports: Made information consistent with https://www.creationkit.com/fallout4/index.php?title=Template:INI:Papyrus:sAdditionalImports#sAdditionalImports)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Papyrus has several INI settings that can control some elements of how it operates and utilizes resources. All of these settings are under the [Papyrus] section of the INI file for the game or editor.

Game Settings[edit | edit source]

The following settings are game-only.

Defaults[edit | edit source]

The following block shows the defaults for all the various settings. If you end up messing something up you can always copy this block back into your ini file (or delete the block entirely):

[Papyrus]
fUpdateBudgetMS=1.2
fExtraTaskletBudgetMS=1.2
fPostLoadUpdateTimeMS=500.0
iMinMemoryPageSize=128
iMaxMemoryPageSize=512
iMaxAllocatedMemoryBytes=153600
iMaxStackDepth=100
bEnableLogging=0
bEnableTrace=0
bLoadDebugInformation=0
bEnableProfiling=0
sTraceStatusOfQuest=
sDefaultLogOverlay=Papyrus

Individual Settings[edit | edit source]

Most of the settings won't need to be changed. The only ones users usually need to mess with are bEnableLogging, bEnableTrace, bLoadDebugInformation, bEnableProfiling, and sTraceStatusOfQuest. However all of the settings are listed here for completion.

fUpdateBudgetMS[edit | edit source]

This setting controls how much time the main Papyrus update loop gets. This loop mainly controls function dispatch. If a lot of function calls are being made and a lot of scripts are running, increasing this value may improve script performance at the cost of reduced game framerate. However most of the time the VM won't take this entire time slice and increasing the value will have no effect.

Default: 1.2

fExtraTaskletBudgetMD[edit | edit source]

This setting controls how much time taken out of another game thread is taken up by running script tasklets (the code that runs the raw script byte code). This time is on top of the time that the tasklets normally get in their own thread, but because that thread is shared they may end up being starved if other systems are highly stressed. If the game is not stressed, this time will not be used. Increasing this value may improve script performance in high-stress situations at the expense of framerate.

Default: 1.2

fPostLoadUpdateTimeMS[edit | edit source]

This setting controls how much time is added onto the load screen to do additional script processing in case the cell being loaded into needs to set itself up. Adjusting the time will adjust your visible load screen time. Adjust this setting if a cell with very complicated scripting is not getting quite set up in time by the time the player loads. This also may depend on the story manager since quests may not start until the load screen finishes if they are started up right before the player hits a load door. If the quest initial stage has a lot of scripting then it may need the extra time to run before the load screen is pulled down.

Default: 500.0

iMinMemoryPageSize[edit | edit source]

This is the smallest amount of memory the VM will allocate for a single stack page, in bytes. Smaller values will waste less memory on small stacks, but larger values will reduce the number of allocations for stacks with many small frames (which improves performance).

Default: 128

iMaxMemoryPageSize[edit | edit source]

This is the largest amount of memory the VM will allocate for a single stack page, in bytes. Smaller values may force the VM to allocate more pages for large stack frames. Larger values may cause the memory allocator to allocate differently, decreasing performance for large stack frames.

Default: 512

iMaxAllocatedMemoryBytes[edit | edit source]

This is the maximum amount of memory the VM will allocate in total for stack frames. If an allocation would push memory usage over this limit, the VM will instead wait for more memory to be freed. Increasing this value may improve performance in high-stress situations with lots of scripts running, but will use more memory. Note that it is possible to exceed this value temporarily while loading a save game due to slightly different allocation ordering.

Default: 153600 (150kb)

iMaxStackDepth[edit | edit source]

This is the maximum stack depth the VM will allow before forcibly killing function calls on that stack. This mainly helps with killing any potential infinite recursion. If you find yourself hitting this, consider using loops over recursion. Increasing this value may increase stack memory pressure, while decreasing this may forcibly kill valid scripts.

Default: 100

bEnableLogging[edit | edit source]

This setting turns logging on and off. If off, no logging will occur, even traces, and so it will override the bEnableTrace value. The in-game log display will still work, but nothing will be written to disk. Turning this off may improve performance due to less disk activity.

Default: 0

bEnableTrace[edit | edit source]

This setting turns on and off the script trace commands. System error and warning messages will still be logged to disk. If bEnableLogging is false, this setting is ignored as nothing will be written to disk anyway. Trace commands will NOT be visible in the in-game log display if this setting is off. Turning this off may improve performance due to less disk activity.

Default: 0

bLoadDebugInformation[edit | edit source]

This setting enables or disables the loading of additional debug information - essentially line number information. If this setting is off, error messages cannot generate line number data. Turning this on will allow line numbers to be available in error traces at the cost of increased memory usage.

Default: 0

bEnableProfiling[edit | edit source]

This setting enables or disables the script profiler. If off, none of the script profiling commands will be available. Turn this setting on to allow profiling information to be collected and logged. If on, script performance will degrade slightly.

Default: 0

sTraceStatusOfQuest[edit | edit source]

This setting sets a quest to track for script changes by form ID. The quest that this setting specifies will spit out a Papyrus stack trace to the log every time a Papyrus script tries to change something with it like starting, stopping, setting a stage, or showing an objective.

This setting accepts a form ID (as visible in the editor, optionally prefixed with a 0x), an editor ID, or a plugin (with extension) followed by a comma and a form ID.

Note: Because of the way string ini settings work, do not have any comments on the same line as they will be treated as part of the value.

Default: Empty

Examples:

; Tracks the quest with a form ID of 000105FA
sTraceStatusOfQuest = 000105FA
; Tracks the quest with an editor ID of MQ101
sTraceStatusOfQuest = MQ101
; Tracks the quest with a form ID of 0100FB14 (ignoring the load index of 01) in the CoolDLC plugin
sTraceStatusOfQuest = CoolDLC.esm, 0100FB14

sDefaultLogOverlay[edit | edit source]

This setting tells the game which log to show by default in the Papyrus log overlays. By default this is the global "Papyrus" log, but the name of any user log will also work.

Default: Papyrus

Examples:

; Tells the game to default to the workshop user log
sDefaultLogOverlay=Workshop

Editor Settings[edit | edit source]

The following settings are editor-only.

Defaults[edit | edit source]

The following block shows the defaults for all the various settings. If you end up messing something up you can always copy this block back into your ini file (or delete the block entirely):

[Papyrus]
sScriptSourceFolder="../Source/Scripts/"
sAdditionalImports=""
sScriptTempFolder=""
sScriptCompiledFolder="Data/Scripts/"
sCompilerFolder="Papyrus Compiler/"

Individual Settings[edit | edit source]

You will typically not need to touch any of these settings, though adjusting the source folder and imports settings can help you keep individual groups of scripts separate.

sScriptSourceFolder[edit | edit source]

This setting tells the editor where to put new script source files, as well as one of the locations to use when loading and compiling script source. It may be an absolute or relative path (if relative, it is relative to the editor's folder.

Default: "../Source/Scripts/"

sAdditionalImports[edit | edit source]

  • Default: "$(source);.\Data\Scripts\Source\Base"

This setting is a list of additional folders that the editor and compiler should use. The folders are separated by semicolons, and will be used in left-to-right order. Any listed import folders on the left will override import folders on the right. The order of imports may be verified by looking at the import list within the script tab of the Preference Window. Like the source folder, paths may be absolute or relative to the editor's installation directory.

A special variable called $(source) may be specified to indicate where the value of sScriptSourceFolder should be used.

Examples

; Include a "base" folder containing all original game scripts, let DLC01 override it, and then finally override both with the source folder:
sAdditionalImports="$(Source);Data\Scripts\Source\DLC01;Data\Scripts\Source\Base"


; Include all DLC imports.
sAdditionalImports="$(Source);Data\Scripts\Source\DLC06;Data\Scripts\Source\DLC05;Data\Scripts\Source\DLC04;Data\Scripts\Source\DLC03;Data\Scripts\Source\DLC02;Data\Scripts\Source\DLC01;Data\Scripts\Source\Base"

sScriptTempFolder[edit | edit source]

This tells the editor where to temporarily put script files that are being edited or compiled, as well as the compiler project files that it generates. If this entry is empty (which is the default), then the editor will use a temporary folder in the user's Windows temporary folder: "C:\Users\<username>\AppData\Local\Temp\PapyrusTemp". There is generally no need to change this setting unless the drive your user folder is on is severely low on disk space, or something else is preventing the CK from writing to the folder.

Default: ""

sScriptCompiledFolder[edit | edit source]

This tells the editor where to put compiled script files. Since the game can only read them from the data scripts folder, there is little reason to change this.

Default: "Data/Scripts/"

sCompilerFolder[edit | edit source]

This tells the editor where the compiler is. There is almost no reason to change this as the compiler installs to this folder by default.

Default: "Papyrus Compiler/"