Debugging and Running Tests

This section covers tools and procedures for debugging your AI integrations and verifying the plugin’s functionality through its built-in automation tests.


1. Debugging with Extended Logging Mode

To help with troubleshooting, the plugin includes an Extended Logging Mode. When enabled, every API request and response will be printed to the Unreal output log, providing a clear, real-time view of the data being sent to and received from the AI provider.

  • What it Logs: The full request body (including headers and parameters) and the full response from the server.
  • Security: To prevent log spam and protect data, any base64 encoded strings (typically used for images) will be truncated in the log output.
  • How to Enable:
    1. Go to Project Settings > Plugins > GenAI Plugin.
    2. Find the “Enable Extended Logging Mode” checkbox and enable it.

This is an invaluable tool for debugging issues with your API calls without needing external network monitoring tools.

Automation Testing Window in Unreal Engine
Option to enable debug mode in project settings
Automation Testing Window in Unreal Engine
All the API requests and responses done by the plugin, can be seen in output log

2. Running Automation Tests

The GenAI for Unreal plugin comes with a comprehensive suite of automation tests that verify the functionality of all major API integrations. Running these tests is the best way to confirm that your setup is correct and that the plugin can successfully communicate with the AI service providers.

⚠️ Cost and Data Disclaimer

Running these tests will make real API calls to the various AI services, which will incur costs on your account based on your provider's pricing. Ensure you have valid API keys and a payment method set up before proceeding.

Running Tests in the Editor

  1. In the Unreal Editor, navigate to Window > Test Automation.
  2. In the Session Frontend window that appears, click on the Automation tab.
  3. In the test hierarchy on the left, find the tests located under the GenAI group.
  4. Check the boxes for the tests you wish to run and click the “Start Tests” button.
Automation Testing Window in Unreal Engine
The Automation tab in the Session Frontend, showing the GenAI tests.

Running Tests from the Command Line

For automated workflows or CI/CD pipelines, you can execute the tests from the command line.

# Windows example for running all tests in the GenAI group
UE5Editor.exe "C:\Path\To\Your\Project\YourProject.uproject" -ExecCmds="Automation RunTests GenAI" -unattended -nopause -testexit="Automation Test Queue Empty" -log

Troubleshooting Test Failures

If tests are failing, common causes include an invalid API key, network connectivity issues, or API rate limits. The Extended Logging Mode described above is the best tool for diagnosing these failures.


3. Contributing to the Example Project

The GenAI for Unreal Example Project is open source and we welcome contributions from the community! Whether you’re fixing a bug, adding a new example, or improving the UI, we encourage you to get involved.

⚠️ Important Note for C++ Contributors

While the example project itself is open source, the core GenAI for Unreal plugin is included as a private Git submodule. To compile the C++ project and contribute to the code, you must first purchase and install the plugin from the Fab marketplace. This will give you the necessary source code to compile against.

× Full-size image