Testing Your Mods

Testing your mods to ensure that content is accessible and there are no bugs present is an important step in development. Careful testing before release can save you from having to release multiple versions in quick succession in order to fix a bug.

This page lists some helpful resources and information regarding testing your mods.

SML Logging

SML Logging is a valuable troubleshooting and testing tool, especially for blueprint mods.

You can find more information on how to use and configure it, as well as how to launch a live log viewer when you launch the game, on the Logging page.

If you select text in the log terminal window, it will freeze the game until you press 'enter' to deselect it. This can help with reading things before they would normally scroll by.

Since the log terminal is a regular Windows Command Prompt window, you can right click on its top bar and set some default customization values, such as where the window spawns and how wide it is, which will be applied every time the terminal opens. You can use this to have it always open on a second monitor, for example. Be aware that the values you set here will affect every instance of Command Prompt on your system. See the Launch Script Enhancements section below for another method of controlling where the window will appear.

Unreal Console

The Unreal Console is a useful tool for debugging your mods. It extends the original log terminal mentioned in the previous section with some new features:

  • Options to filter (include/exclude) displayed log messages

  • Clearing the displayed log

  • Creating numbered "checkpoint" log markers

  • Running console commands from outside the game window (especially useful for dedicated servers)

  • See the game’s current status regardless of log position

  • Selecting displayed log messages no longer freezes the game, which you may consider a benefit or a drawback.

In order to use the new console, add the following to your game’s command-line launch arguments:

-Log -NewConsole

If you don’t know how to configure launch arguments, refer to this guide.

Now, when you launch the game, you should now see the Unreal Console appear as a separate window.

image

Cheats

Functionality build into the game’s Cheat Board and Unreal Console Commands can expedite mod testing.

Developer Utility Mods

A number of mods have been created that assist with mod development, debugging, and testing. Find them on ficsit.app by using the Tag Filter feature to view mods tagged #developer-utility.

Quick Launch Script

Testing mods often involves frequent restarts of the game. You can shave some time off of this process by launching via a script that loads you directly into the game world. In order to use this script, create a file with the .ps1 extension somewhere convenient to you.

Next, copy the contents of the below codeblock into the file. Note that you will have to modify the section near the top to match the location of files on your system.

If you have never ran a powershell script before on your Windows install, you may need to modify the system execution policy to allow them to run.

param (
	[string]$launcher = "steam", # Default launcher, level 1 of GameDirs config option
	[string]$side = "client", # Default client/server side, level 2 of GameDirs config option
	[string]$branch = "stable", # Default branch, level 3 of GameDirs config option
	[switch]$multiplayer = $false, # When true, enables WIP largely broken multiplayer feature and launches 2 copies of the game instead of 1
	[switch]$loadLatestSave = $false, # When true, the game will automatically load into the last save file you played. This breaks some multiplayer functionality.
	[switch]$waitForDebugger = $false, # Launch the game with the -WaitForDebugger flag, telling SML to hold the game's loading process to allow attaching a C++ debugger
	[switch]$noExceptionHandler = $false, # Launch the game with the -NoExceptionHandler flag, enabling JIT debugging and disabling the UE crash reporter
	[switch]$info = $false, # When true, print info about what copy of the game is being launched
	[switch]$test = $false # When true, the game will not actually be launched. Required files still may be created based on other params
)

# ========================================================================================================================
# Configure this section to match your system and preferences
# ========================================================================================================================

# Arguments to launch the game with
$CommonArgs = "-EpicPortal", "-bUseIpSockets", "-Offline", "-log", "-NewConsole", "-nosplash"

# Edit the below "path"s to contain your game paths for these possible install locations
$GameDirs = @{
	steam = @{
		# Note: Steam only allows installing either client or server at a time
		# The script doesn't know which branch you have selected in Steam's own UI
		client = @{
			steam = @{
				# Example: "C:\Steam\steamapps\common\Satisfactory"
				path = "UNSET"
				exeName = "FactoryGameSteam"
				appid = "526870"
				# Example: 12345678910111213
				savegameSubfolderName = "UNSET"
			}
		}
		server = @{
			steam = @{
				# Example: "C:\Steam\steamapps\common\SatisfactoryDedicatedServer"
				path = "UNSET"
				exeName = "FactoryServer"
				savegameSubfolderName = "UNSET"
			}
		}
	}
	epic = @{
		client = @{
			stable = @{
				path = "UNSET"
				exeName = "FactoryGameEGS"
				# Example: 1234letters0and0numbers0longer12
				savegameSubfolderName = "UNSET"
			}
			experimental = @{
				path = "UNSET"
				exeName = "FactoryGameEGS"
				savegameSubfolderName = "UNSET"
			}
		}
		server = @{
			stable = @{
				path = "UNSET"
				exeName = "FactoryServer"
				savegameSubfolderName = "UNSET"
			}
			experimental = @{
				path = "UNSET"
				exeName = "FactoryServer"
				savegameSubfolderName = "UNSET"
			}
		}
	}
	# Optionally define additional -launcher options here. Hierarchy is -launcher > -side > -branch
}

# Multiplayer options (no longer work as of U8, kept here for future development)
$Username1 = "Host"
$Username2 = "Client"

# Optionally configure the window size and position on the screen (2 sets for 2 copies when using -multiplayer)
$Game1 = "$CommonArgs", "-Username=`"$Username1`""#, "-windowed", "-WinX=0", "-WinY=32", "ResX=960", "ResY=1040"
$Game2 = "$CommonArgs", "-Username=`"$Username2`""#, "-windowed", "-WinX=960", "-WinY=32", "ResX=960", "ResY=1040"

# Location of your savegame root folder for usage with -loadLatestSave
# The default should be fine but you can change it if desired
# It gets combined with the savegameSubfolderName in the GameDirs data to make the full path
$SaveFolder = "$($env:LOCALAPPDATA)\FactoryGame\Saved\SaveGames\"

# ========================================================================================================================
# End configuration section
# ========================================================================================================================

$AutolaunchTempFileName = "AutolaunchScript_Temp.ini"

function CreateSteamAppidFile([string]$filepath, [string]$appid) {
	# Required to launch steam copies
	$SteamAppidFilePath = "$filepath\Engine\Binaries\Win64\steam_appid.txt"
	try {
		# cast to void suppresses output
		[void](New-Item $SteamAppidFilePath -ItemType File -Force)
		Add-Content $SteamAppidFilePath $appid
	} catch {
		Write-Error "Failed to create/modify steam appid file ($SteamAppidFilePath), try running script as admin"
		Write-Error $_
		exit 1
	}
}

function ResolveGamePathFromParams() {
	$selectedLauncher = $GameDirs[$launcher]
	if ($selectedLauncher -eq $null) {
		Write-Error "Requested launcher '$launcher' was not defined in your script config options"
		exit 1
	}
	$selectedSide = $selectedLauncher[$side]
	if ($selectedSide -eq $null) {
		Write-Error "Requested side '$side' was not defined in launcher '$launcher' in your script config options"
		exit 1
	}
	$actualBranch = $branch
	if ($launcher -eq "steam") {
		Write-Debug "Script does not support multiple branches for steam, ignoring the -branch option of '$branch'"
		$actualBranch = "steam"
	}
	$gamePathInfo = $selectedSide[$actualBranch]
	if (($gamePathInfo -eq $null) -or ($gamePathInfo -eq "UNSET")) {
		Write-Error "Requested branch '$actualBranch' for side '$side' was not defined in launcher '$launcher' in your script config options"
		exit 1
	}
	$gameDir = $gamePathInfo["path"]
	if ($gameDir -eq $null) {
		Write-Error "Selected game install '$selectedLauncher > $selectedSide > $actualBranch' is missing 'path' data, it should be the root directory of the install"
		exit 1
	}
	$gameEXE = $gamePathInfo["exeName"]
	if ($gameEXE -eq $null) {
		Write-Error "Selected game install '$selectedLauncher > $selectedSide > $actualBranch' is missing 'exeName' data, it should be the name of the executable file that launches the game"
		exit 1
	}
	if (-not ($gamePathInfo["appid"] -eq $null)) {
		CreateSteamAppidFile -filepath $gameDir -appid $gamePathInfo["appid"]
	}
	return $gamePathInfo
}

$gamePathInfo = ResolveGamePathFromParams

if ($info) {
	Write-Output "Using game install:"
	Write-Output $gamePathInfo
}


function PrepareArgs([string]$baseArgs, [switch]$applySpecial, [System.Collections.Hashtable]$pathInfo) {
	$buildArgs = "$baseArgs"

	if ($applySpecial) {
		if ($waitForDebugger) {
			$buildArgs = "$buildArgs", "-WaitForDebugger"
		}

		if ($noExceptionHandler) {
			$buildArgs = "$buildArgs", "-NoExceptionHandler"
		}

		if ($loadLatestSave) {
			$saveFolderUserId = $gamePathInfo["savegameSubfolderName"]
			if (($saveFolderUserId -eq $null) -or ($saveFolderUserId -eq "UNSET")) {
				Write-Error "Selected game install is missing 'savegameSubfolderName' data in your script config options. It should be the name of the subfolder within your save directory containing the save files you want to use with -loadLatestSave. Your same file directory was entered as: $SaveFolder"
				exit 1
			}

			$fullSaveFolder = "$SaveFolder\$saveFolderUserId"

			# https://stackoverflow.com/questions/9675658/powershell-get-childitem-most-recent-file-in-directory
			# Steam keeps a steam_autocloud.vdf file in here that isn't a savegame
			$latestSaveFile = (Get-ChildItem $fullSaveFolder -Attributes !Directory -Filter *.sav | sort LastWriteTime | select -last 1)
			$latestSaveFileName = $latestSaveFile.Basename

			$AutolaunchFilePath = "$($env:LOCALAPPDATA)\FactoryGame\$AutolaunchTempFileName"

			try {
				# cast to void suppresses output
				[void](New-Item $AutolaunchFilePath -ItemType File -Force)
				Add-Content $AutolaunchFilePath "[/Script/EngineSettings.GameMapsSettings]"
				Add-Content $AutolaunchFilePath "LocalMapOptions=??skipOnboarding?loadgame=$latestSaveFileName"
				Add-Content $AutolaunchFilePath "GameDefaultMap=/Game/FactoryGame/Map/GameLevel01/Persistent_Level.Persistent_Level`nGameInstanceClass=/Script/FactoryGame.FGGameInstance"
			} catch {
				Write-Error "Failed to create/modify autolaunch file ($AutolaunchFilePath)"
				Write-Error $_
				exit 1
			}

			$buildArgs = "$buildArgs", "EngineINI=`"$AutolaunchFilePath`""
			# $buildArgs = "$buildArgs", "EngineINI=`"C:\Git\SF_ModProject\RobWorkingDir\TestWorldAutoLaunch.ini`""
		}
	}

	return $buildArgs
}

$gameDir = $gamePathInfo["path"]
$gameEXE = $gamePathInfo["exeName"]
$GameString = "$($gameDir)\$($gameEXE).exe"

$Game1 = PrepareArgs $Game1 -applySpecial
$Game2 = PrepareArgs $Game2

function BGProcess(){
	if ($test) {
		Write-Output "Test switch used, not actually launching the game"
		Write-Output "Arguments for this game instance: "
		Write-Output @args
		return
	} else {
		Start-Process -NoNewWindow @args
	}
}

BGProcess $GameString $Game1

# TODO Multiplayer launch option is not working well right now
# - As of Update 8, the username option no longer works
# - Direct loading into a save does not properly set up a multiplayer session, meaning joining via `open 127.0.0.1` in the client won't work. the host must manually load another save file for that to be set up

if ($multiplayer) {
	sleep -m 5000
} else {
	return
}

BGProcess $GameString $Game2

Usage

After the launch script has been set up, use flags when running it to controls its behavior. Note that in order to use the branch feature you must have separate copies of the game installed in the locations you specified in the config section.

Assuming your powershell file is named SFLaunch_Advanced:

  • .\SFLaunch_Advanced.ps1 will launch the Steam Client version of the game - whichever branch you have installed with Steam, since that’s what the default arguments are set to.

  • .\SFLaunch_Advanced.ps1 -loadLatestSave will automatically load you into the last save file you made.

  • .\SFLaunch_Advanced.ps1 -launcher epic -side server -branch experimental will launch the Epic Games Experimental Dedicated Server

  • .\SFLaunch_Advanced.ps1 -multiplayer will launch two copies of the Steam game client

  • .\SFLaunch_Advanced.ps1 -launcher epic -branch experimental -multiplayer will launch two copies of the Epic Experimental game client

Note that the -multiplayer flag is currently incompatible with the -loadLatestSave flag and that the -loadLatestSave flag requires extra configuration to work with saves made in custom levels and doesn’t guarantee that you’ll be put into the same player pawn.

When using the -loadLatestSave flag, if the game can’t load the save for some reason (for example, trying to load a newer save in an older version of the game) the game will create and load into a new save file instead.

Launch Script Enhancements

Unreal supports many other command-line arguments, some of which may prove to be useful with MP testing. For example, -windowed -WinX=0 -WinY=0 will open the game in the top left corner of the screen. Similar arguments also exist for the console window (ConsoleX and ConsoleY). You can also specify what resolution you want the game to run at: -WinX=1280 -WinY=720.

If you want windows to open on other monitors, you will need to use either negative or larger numbers for the arguments. The top left corner of your primary monitor is X=0, Y=0.

Combining these options, you could end up with launch args like those shown below, which will give each instance as much screen space as possible (while accounting for Title Bar and Start Menu height) on a 1920x1080 resolution screen, at the cost of an unusual aspect ratio.

$Args1 = "-EpicPortal", "-NoSteamClient", '-Username="'+$Username1+'"', "-WinX=0", "-WinY=32", "ResX=960", "ResY=1040"
$Args2 = "-EpicPortal", "-NoSteamClient", '-Username="'+$Username2+'"', "-WinX=960", "-WinY=32", "ResX=960", "ResY=1040"

Multiplayer Testing

Locally testing multiplayer functionality requires one of the following approaches:

Approach A: Launch 2 game clients

You can run two copies of the game client at once and join one from the other using the game’s host and play multiplayer system. Normally the Steam and Epic Games launchers don’t allow you to do this, but the launch script in the previous section can detach your game from the launcher so you can run two copies. Note that doing so breaks "normal" multiplayer functionality and only allows using IP multiplayer sessions.

If you own the game on both Epic and Steam you can join one client "normally" from the other. Note that this requires you to compile your mod for both the Epic and Steam targets which can slow down development.

To do this:

  1. Run the launch script to open 2 copies of the game client.

  2. On the copy you designate as the host, select a save file to load. Before loading it, click the "Load Settings" button and change the "Session Type" to IP.

  3. On the copy you designate as the client, open the "Join Game" menu and enter the ip 127.0.0.1. Alternatively, use the open 127.0.0.1 console command from anywhere.

There is currently a bug in Satisfactory itself causing the host to crash when a client joins in this manner. Until this is resolved, either use an Epic and Steam copy or Approach B.

Approach B: Launch Client and a Dedicated Server

You can run a dedicated server locally and connect to it with a game client. This has the downside of needing to compile your mod for both the client and server targets every time you want to test, which will slow down development.

Dedicated servers will automatically load a save file on launch, which may or may not speed up your testing process depending on what behaviors you are testing.

To use this approach, check out the dedicated server section of this page.

Load a Custom Level on Launch

The launch script demonstrates how to make the game to automatically load to the game world on launch, as opposed to the main menu, cutting down on load time and clicks when testing your mod. However, you will need to tweak it slightly if the level you want to load is a custom level.

Notice that the powershell script’s loadLatestSave option creates an ini file on the fly containing instructions to load into a specific save file and GameDefaultMap. You’ll either need to modify the powershell script to point to your custom level or create your own ini file for it to use instead.

First, you’ll need to find the path to use for your custom level. It’s based on the level’s asset path. For example, Nog’s Level’s level asset is at the content root, so its path is /NogsLevel/NogsLevel.NogsLevel. Example Level’s is a few layers of folder deep, it’s path is /ExampleMod/Maps/ExampleLevel/ExampleLevel.ExampleLevel.

While you’re at it, there are a few other flags you can use to customize the loading process:

FG Map Options Switches from Archengius:

NOTE: These are from 2021 and may be outdated.

Switches found in AFGGameMode::InitGame:

?skipOnboarding (skip landing animation)
?allowPossessAny (allow possessing any pawn on the map, even if player IDs don't match)
?loadgame=<SaveGame Name Here Without Path and extension>
?startloc<Start Location Tag Name> (see AFGGameMode::ChoosePlayerStart_Implementation)
?sessionName=<Session Name> (sets mSaveSessionName, so apparently it determines autosave file name and probably name visible to other players?)
?DayLength=<Day Length In Minutes>
?NightLength=<Night Length In Minutes>

General notes:
  Regarding Start Location Tag Name:
      - TRADING_POST is the hub APlayerStart actor tag
      - Any APlayerStart actor with matching PlayerStartTag is selected
  Regarding Session Name:
      - Apparently there is a system of "bundled saves" that I know nothing about. Further investigation is required.

Switches found in AFGGameSession:

?Visibility=SV_Private/SV_Public (Session visibility)
?adminpassword=<Admin Password used in console command AdminLogin to gain host privileges>

There is also ?bUseIpSockets linked with offline sessions
Apparently it disables EOS sockets and makes the game fall back to normal IPv4 sockets

Option 1: Modify Powershell Script’s Automatic ini Generation

Alter the Add-Content instruction that adds a GameDefaultMap to point to the asset path of your custom level. Note that this requires you to use the loadLatestSave flag (since that’s what causes the script to generate the ini file) or modify the script to use the ini file under other conditions.

Option 2: Use Your Own ini File

Note how the powershell script uses the EngineINI option to point to an Engine.ini file to use when launching the game.

You can manually write an ini file and modify the powershell script to always launch the game with it, or, launch separate from the powershell script by writing your own command.

For example, if your file was called LoadMapEngineConfiguration.ini, your launch command could look like this:

"D:\SatisfactoryExperimental\FactoryGame\Binaries\Win64\FactoryGame-Win64-Shipping.exe" -EpicPortal -NoMultiplayer -Username=Player1 EngineINI="D:\SatisfactoryExperimental\LoadMapEngineConfiguration.ini"

Note that you will have to modify this example command so that it points to where you have the game installed.

You might want to save it in a batch file or powershell script for easy execution later.

Option 3 - Add to Default Game Configuration

Instead of creating a new file for your configuration, you can edit your default game configuration, found at %APPDATA%/Local/FactoryGame/Saved/Windows/Engine.ini.

If you choose this option, the game will always launch using this config no matter where you launch it from, even when mods are not installed.

Dedicated Servers

In order to start testing on dedicated servers, you will first need to set up your own dedicated server.

Setup

You have a few options for setting up the server. Consider which of these would work best for you before moving on to the next section.

Note that in order to perform the first time server claiming process you will need to use a client of the game that was launched normally (ex. through Steam or Epic). After the server claiming process is complete you can return to using a copy launched with the launch scripts described elsewhere on this page.

Option 1: Locally Installed Dedicated Server

You can install the dedicated server on your own computer and run it locally. This places extra strain on your computer and may not be feasible if you have a lower-end system. However, it is usually the easiest option to set up.

In this option, since the dedicated server will be sharing your own personal copy of the game’s save folder, attempting to upload saves to it will fail, since the save is already present in that folder. Selecting a save to use will require editing the server’s session name; follow the directions on the Satisfactory wiki to do this.

Since the server you will be testing with does not need to connect to the internet, following the wiki’s directions for correctly authenticating with Steam or Epic servers are not required. The minimum suggested launch arguments for a dedicated server is .\FactoryServer.exe -log -EpicPortal -NoSteamClient.

You can connect to a locally hosted server either through the normal server browser or with the open console command, for example, open 127.0.0.1.

Option 2: Remote Dedicated Server

You can also set up the dedicated server on another computer on your network. This avoids resource strain on your own computer.

It is possible to provide a network location in the Copy Game to Path Dev Packaging setting option, for example //192.168.1.42/appdata/satisfactory, meaning that Alpakit will handle copying and replacing the files on the remote server for you.

You’ll still need to restart it after every package for the server to reload file changes.

Option 3: Ask Nicely on Discord

A community member may have a dedicated server they can give you access to in order to test mods on. Ask in the modding help channels and see if anyone speaks up, but you may not get a response.

You will likely have to manually transfer each testing build of the mod to the server.

Option 4: Cross your Fingers

The option of last resort: you can compile your mods for dedicated servers and release them without testing them. Do not assume that silence means the mod is bug free - some users will not bother to report errors they encounter. If you choose this route, you should mention on your mod page that your mods haven’t been tested extensively on dedicated servers.

Installing and Claiming the Server

Now that you’ve decided how you want to set up your server, follow the directions on the Satisfactory Wiki to set up a working dedicated server and verify that you can connect to it with an unmodified client.

Once you’ve verified that you can connect to the vanilla server you can start adding mods to it. Either install them the same way an end user would or follow the process outlined in the Option section you selected above.

Modify Online Subsystem Behavior

Additional information about the Online Subsystem. This info is from 2023 and may be out of date.

True offline mode information from Archengius:
Example configuration file to run game offline with just IP sockets and no online subsystems and strings attached whatsoever

[/Script/EngineSettings.GameMapsSettings]
GameDefaultMap=/Game/FactoryGame/Map/MenuScenes/Map_MenuScene_Update_06.Map_MenuScene_Update_06
ServerDefaultMap=/Game/FactoryGame/Map/DedicatedserverEntry.DedicatedserverEntry
LocalMapOptions=

[URL]
Name=Player
Port=7777

[/Script/Engine.Engine]
NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
NetDriverDefinitions=(DefName="BeaconNetDriver",DriverClassName="/Script/OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
NetDriverDefinitions=(DefName="DemoNetDriver",DriverClassName="/Script/Engine.DemoNetDriver",DriverClassNameFallback="/Script/Engine.DemoNetDriver")

[OnlineSubsystem]
DefaultPlatformService=NULL
NativePlatformService=NULL

[OnlineSubsystemSteam]
bEnabled=false
bRelaunchInSteam=false

[OnlineSubsystemEOS]
bEnabled=false

[OnlineSubsystemNull]
bEnabled=true

Example command line:

FactoryGame-Win64-Shipping.exe -NoEpicPortal -EngineIni="C:\EpicLibrary\SatisfactoryExperimental\OfflineEngineIni2.ini" -Multiprocess -Log

-Multiprocess prevents game writing to any files (which is really what you want if you plan running multiple instances simultaneously) and -Log opens the console log window