Files
UE5-Modular-Game-Framework/docs/blueprints/13-polish/107_BPC_DevCheatManager.md
Lefteris Notas 411edea8ce add blueprints
2026-05-19 13:22:27 +03:00

7.4 KiB
Raw Permalink Blame History

80 — BPC_DevCheatManager

Blueprint Spec — UE 5.55.7


Parent Class

ActorComponent

Dependencies

Purpose

Developer cheat and debug command manager for testing and development builds. Provides console commands and bound functions for common debug operations: god mode, noclip, spawning items, teleporting, time manipulation, AI debugging, narrative skipping, and performance profiling. Only active in non-shipping builds. Accessible via developer console (~) key or bound key combinations.

Enums

ECheatCategory

Value Description
Player Player-related cheats
World World manipulation
AI AI behavior debug
Narrative Story skip/advance
Performance Profiling tools
Camera Camera manipulation
Inventory Item spawning
Debug General debug toggles

Structs

FCheatCommand

Field Type Description
Command FString Console command string
Category ECheatCategory Grouping
Description FText Help text
bRequiresAuth Bool Admin only
bAvailableInShipping Bool Ship build flag

Variables

Name Type Description
bCheatsEnabled Bool Master toggle
bGodMode Bool Invulnerability
bNoClipEnabled Bool Fly/wall pass
bInfiniteAmmo Bool Unlimited ammo
bInfiniteStamina Bool Unlimited stamina
bInvisibleToAI Bool AI ignore player
bShowAIDebug Bool AI debug visualization
bShowCollision Bool Collision wireframes
bShowPerformance Bool Performance overlay
TimeScale Float World time scale
RegisteredCommands TMap<FString, FCheatCommand> Command registry
CheatHistory TArray<FString> Command history

Functions

Name Inputs Outputs Description
Initialize Register all commands
EnableCheats bEnable: Bool Master toggle
ExecuteCheat Command: FString, Args: TArray<FString> Run cheat command
RegisterCommand Command: FCheatCommand Add custom command
ToggleGodMode God mode on/off
ToggleNoClip Noclip on/off
ToggleInfiniteAmmo Infinite ammo
ToggleInfiniteStamina Infinite stamina
ToggleInvisibility AI invisibility
ToggleAIDebug AI visualization
ToggleCollisionDebug Collision vis
TogglePerformanceOverlay Show FPS/stats
ToggleDebugMenu Open debug menu
HealPlayer Amount: Float Restore health
SetTimeScale Scale: Float Slow-mo/speed-up
AddItem ItemID: FName, Count: Int32 Spawn item
TeleportToLocation Location: FVector Teleport player
TeleportToLevel LevelName: FName Jump to level
SkipToChapter ChapterID: FName Narrative skip
KillAllAIDebug Despawn all AI
SpawnAIDebug AIType: FName Spawn AI for testing
GetAllCheatNames TArray<FString> List all cheats
IsCheatEnabled CheatID: FName Bool State query

Blueprint Flow

[Initialize]
  └─► If BuildType == Shipping: Disable all, return
  └─► Register default commands:
         "God" -> ToggleGodMode
         "NoClip" -> ToggleNoClip
         "Fly" -> ToggleNoClip
         "Ghost" -> ToggleNoClip + Invisibility
         "Heal" -> HealPlayer(100)
         "KillAll" -> KillAllAIDebug
         "Slomo {value}" -> SetTimeScale(value)
         "Summon {item}" -> AddItem
         "Teleport {x} {y} {z}" -> TeleportToLocation
         "Open {level}" -> TeleportToLevel
         "Chapter {id}" -> SkipToChapter
         "Stat FPS" -> TogglePerformanceOverlay
         "DebugMenu" -> ToggleDebugMenu
         "InfiniteAmmo" -> ToggleInfiniteAmmo
         "Invisible" -> ToggleInvisibility
  └─► bCheatsEnabled = true
  └─► Bind to console input events

[ExecuteCheat]
  └─► Parse Command from input string
  └─► Look up in RegisteredCommands
  └─► If found:
         Validate arguments
         Execute bound function with args
         Add to CheatHistory
         Log: "Cheat: {Command}" (development builds only)
  └─► If not found:
         Log: "Unknown cheat command: {Command}"

[ToggleGodMode]
  └─► bGodMode = !bGodMode
  └─► If bGodMode:
         BPC_HealthComponent.SetInvulnerable(true)
         Set health to max
         Notify: "God mode ON"
  └─► Else:
         BPC_HealthComponent.SetInvulnerable(false)
         Notify: "God mode OFF"

[ToggleNoClip]
  └─► bNoClipEnabled = !bNoClipEnabled
  └─► If bNoClipEnabled:
         BPC_Movement.SetMovementMode(Flying)
         Disable collision with world
         Notify: "NoClip ON"
  └─► Else:
         BPC_Movement.SetMovementMode(Walking)
         Enable collision
         Notify: "NoClip OFF"

[SetTimeScale]
  └─► TimeScale = Clamp(Scale, 0.1, 10.0)
  └─► BPC_TimeManager.SetGlobalTimeDilation(TimeScale)
  └─► Notify: "Time scale: {TimeScale}x"

Event Dispatchers

Name Payload Description
OnCheatExecuted Command: FString Command used
OnGodModeChanged bEnabled: Bool God mode toggle
OnNoClipChanged bEnabled: Bool NoClip toggle

Communications With

Target Method Why
BPC_HealthComponent Direct call God mode
BPC_Movement Direct call NoClip
BPC_InventoryComponent Direct call Spawn items
BPC_NarrativeState Direct call Skip chapter
BPC_TimeManager Direct call Time scale
BPC_FPSCounter Direct call Performance overlay
WBP_DebugMenu Create widget Debug UI
BPC_AIDirector Direct call AI debug

Reuse Notes

  • Completely disabled in shipping builds via build flag check
  • All cheats are registered commands; extensible via RegisterCommand
  • Command history for repeated use
  • Cheat notifications shown via on-screen debug text
  • Supports both console and key binding input
  • Debug toggles are state-persistent across level transitions
  • Intended for development and QA team use only