Jump to content

Basic Principles Of Modding

From WarhammerWorkshop
Revision as of 23:02, 26 April 2025 by Neo Kesha (talk | contribs) (Created page with "== Space Marine 2 PAK == Game uses PAK files to store all the game assets. PAK file is essentially just ZIP archive you can open or create with any archiver. There are few requirements: * All files inside of PAK must be lower case * Format of file must be ZIP, not RAR or any other archiving format * Compression must be "Store" (No compression) ** You can compress non graphical files, but to avoid confusion and mistakes it is adviced not to use compression Vanilla PAK f...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Space Marine 2 PAK

Game uses PAK files to store all the game assets. PAK file is essentially just ZIP archive you can open or create with any archiver. There are few requirements:

  • All files inside of PAK must be lower case
  • Format of file must be ZIP, not RAR or any other archiving format
  • Compression must be "Store" (No compression)
    • You can compress non graphical files, but to avoid confusion and mistakes it is adviced not to use compression

Vanilla PAK files are accompanied with a cache file. Cache file is not required for modding.

Client and Server assets are separated. You can find client assets at "client_pc/root/paks/client/" and server assets at "server_pc/root/paks/server/"

Resource PAK

Both client and server have resource tree metadata stored at "resources.pak". More on resources tree read at Resource_System

Default PAK

Delfault paks contain all of the base game resources.

  • default_other.pak - Space Marine 2 is mainly data driven and most of the parameters, descriptions, defenitions, AI logic and server scenarios are stored there as a text files in Property Section format.
  • default_ssl.pak - this pak contains game's scripts in SSL - Saber Scripting Language. Those scripts are compiled into sslbin files. sslbin editing and replacement isn't supported by modding system
  • default_pct_x.pak - contains all of the textures
  • default_tpl_x.pak - contains all of the models
  • default_td.pak - contains all of the materials

Local server

During modded sessions, game uses local server instead of server hosted by Saber. One of the players will act as a host, running a local server with all server modifications installed on their build. When playing with server mods, ensure that all players have the same server mods installed to avoid problems with server migration.

Virtual File System

Space Marine 2 uses Virtual File System for handling resources and assets. Mods use VFS to completely override vanilla files with modded files. Space Marine 2 have no delta-patching, mods can only replace file whole.

Local folder

You can replace files by putting them in "client_pc/root/local" folder. You can place client, server and resource files in this local folder.

Example on how Local Folder will look

Example: if you want to replace a file with path "/ssl/main/user/weapon_loadouts/initial_mastery_infos_library.sso" from defaullt_other.pak, you create the same folder structure in your local folder like this: "/client_pc/root/local/ssl/main/user/weapon_loadouts/initial_mastery_infos_library.sso"

Local folder is mostly used for development, as it can cause performance issues.

Mods folder

Preferred way to install and redistribute mods are mod paks. You simply place your mod pak into "client_pc/root/mods" folder. Mod Paks do not require cache files, but otherwise the same as regular paks you wil find in default folder. All requirements for pak format apply too:

  • All files inside of PAK must be lower case
  • Format of file must be ZIP, not RAR or any other archiving format
  • Compression must be "Store" (No compression)
    • You can compress non graphical files, but to avoid confusion and mistakes it is adviced not to use compression

As an example on how to create your mod pak, considering you have a setup in local folder, you just select all your files in local folder (not local folder itself) and use any archiver to create a zip file without compression, then change its extension to ".pak"

Root of your mod pak file must contain folders like "ssl", "tpl", "td" and etc, like what you'd see in root of default paks or your local folder, not "local"

It is adviced to name your mod paks in lower case, as you would name internal files, to avoid unexpected problems.

Mod Paks have priority over Derfault paks. Mod Paks are loaded in alphanumerical order and the pak that was loaded first have greated priority over later modpaks. For example, if mod_a and mod_b modify the same file, game will use file from mod_a.