Collection of image-based basic tutorials for CryEngine on Windows

#1
These short tutorials are more like guides on how to get started, build, distribute, and deploy in-development and finished games and plugins.
Disclaimer: These steps were performed on a clean windows 7 64-bit installation after necessary graphics and system drivers and windows updates have been applied, steps may vary between cryengine and crylauncher versions, I take no responsibility or liability for any damages or inconveniences caused by following any information provided. All information provided is of my best knowledge and opinion and is not official in any way, use at your own risk.


The index will not work without an addition to the phpBB BBCode Custom rules. (ie. Allowing/Adding [anchor] tags and anchor link tags [goto=anchorname]).
You can however find the headings related to the content you want using copy and search from this index list.

*Tip: Right-Click on an image and choose "Open in a new tab" to view a larger/native size version of the image.

Tutorial Index
  1. Getting started with CryEngine Launcher
    1. Downloading and using the launcher
    2. Creating and initializing your first project
    3. Opening and testing your new project

  2. Getting started with Visual Studio and your Project
    1. Installing Visual Studio
    2. Using Visual Studio with your project
    3. Some notes about Build Configuration types

  3. Getting started with CryEngine on GitHub
    1. Setting up GitHub with the desktop client
    2. Getting the git engine on to your system
    3. Setting up and Registering your local engine
    4. Using Visual Studio with your local engine
    5. Building and testing your local engine
    6. Using the custom engine with your project
    7. Using sandbox with your custom engine
    8. Some notes about Build Configuration types

  4. Distributing/Sharing your project
    1. Requirements and information.
    2. Distributing only your project CE5.1+
    3. Distributing a development package CE5.1+
    4. Distributing a development package CE5.4+
    5. Distributing a release package to end users

1. Getting started with CryEngine Launcher

a. Downloading and using the launcher
Start by creating an account by navigating to https://www.cryengine.com/get-engine.
Image


Follow the installation steps after opening the downloaded file and activating your account via email,
then launch and login to the cryengine launcher now installed on your system.
Image


Once logged in you should be presented with a similar screen to this;
Image



b. Creating and initializing your first project
Now that we are logged in and ready to go, let's start by creating a new project. Click "Create a project" in the left pane.

Select the template you wish to start with, and choose an appropriate project name.
Image


After clicking "Create Project" for the first time, you will be presented with this screen, simple click "Initialize Project".
Image


You should now notice the engine version that you selected to use for your project now downloading:
Image
Image


Be patient while the engine downloads and installs, this may take some time depending on your internet and computer speed.
You can check the full progress by navigating to "Library > My Engines"
Image


Once the engine has been installed, you can proceed to the next step
Image




c. Opening and testing your new project
Let's start by launching the editor for our project, navigate to your projects (Library > My Projects), click on the project (not the cog weheel or gamepad).
Image


This should launch the editor, just close it for now.
Image


Now click on the gamepad when you hover over your project in your library (Library > My Projects), you should see your project launch. Close this for now.
Image


You should now be able to load the editor and test the game in this fashion. In this regard, you do not need any programming experience, or even need to touch or see any code.
These steps should be completed by any developer working on your title, this way, you know everyone on your team has the launcher, and that it works.

^ Back to index


2. Getting started with Visual Studio and your Project

a. Installing Visual Studio
For simplicity, we will assume you do not have a licensed copy of visual studio (or it would surely be installed already).
Head over to https://www.visualstudio.com/vs/community/ and click "Download Community 2015" (Make sure to read the Usage terms near the bottom of the page)

When installing visual studio make sure to select "Universal Windows App Development Tools"
Image


Once Visual Studio is installed, you may follow the steps to generating and opening your project solution files.


b. Using Visual Studio with your project
Before we proceed you will need CMake installed. There is an installer (.msi) provided at https://cmake.org/download/ .
Image


First we want to generate our solution file for our project. The Cryengine launcher makes this very easy.

Navigate to your project file (You can do this in the launcher: Library > My Projects > Click cog wheel > "Reveal in explorer"
Then right click on your project file and select "Generate Solution"
Image


After generating a solution you will have a new folder in your project directory called "Solutions". You solution file needed for visual studio is inside this folder;
Image


Now you are able to load your project solution, and build using visual studio. take note of the below notes on different build configuration types such as "Debug" and "Release"


c. Some notes about Build Configuration types
For development you should be using "Debug", or at least "RelWithDebInfo" for your project, "Profile" is more compatible for building the engine and combining with the crytek launcher binaries).
When you want to distribute/package your game or do some performance test you should choose "Release" config when building.

Special Note:
If you are _not_ using the crytek launcher engine binaries (is. using your own custom cry engine build from the github source code) then you should be aware that building your custom engine in "Release" mode will produce different binaries than the crytek launcher binaries and will be incompatible with your project dll and any other externally built dlls, including those provided by the launcher engine.
As such, to be able to use your project dll with your custom engine in release, you must add/define the "_RELEASE" macro when building your project. Simply go to your projects "stdafx.h" and add "#define _RELEASE 1" on it's own line after the "#pragma once". DO NOT add this macro if you did not build your custom engine using the "Release" configuration - Only if you built your engine using "Release" config.

Now you can start making changes to the code of your project. Be aware that any files you add or remove will need to be added to your "CMakeLists.txt" file in your "Code" folder.

^ Back to index


3. Getting started with CryEngine Source Code on GitHub

a. Setting up GitHub with the desktop client
Begin by registering an account on github.com. Then download the GitHub desktop client from https://desktop.github.com/ .

Install the GitHub client;
Image
Image


You may need to login to the client using your github username and password when your start it up.


b. Getting the github engine on to your system
This is easy, go to cryengine on github: https://github.com/CRYTEK-CRYENGINE/CRYENGINE and select "Clone or Download" > "Open in Desktop".
Image


Choose a directory on your system to download the CryEngine source code folder to:
Image


GitHub Desktop will begin downloading the source code for CryEngine:
Image



c. Setting up and Registering your local engine
Now you can open the folder to the source code like shown:
Image


Now we need to setup our engine for editing, first open download_sdks.exe.
Image


Now to make it easier we should copy the "engine" and "gamezero" asset folders from the launcher engine to our custom engine.
Image


Paste them into your local cryengine directory (from github):
Image


Merge the folders when prompted (There should not be any overwrite dialogs).
Image


Now we want to register our engine. Create a file named "MyEngine.cryengine".
Image


Edit the file with notepad and put these contents, then save and close:

Code: Select all

{
    "info": {
        "version": "5.3.2",
        "name": "MYCRYENGINE 5.3",
        "id": "myengine-5.3"
    }
}


Now double-click "MyEngine.cryengine" (run the file you just made). This will register our custom engine so we can assign projects to use it.


d. Using Visual Studio with your local engine

Once the download is finished, open/run "cmake_create_win64_solution.bat":
Image


You will then be presented with the cmake gui, for now, unselect "OPTION_GAMESDK" and select "OPTION_GAMEZERO". Then click "Configure".
Image


The screen should go from red to white, once this happens, click "Generate".
Image


Once the task is finished (Progress is the green bar in the lower right corner of the program gui window), click "Open Project".


e. Building and testing your local engine
First set the startup project to the "Windows Launcher" project:
Image


For now, choose "Profile" for the build configuration type:
Image


We should now be able to immediately build the engine:
Image


Once the engine has finished building, and there are no errors in the output log (at the bottom), you can launch and debug your engine:
Image



f. Using the custom engine with your project
To debug your project, make sure you build your project using the same "build configuration" (release/debug) as the engine.

First, navigate to your project file (You can do this in the launcher: Library > My Projects > Click cog wheel > "Reveal in explorer"
Then right click on your project file and select "Switch Engine Version"
Image


In the drop down select your custom engine, in this example "MyEngine": (MAKE SURE Visual studio is Closed/Not Running!)
Image


Now regenerate your solution, then build your project. Then try to launch the game (AFTER building your engine!)


--------- Not needed/Unnecessary but good to know ---------
Manually changing engine in solution:
You can add a command line option to the debugger launcher params in the "windows launcher" project:
Image


Note: You can make a similar change in the debugging params of your project, so you can debug straight from your project solution with having to open or touch the engine solution.
In your Project solution, right click on the "Game" project and go to "Properties".
Make sure "All Configurations" is selected under "Configuration" at the top.
Navigate to "Configuration Properties" > "Debugging" (As shown above) and set the "Command" to the absolute location of your custom engine launcher exe (in this example: C:\git\CRYENGINE\bin\win_x64\GameLauncher.exe)
Then set the "Command Arguments" to your project as shown above. (in this example: -project "C:\Users\Uniflare\Documents\CRYENGINE Projects\My Project FPS\Game.cryproject")
* These may already be set depending on whether you have switched engine version for your project before or after generating your solution.
------------------------------------------------------------------------------------------


g. Using sandbox with your custom engine
First, you need to make sure of a few requirements:
  • 64bit Operating System
  • Successfully built the engine binaries in "Profile" "x64" configuration
  • Custom & Launcher engine versions must match (Differing versions *may* be compatible, like minor releases, but definitely not recommended)
  • The default Sandbox, and your built custom engine, work as expected

Assuming you meet the above requirements, this is an easy copy and paste task.

First, Copy "Editor", "Tools" and "Editor.cfg" from launcher engine;
Image


Paste them into your custom engine folder;
Image


Select yes to merge the folders;
Image


Select "Don't Copy" or "Skip" when asked to overwrite files;
Image


Next, copy the binaries from the launcher engine;
Image


Paste the binaries into your custom engine bin folder;
Image


When asked to overwrite files choose "Don't Copy" or "Skip";
Image


Now we should be able to successfully can open the sandbox;
Image


And open the example level from the GameZero project provided by the engine source code;
Image


You should now see the gamezero example level loaded and running inside the editor;
Image



h. Some notes about Build Configuration types
For development you should be using "Debug", or at least "RelWithDebInfo" for your project, "Profile" is more compatible for building the engine and combining with the crytek launcher binaries).
When you want to distribute/package your game or do some performance test you should choose "Release" config when building.

Special Note:
If you are _not_ using the crytek launcher engine binaries (is. using your own custom cry engine build from the github source code) then you should be aware that building your custom engine in "Release" mode will produce different binaries than the crytek launcher binaries and will be incompatible with your project dll and any other externally built dlls, including those provided by the launcher engine.
As such, to be able to use your project dll with your custom engine in release, you must add/define the "_RELEASE" macro when building your project. Simply go to your projects "stdafx.h" and add "#define _RELEASE 1" on it's own line after the "#pragma once". DO NOT add this macro if you did not build your custom engine using the "Release" configuration - Only if you built your engine using "Release" config.

^ Back to index


4. Distributing/Sharing your project

a. Requirements and information.
Requirements vary depending on which type of distribution you are doing (project-only/dev or release).

Choose one of the following and make sure you meet the requirements:
  1. Project-only distribution
    • Your project builds and runs succesfully.
    • Target recipient has the same engine version installed and works.
  2. Development package distribution
    • Your project builds and runs succesfully.
    • Target recipient has the essential runtimes installed (C++/DirectX etc)
  3. Release package distribution
    • Using a custom engine, and successfully built and run in release configuration.
    • All game assets/levels and custom shader caches wrapped into .pak files.


* Only developments packages can be created and distributed using the launcher engines. To create and distribute a release package, you will need to setup and build the engine yourself using the github source code.
* If you are using a custom engine of the same version in the guide, the steps should match for development packages. For project-only, notes are provided in the next section.


b. Distributing only your project CE5.1+
Make sure you meet the requirements stated above for "Project-only distribution".
This requires your target user to have the cryengine launcher installed.

The folder your project files start in after creating a new project from the launcher is self-contained - that is to say you can move this folder to anywhere on your computer (5.1+) and it will still run. This means you can simply zip your entire project folder (Usually from: "%UserProfile%\Documents\CRYENGINE Projects") and pass this package to your friend however you wish.
However this assumes your friend has the launcher installed, and working, using the same version you used to build your project.

* Your friend can also "Import" the project into their CE Launcher app for easier access via the launcher.
* If you use a custom engine you will have to provide your engine data, .cryproject functionality will always require the CE Launcher installed. Make sure the custom engine is registered properly on the target machine.


c. Distributing a development package CE5.1+
Make sure you meet the requirements stated above for "Development package distribution".
This does not require your target user to have the cryengine launcher installed.

1. Create a new folder "C:\MyGame" for the game package.
Image


2. Copy the launcher engine binaries from "C:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_5.3\bin\win_x64" to "C:\MyGame\bin"
Warning: DO NOT COPY SANDBOX. The use of sandbox requires the end-user to agree to a terms of service prompted during the cryengine launcher app installation.
Image

Image


3. Create a new file "C:\MyGame\system.cfg"
Image


4. Put the contents, without quotes, as: "sys_game_folder = Assets"
Image


5. Copy your project Assets directory from "My Documents\CRYENGINE Projects\My Project FPS\Assets" to "C:\MyGame\Assets"
Image

Image


6. In your assets folder open "game.cfg" and add this line, without quotes: "sys_dll_game="
Image

Image


7. In your assets folder select all folders (except levels) and put them into a .zip (7zip or winrar, you can use windows default zip features too).
Image

Image


8. Rename the .zip to a .pak (the actual filename does not matter).
Image


9. To save on space delete the folders you put into the zip/pak file.
Image


10. Now copy your cryplugin.csv file from "My Documents\CRYENGINE Projects\My Project FPS\cryplugin.csv" to "C:\MyGame\cryplugin.csv"
Image

Image


11. Open the copied cryplugin.csv and change "bin/win_x64/Game.dll" to "Game.dll"
Image


12. Now copy your project Game.dll from "My Documents\CRYENGINE Projects\My Project FPS\bin\win_x64\Game.dll" to "C:\MyGame\bin\Game.dll"
Image

Image


13. Then copy the engine pak folder from "C:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_5.3\engine" to "C:\MyGame\engine"
Image

Image


Now try running "C:\MyGame\bin\GameLauncher.exe"

14. To save space and prevent improper usage, while you are still running the gamelauncher.exe, select all files in the bin folder and try delete, whilst skipping the files that are "in-use". NOTE: You may want to skip deleting the render dlls too.
Image

Image

Image




d. Distributing a development package CE5.4+

-- Coming Soon --
* May require the target machine to have the cryengine launcher app installed.
* Same procedure except the steps for the system.cfg/cryplugin.csv (now handled by default game.cryproject)


e. Distributing a release package to end users

This is a rather large topic since it encompasses a whole lot of optimization procedures, compression/conversion etc. Essentially the same procedure as the development package once you have optimized your data/assets.
You will want to use RC (check docs) to convert any assets still in intermediary form (i_caf) or even raw form (tif), remove any redundant assets, rebuild your shader cache for your entire game (check docs), pak and encrypt all required engine/game assets and data, secure the engine binary by building in release mode without any profiling/debugging options etc and then finally package your data as described above for the development packages, although the cfg/plugin etc should be hardcoded now inside the engine code.

-- This might be updated later --
More information: https://www.cryengine.com/community_arc ... 2&t=135268

^ Back to index


Took longer than expected, expect updates to this guide regarding distribution/packaging.

--

Edit 30/06/17 - Restructured packaging instructions for clarity. Prepared 5.4 packaging stub.
Last edited by uniflare on Thu Jun 29, 2017 11:10 pm, edited 7 times in total.
Beginner Guides | My GitHub | Splash Plugin | CMakeLists Gen | C++ Project Templates

Re: Collection of image-based basic tutorials for CryEngine on Windows

#3
It's not finished yet but I thought I would put what I had up so far since most of it is there, will finish it soon after a little break :).
Also, any suggestions etc welcome, I can tell the images are off size and would be nice to have them all automatically "Thumbnail" for us but I guess that is a feature for the future.

Cheers
Beginner Guides | My GitHub | Splash Plugin | CMakeLists Gen | C++ Project Templates

Re: Collection of image-based basic tutorials for CryEngine on Windows

#7
You forgot add note about - CryPatsy's pythons script. Actually I have made some changes and now got similar script for build GameZero project

>Also, any suggestions etc welcome
Did you tried to use PakEncrypt for the GameZero project ?

Code: Select all

cd C:\CRYENGINE-release\Tools\PakEncrypt
dist\ParseBuild\ParseBuild.exe encrypt In Out
pause

I have a crash with encrypted paks (even if I just use GameZero default scene), don't know why :cry:
but in same time sign works fine ("sign" - the *.pak files are openable but you don't able to edit it, put new data into it)

Code: Select all

cd C:\CRYENGINE-release\Tools\PakEncrypt
dist\ParseBuild\ParseBuild.exe sign In Out
pause

Re: Collection of image-based basic tutorials for CryEngine on Windows

#9
arcticlion wrote:You forgot add note about - CryPasty's pythons script. Actually I have made some changes and now got similar script for build GameZero project

>Also, any suggestions etc welcome
Did you tried to use PakEncrypt for the GameZero project ?

Code: Select all

cd C:\CRYENGINE-release\Tools\PakEncrypt
dist\ParseBuild\ParseBuild.exe encrypt In Out
pause

I have a crash with encrypted paks (even if I just use GameZero default scene), don't know why :cry:
but in same time sign works fine ("sign" - the *.pak files are openable but you don't able to edit it, put new data into it)

Code: Select all

cd C:\CRYENGINE-release\Tools\PakEncrypt
dist\ParseBuild\ParseBuild.exe sign In Out
pause

iruiz wrote:Hello,

To be honest, this is the best startup guide I've read for this engine... Thank. You. Very. Much.

Best.


Thanks for the feedback!

I do know of the script but I wanted to go for the most basic of tutorials without any extra downloading or scripting. I personally havn't used python or that script so that is also partly the reason :).

I have not got to the encryption and full release part yet, but will hopefully cover that soon. If you are having a specific issue you might want to start a thread in Getting started with CRYENGINE sub forum.
Beginner Guides | My GitHub | Splash Plugin | CMakeLists Gen | C++ Project Templates

Re: Collection of image-based basic tutorials for CryEngine on Windows

#10
Thanks for the tutorial, but ive got a problem with generating solution. When i press the generate solution button a window pops with only the following in it:

Code: Select all

"F:\Program Files..... \cryrun.exe" "projgen" "F:\....\GameSDK.cryproject"
(file path is full and correct) Nothing more, and 1 sec later the window closes without creating solution folder or giveing any error msg. I've installed cmake. Any idea?

Who is online

Users browsing this forum: No registered users and 1 guest