INI Settings (Papyrus)

From the Fallout4 CreationKit Wiki
Revision as of 10:18, 9 December 2015 by imported>Plplecuyer
(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

The following settings are game-only.

Defaults

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The following settings are editor-only.

Defaults

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=""
sScriptCompiledFolder="Data/Scripts/"
sCompilerFolder="Papyrus Compiler/"

Individual Settings

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

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

This setting lists additional folders that the editor and compiler should use. The folders are separated by semicolons, and will be used in left-to-right order, with files in folders to the right overriding ones in folders to the left. You may also specify the special "$(source)" folder to indicate where the sScriptSourceFolder should be in the list, but if it does not exist it will be added to the end. You can verify the order by looking at the folder list in the script tab of the preferences dialog. Like the source folder, paths may be absolute or relative to the editor's folder.

Default: ""

Examples:

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

sScriptCompiledFolder

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

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/"