Prerequisites
This article assumes that you have the main CRYENGINE programming prerequisites referenced in Getting Started__.
Downloading the Engine
The CRYENGINE source code is hosted on GitHub - allowing anyone to access the source for the triple-A engine for free, and providing the ability for users to send improvements back to Crytek and the community.
To get started, open the repository in your web browser by clicking this link. Once open, click Clone or Download and then Open in Desktop to open the repository in the GitHub Desktop client.
The GitHub Desktop client should then pop up asking where you want to store your repository. Choose an appropriate location and wait for the download to finish.
Once finished, you should see the CRYENGINE repository in the GitHub Desktop client as pictured below.
Installing the latest Project Management System
Once you have successfully cloned the CRYENGINE repository you can then begin the installation process.
First we will want to install the latest project management system CryVersionSelector, this is recommended so that we can be sure we have the most up-to-date options and routines when, for example, right-clicking a project file. You can do this by executing the following file from your cloned repository: Tools/CryVersionSelector/Install.bat
Generating the Visual Studio solution
By running cry_cmake.exe file we will first download the required Third-Party SDKs for the engine and then proceed to configure, generate and then open the Visual Studio solution file seamlessly.
Begin by running the mentioned cry_cmake.exe file in the root directory of your cloned CRYENGINE repository and select Download SDKs.
Once the download is finished you will be presented with a choice of which solution configuration to build. It is recommended to choose the 64bit (x64) configuration of whichever version you wish to use.
Once the next step is completed you should be presented with the CMake Configuration GUI. Here you can simply select Configure until there are no more red-highlighted options, then Generate and finally Open Project. Feel free to select the options you wish once you are more familiar with what they are.
You should now be able to compile the engine source code and run directly from within Visual Studio.
Registering your custom engine
It is a good idea to register this engine with the project manage system with a unique identifier. This will allow projects to be assigned to use this particular engine installation. The unique identifier should be unique for every unique file path you want to register with an engine.
To do this we will modify the cryengine.cryengine file in the CRYENGINE root directory.
You may open this file with your preferred Text editor. Notice at the top of this file there are default values defined for the id, name and version properties. For now we are only interested in the id and name properties.
For more information on the structure of this file, please refer to the Projects & Plugins document.
For our purposes we will add 'github' as a suffix to both values.
Simply save and close this file. Now we can easily register this engine in the project system by executing the cryengine.cryengine file. Alternatively you can right-click the modified file and choose Register engine. This will allow you to choose this engine in the drop-down menu displayed when using the Switch engine version option on a project.
Engine compilation notes
Notes:
- Sandbox source code cannot be built in the release build configuration. This limitation only applies to the Sandbox project and related plugins.
- Make sure that projects you run using your custom engine are designed for the version you are developing on. Interface changes between versions could cause compilation or runtime errors if there is a version mis-match.
- Make sure when choosing certain options (ex. DX12) that you machine is compatible and required SDKs are installed correctly.