The Game Code package supply the GameDLL C++ source code along with the required header files to access most of the CRYENGINE systems. It is stripped down for users who don't have access to the full Engine Code.
Starting with 3.6.3, users of the Game Code package now also get additional access to the CryAction and CryInput projects, including all the source files required to build CryAction.dll and CryInput.dll for Windows platforms.
CRYENGINE licensees who obtained a full Engine Code License should only use the Engine Code package which already includes all the files supplied in the Game Code package.
The GameDLL provides developers a project where they can implement a game class based on the IGame interface. It's also possible to implement new Entity class and extensions to game systems (i.e. vehicle movements, firemode or AI characters).
- Microsoft Visual C++ 2012
Using a different version of Microsoft Visual C++ might produce a GameDLL incompatible with the engine.
STLport is an open source implementation of the Standard Template Library (STL) different from the default implementation shipping with Visual Studio.
The STLport source code is included in the CRYENGINE SDK. However, Visual Studio needs to be set up to make use of STLport instead of the default STL implementation using the following steps:
- Go to Tools/Options in the main menu and select VC++ Directories under Projects and Solutions.
- Select Platform Win32 and add the path <CRY_SDK_ROOT>\Code\SDKs\STLPORT\stlport at the top of the Include files and Library files list. It is essential that the STLport path is above the default Visual Studio include and lib paths in the list.
- Repeat the previous step for the x64 and other platforms, as required.
The following table describes the solution file supplied with the CryENGINE SDK.
Solution delivered to full Engine Code licensees.
Solution delivered to other users.
The CryEngine.sln solution is only supplied with the full engine source code. The content of the CryEngine_GameCodeOnly.sln solution is included in CryEngine.sln.
The Game Code solution can always be compiled in either Debug or Profile configuration. Compiling the Release configuration requires the access to full engine source code.
Headers for all the interfaces of CRYENGINE.
Include headers for the Game Framework which include the implementation of Flowgraph, Vehicle, etc.
Starting with 3.6.3: Includes all header and source files for CryInput on Windows
Source files for the reference game shipped with the SDK
The header files from CryCommon and CryAction are required to recompile the GameDLL.
Where to start
The code handling the initialization of a CRYENGINE game is contained inside
Code\GameSDK\GameDll\GameStartup.cpp. The function CGameStartup::Reset() is handling the allocation and initialization of the IGame interface.
For adding any game specific initialization, it is recommended to look into CGame::Init(). This function is called once when the game is loaded. The function CGame::Shutdown() will be called when the game is being shutdown.
Any function that needs to be updated for every frame should be added to one of the two update functions.
After making and building code changes in the GameDLL or in another project, you will probably want to be able to debug the new code (or any other code).
There are two ways to debug from a game code project
- Edit the debugging settings of the CryGameSDK project.
- Right-click the project in the solution explorer, and select properties
- Under configuration properties category, go to Debugging
- Update "Command" to point to GameSDK.exe (for launcher) or Editor.exe (for Sandbox) on your local computer. Pick the .exe from Bin64 if Platform is set to x64, or from Bin32 if Platform is set to Win32 (top right drop-down)
- Update "Working Directory" to point to the root folder of your CRYENGINE installation. (This is the the folder containing the Bin32 and Bin64 folders)
- Set the CryGameSDK project as start-up project. Right click the project in the solution explorer, and pick "Set as StartUp Project"
- You can now debug the game code in either Sandbox or the launcher (depending on which you picked two steps up) by using Debug -> Start debugging (or press the default shortcut, F5)
- Attach the debugger to an existing process.
- Start either the launcher or the sandbox after building your code
- In visual studio, go to Debug -> Attach to Process
- Find either GameSDK.exe (for launcher) or Editor.exe (for Sandbox) in the list of processes. Then attach to it.
- You can now debug the game code in the running process
Common Questions For Beginners
Q: I'm getting an error about "Unable to start program... /CryCommon" when building the GameCode solution, why?
A: Users without full Engine Code will only be able to build "CryGame", so make sure that's what you're building.
Q: I finished building CryGame but at the end it gave me an error about "Unable to start program... /CryGame.dll", why?
A: If you have set CryGame as your "Startup Project" then upon completion of the build, it will attempt to 'run' it, which can't happen.