# CRYENGINE

## Building CRYENGINE

To get function names and line numbers for internal CRYENGINE code you'll need to build CRYENGINE from source and generate `.pdb` files. Make sure to build the engine with the `Profile` configuration so that `.pdb` files are generated. The following video gives an overview of how to clone and build the CRYENGINE [source](https://github.com/CRYTEK/CRYENGINE):

Next, upload all of the `.pdb`, `.dll` and `.exe` files in the `bin` folder using [symbol-upload](https://docs.bugsplat.com/education/faq/how-to-upload-symbol-files-with-symbol-upload). Make sure to note the application name, version and database as you'll need these values later.

### Project Configuration

To point the CRYENGINE crash reporter at BugSplat you'll need to make a few modifications to the `.cryproject` file for your project. Open the `.cryproject` file in a text editor and add the following snippet of JSON:

```javascript
{
    ...
    "console_variables": {
        "sys_crashrpt": "1",
        "sys_crashrpt_appname": "{{application}}",
        "sys_crashrpt_appversion": "{{version}}",
        "sys_crashrpt_email": "support@bugsplat.com",
        "sys_crashrpt_privacypolicy": "https://bugsplat.com/privacy",
        "sys_crashrpt_server": "http://{{database}}.bugsplat.com/post/cryengine/index.php",
        "sys_target_platforms": "pc,ps4,xboxone,linux"
    },
    ...
}
```

Make sure to replace `{{application}}`, `{{version}}`, and `{{database}}` with values specific to your game. Note these values must match the values you used when you uploaded symbols for CRYENGINE.

### Building Your Game

By default, building your game should output `.pdb` files so that minidumps can be debugged by a remote machine. If your build does not output `.pdb` files, you will need to change the [MSVC flags](https://github.com/CRYTEK/CRYENGINE/blob/release/Tools/CMake/CRYENGINE-MSVC.cmake) with `CMAKE` and regenerate the solution.

### Uploading Symbols

Symbol files are required to display function names, file names and line numbers of source code in crash reports. Once you've built your project's solution, upload the resulting files in `bin` using [symbol-upload](https://docs.bugsplat.com/education/faq/how-to-upload-symbol-files-with-symbol-upload).

### Generating a Crash Report

Right-click the `.cryproject` file for your game and select `Launch Game`. Once the game has launched, press the `` ` (backtick) `` key on your keyboard to display the console. Type `?crash` to ensure that all of the variables from the `Project Configuration` step have been loaded by your game.

To generate a crash report, enter `sys_crashrpt_generate` into the console:

![BugSplat CRYENGINE crash dialog](https://976110677-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBMgmIcgkIXSUfnXDSv%2Fsync%2F7127469b75a6d8c756500261fe55c7504e454c81.png?generation=1631116988517199\&alt=media)

### Viewing the Crash Report

After you've submitted a crash report, navigate to the [Dashboard](https://app.bugsplat.com/v2/dashboard) page. Click the link in the `ID` column to see the details of your crash report. In this case, the last 4 stack frames are all related to the crash report generator, and the frame of interest is the 5th frame of the call stack. Create a [Group](https://docs.bugsplat.com/introduction/development/grouping-crashes) by expanding the 5th row in the `Active Thread` and then click the `Create Subkey` button.

Navigate back to the crash and notice that the Stack Key is now `CrySystem!CXConsole::ExecuteCommand(2427)` instead of `CrySystem!CCrashHandler::GetExceptionPointers(1566)`.

![BugSplat CRYENGINE crash details](https://976110677-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LBMgmIcgkIXSUfnXDSv%2Fsync%2F3c7b6cd20a7255020528336b2978fcc1632ca01a.png?generation=1631116987665886\&alt=media)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bugsplat.com/introduction/getting-started/integrations/game-development/cryengine.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
