CodeForge RPG Starter Kit
Welcome to the documentation for the CodeForge RPG Starter Kit, a C++ based example project for the eponymous UE5 plugin. Created entirely from CodeForge Data Assets, it aims to demonstrate a seamless bridge between architectural design and production-ready game logic.
Core Architecture
The kit utilizes a modular, component-based architecture designed for scalability, network efficiency, and clean decoupling.
Class Breakdown
ARPGGameMode Generated
The top-level authority that dictates the rules of the match.
- Properties:
RespawnDelay,bAllowFriendlyFire, andExperienceMultiplier. - Events: Broadcasts
OnGameStartedandOnPlayerDieddynamic multicast delegates. - Functionality: Features
HandlePlayerDeathandRespawnPlayerlogic.
ARPGCharacter Generated Replicated
The centerpiece of the kit. Inherits from ACharacter and implements IDamageable seamlessly.
- Stats: Dynamic Health, Mana, Level, and Experience properties.
- Networking: Health is automatically replicated with a
RepNotifyto update UI on all clients seamlessly. - Combat: Built-in server-side line trace validation for authoritative hits.
- Delegates: Includes
OnHealthChanged,OnLevelUp, andOnDeath.
URPGInventoryComponent Generated
A lightweight UActorComponent for data-driven item management.
bool AddItem(const FRPGItemData& Item);
bool RemoveItem(int32 SlotIndex);
Features weight-based limits and maximum slot constraints, broadcasting OnInventoryChanged and OnItemAdded dynamic multicast delegates when the inventory changes.
IDamageable (Interface) Generated
A native Blueprint-callable interface designed for uniform damage interactions across all susceptible actors.
- Methods:
ReceiveDamage,GetCurrentHealth, andGetIsAlive.
Data Structures & Enums Generated
The fundamental data definitions driving the item system.
FRPGItemData(Struct): ComprisesItemName,ItemDescription,Rarity,StackCount,MaxStackSize,bIsConsumable, andItemWeight.EItemRarity(Enum): Contains tiers such asCommon,Uncommon,Rare,Epic, andLegendary.
Showcase Console Commands
Test the integrity of the generated C++ logic in real-time using these built-in cheat commands. Press ~ in PIE to open the console.
Triggers an AoE blast (1000 units) that line-traces and destroys all actors implementing the Damageable interface.
Sets Health and Attack Power to 999,999. Proves the robustness of the replicated stats system.
Instantly restores health to maximum and triggers the OnHealthChanged delegate for UI updates.
Injects a "Test Sword" into the inventory component to validate weight and slot logic constraints.
Adds experience points and tests the automatic level-up logic and its associated broadcast.
Executes a server-validated line-trace attack against the target the character is currently facing.
Getting Started
Follow these steps to generate and run the kit:
- Open the Graph Editor: Navigate to the CodeForge graph editor window.
- Verify Nodes: Ensure the
RPGCharacterandRPGInventoryComponentnodes are correctly connected. - Generate Code: Click the Generate button in the main toolbar to compile the C++ classes.
- Project Settings: Once compiled successfully, set
ARPGGameModeas your Default Game Mode. - Play & Test: Press Play (PIE) and open the console with
~to use the showcase commands.