Rocketeer game demo
Rocketeer game demo
The RocketeerGame demo is a simple C++ and blueprint game implementation that showcases the function calling capabilities of the LLMAI plugin using natural language commands. This is intended as a demonstration of integration rather than how structured and refined gameplay mechanics should behave, however it could be used as a starting point for something comprehensive. Core Architecture: The game consists of 7 main C++ classes working together - ARocketPawn (player), AObstacleManager (obstacles & projectiles), AEnemyManager (enemy spawning), AFlightPath (enemy movement), AObstacle (game objects), AEnemy (enemy behavior), and URocketeerEventSubsystem (global events). Advanced Features: Object pooling for performance, event system with delegates, speed synchronization across systems, texture-based obstacle patterns, spline-based enemy flight paths, health/combat systems, and series-based enemy spawning with tracking.
Getting Started
The LLMAI Arcade demo (Rocketeer) is available as a separate download on the Fab store LLMAI page. Download and extract the zip to your preferred Unreal projects folder, then open the .uproject file. After opening the demo for the first time, follow Configuration quick-start to set up your preferred provider (OpenAI, Grok, or LocalAI).
Prerequisites
Install and enable the LLMAI plugin, then configure your provider (OpenAI, Grok, or LocalAI). See Getting started, Configuration, and the Demo guide.
Enable Rocketeer Game Functions in the Terminal connection dialog when you connect.
Launch the demo
- Open the level:
Content/LLMAITerminal/Levels/LVL_LLMAITerminal.umap - Play the level: Click Play in Editor or press Alt+P
- Connect to AI: Select model, voice, and enable Rocketeer functions
- Start the game: Say "Launch Rocketeer" or ask the AI to start the arcade game
What to try
- "Launch Rocketeer" — Start the arcade game
- "Make the game faster" — Adjust game speed
- "Give me an extra life" — Modify player lives
- "Spawn some enemies" — Trigger enemy waves
- "Set difficulty to hard" — Change difficulty level
- "What controls do I have?" — Get game controls
- "Create a zigzag flight path" — Design enemy patterns
Game controls
- Arrow keys: Move rocket (left, right, up, down)
- Spacebar: Fire weapons
Troubleshooting
- Game not starting: Try "Launch Rocketeer" or "Start the game"
- Functions not working: Ensure the Rocketeer function profile is enabled in the connection dialog
See the FAQ and Debug and logging for more help.
Core Game Functions
AIF_StartGameRocketeer
Description: Initialize a new game session
AIF_CloseGame
Description: End the current game session
AIF_SetGameStage
Description: Change the current game stage and difficulty
AIF_SetGameSpeedMultiplier
Description: Adjust the overall game speed
AIF_GetGameControls
Description: Receive the control descriptions the player can use to control the game
Player Management Functions
AIF_AddLife
Description: Grant an extra life to the player
AIF_RemoveLife
Description: Remove a player life
Enemy Management Functions
AIF_SpawnEnemySeries
Description: Using a flightpath GUID reference you can spawn a number of enemies in a series which will fly along the path. This function returns a SeriesID which you can use to track series progression via events from the game.
AIF_AddEnemyFlightPath
Description: Create a new flight path for enemies
AIF_GetGameActiveFlightPaths
Description: Retrieve list of available flight paths
AIF_GetGameFlightpath
Description: Get detailed information about a specific flight path
Environment Functions
AIF_SpawnObstacles
Description: AI can spawn one of three different types of test obstacles, used in stage 0 to show examples to the player
UI Management Functions
AIF_SetGameHUDVisibility
Description: Toggle the game HUD display
AIF_SetChatVisibility
Description: Control the chat interface visibility
AIF_SetGameBackgroundVisibility
Description: Toggle background elements
Weapon System Functions
AIF_SetGameRocketFiringMode
Description: Change the rockets's firing mode, the AI can use this as part of a challenge such as the trivia round
⏱ Timer System Functions
AIF_AddGameTimer
Description: Create a countdown timer with AI callback
AIF_GameTimerCancel
Description: Cancel an active timer
ROCKETEER_API: C++ Module Interface
What is ROCKETEER_API?
The ROCKETEER_API macro is the core export/import interface that makes the RocketeerGame C++ classes available to other modules, Blueprint systems, and external code. Used to create blueprint-friendly classes and events.
// Core API Definition
#ifndef ROCKETEERGAME_API
#ifdef ROCKETEERGAME_EXPORTS
#define ROCKETEERGAME_API __declspec(dllexport)
#else
#define ROCKETEERGAME_API __declspec(dllimport)
#endif
#endif
Game Management Classes
Exported Classes:
Actor Classes
Exported Classes:
Global Event Management
Exported Classes:
Blueprint Implementations
Game Assets and Blueprint Classes
The RocketeerGame demo uses several Blueprint assets that extend and configure the C++ base classes. These Blueprints provide the game-specific content, AI integration logic, and visual elements.
DT_Rocketeer_GameStageList
Base C++ Class: UDataTable
Purpose: Data table that provides instructions to the AI when each stage starts. Contains stage configurations, difficulty settings, and contextual information for AI decision-making.
Predefined FlightPaths
Base C++ Class: AFlightPath
Available Patterns: Three swoop patterns and two vertical weave patterns that the game uses to spawn enemies. The AI can retrieve information about these paths, create new ones, and optionally include them in the SetGameStage function call.
PAWN_Rocket
Base C++ Class: ARocketPawn
Purpose: Blueprint subclass of the player-controlled rocket. Configures mesh, materials, input handling, and visual effects for the rocket ship.
STRUCT_GameTimer & STRUCT_GameStage
Base C++ Class: USTRUCT
Purpose: Blueprint structures that define internal data formats for game timers and stage configurations. Used by the game systems for state management and AI communication.
BP_rocketeer_backdrop
Base C++ Class: AActor
Purpose: Default backdrop actor for the game environment. Provides the visual background and atmosphere for the gameplay area.
BP_Rocketeer_GameManager
Base C++ Class: AActor or AGameModeBase
Purpose: Main scripting hub for game systems. Handles interpretation of AI function calls, manages game state, coordinates between systems, and implements the LLMAI function definitions that bridge natural language commands to C++ game logic.
ENEMY_Sentinel
Base C++ Class: AEnemy
Purpose: The primary enemy type available in the game. Configured with specific mesh, materials, health, movement patterns, and combat behavior.
Obstacle Definitions
Base C++ Class: AObstacle
Available Types: Three types of obstacles (TestAsteroids, TestCrystals, TestPlates) and projectile definitions. Each configured with unique meshes, collision properties, health values, and visual effects.
Obstacle_Patterns Obstacle pattern textures, each color channel is assigned an obstacle type by the game manager and configuration passed to the obstacle manager which uses it to determine which obstacles spawn over time.