This document applies to version 3.8.6 of CRYENGINE.
Sometimes, you want to ship the most optimized and most secure binaries and assets for a project to your end-users.
|Table of Contents|
Setting up cryptography keys
Open a command prompt, and make
<root>/Tools/PakEncrypt the current directory.
It's not required to provide the RSA key for profile or debug configurations.
Setting up CVar whitelist
In the file
<root>/Code/GameSDK/GameDll/GameStartup.cpp there is a function:
However, think of the target machines of end-users and don't freeze quality CVars at too high quality levels.
Creating a Release build
You should compile your code in the
[GameSDK] Release (and
[GameSDK Server] Release if you use dedicated servers in your project) configuration for your target platforms.
Don't mix release with non-release DLLs (ie, don't rename DLLs), because they are NOT compatible and the end result will be unstable, if it runs at all.
We will not go into detail in this document on how to pack your assets, but we assume you have all the assets required by the game packaged into appropriate PAK files.
See also Compiling Assets for Multiple Platforms and the RCJob_Build_SDK.xml that has been shipped to you.
Collecting files into staging
Copy ONLY the following files to a new folder that will contain all the files for the final version of your project (ie, the distribution)
Note for users that are not using Visual C++ 2012 compiler, make sure that runtimes (if any) are either shipped or are installed in some other way.
We recommend against mixing runtimes from different Visual C++ editions, since it can (theoretically) cause hard to diagnose bugs.
Signing / Encryption of assets
Once you have your staging folder set-up, you need to either sign OR encrypt your asset PAK files.
As an optimization, you can also copy only PAK files into the staging folder (keeping the correct folder structure), and copy all non-PAK files directly to the output folder (with the same structure), which saves a copy operation for those files.
Test and redistribute
Now you can take the contents of the output folder and test or redistribute it.
Redistributing via a specific publishing platform (ie, Steam) is outside the scope of this document. You should probably read the documentation provided by the publishing platform to find out how it works.
The same comment applies to installers of various kinds, as long as the directory structure is maintained and all the files mentioned above are present, the project should be runnable.
Sometimes it's hard to debug issues with Release builds, because code is optimized and assets may not be easily accessible.
Here are some pointers to isolate problems:
My game doesn't run in Release mode
Make sure that:
- You have your PAK files signed or encrypted.
- You have the correct key set in the code.
- The profile/debug version of the game does run with the same assets (and the same key).
My CVars don't work in Release mode
Make sure that:
- The CVar in question is white-listed in your code.
My assets cannot be found in Release mode
Make sure that:
- The asset exists in a PAK file, and the PAK file is in the list of PAK files to load in the code.
- The PAK file containing the asset is signed or encrypted with the correct key.
I get a lot of warnings about "Non binary XML found"
This is not a fatal error, however you can convert your XML files to binary XML using RC, see also Binary XML conversion
The conversion is recommended for an end-user distribution
I cannot connect to a dedicated server
Please note that you should connect release clients with release servers. (And also, you should connect profile/debug clients with profile/debug servers)
I have some other problem
The default value of log_severity in release builds are quite low, so to debug an issue it might make sense to set it to 3 or 4 to get more information and messages.
Note that, unless you whitelist this CVar, setting it in system.cfg will not actually work.