Gameplay Systems And Ui Connection
Gameplay Systems and UI Connection
Section titled “Gameplay Systems and UI Connection”Statistic Modifier Actor System
Section titled “Statistic Modifier Actor System”Creating a reusable actor for modifying character statistics throughout the game world.
Actor Setup and Components
Section titled “Actor Setup and Components”File Organization:
- Create Actors folder → Statistic_Modify subfolder
- Create
Actor_Statistic_Modify
blueprint
Component Structure:
- Sphere (base component, no collision, visual placeholder)
- Box_Collision (100x100x100 extent)
- Sphere_Collision (radius 100)
- Capsule_Collision (height 88, radius 64)
Shape Enumeration: Enumeration_Shape
- Sphere, Box, Capsule
Dynamic Collision System
Section titled “Dynamic Collision System”Shape Variable System:
Shape
(Enumeration_Shape, Instance Editable)Math
(Enumeration_Math for Add/Subtract)Value
(Float for modification amount)
Construction Script Logic:
Based on Shape
variable:
- Set Visibility: Show selected shape, hide others
- Set Collision Enabled: Enable selected shape collision, disable others
- Collision Preset: Custom → Enable Pawn Overlap only
Overlap Event Implementation
Section titled “Overlap Event Implementation”Dynamic Event Binding:
Use Switch node off Shape
variable:
- Each shape:
Bind Event to On Component Begin Overlap
- All shapes use same function:
F_Modify_Health
- Centralizes overlap logic while maintaining shape flexibility
F_Modify_Health Function:
Other Actor → Interface_Health_Modify (Value, Math)
Simple interface call that works with any character implementing the health modification interface.
Usage Examples
Section titled “Usage Examples”Damage Actor: Subtract 100 health Healing Actor: Add 100 health Collectibles: Various positive values Traps: Various negative values
This actor becomes the foundation for power-ups, traps, collectibles, coins, and other statistic-modifying elements throughout game prototyping.
Nameplate System
Section titled “Nameplate System”UI widgets that display character information above their heads.
Nameplate Widget Creation
Section titled “Nameplate Widget Creation”File Structure:
- Create W_Nameplate folder and widget
- Create
Interface_Widget_Nameplate
Component Setup:
CanvasPanel_Body
andCanvasPanel_Div
(240x75 size)ProgressBar_Template_Health
(scaled to 0.75, health template)Text_Label
(font size 10, top middle anchor)
Interface Function:
Interface_Label_Update
(Text input)- Updates nameplate text through interface calls
Character Integration
Section titled “Character Integration”Master Character Setup:
- Add
Widget_Nameplate
component to character - Widget Settings:
- Widget Class: W_Nameplate
- Space: Screen
- Draw at Desired Size: Enabled
- Pivot X/Y: 0.5
- Z Location: 120
Character Name System:
- Add
Character_Name
variable (Text, Instance Editable) - On Event Begin Play: Update nameplate label through interface
Health Integration:
- Override
F_Health_Modify
in characters - Cast widget to W_Nameplate → Get Health Progress Bar → Update Current
- Widget Setup: Set Min/Max values and initial current value
- Add 0.2 second delay for proper widget initialization
Player vs AI Nameplate Behavior
Section titled “Player vs AI Nameplate Behavior”Player Character:
- Hide own nameplate:
Is Locally Controlled
→Set Hidden in Game
- Player doesn’t need to see their own nameplate
AI Character:
- Always show nameplate for enemy identification
- Same health update system as player
- Different default character names (e.g., “Enemy 001”)
Basic Combat System
Section titled “Basic Combat System”Attack Implementation
Section titled “Attack Implementation”Sphere Trace Attack:
Get Actor Location + Forward Vector * 600 → Sphere Trace for Objects
Trace Configuration:
- Radius: 40
- Object Types: Pawn (promote to
Attack_Trace
variable) - Draw Debug: For Duration (testing)
- Ignore Self: Checked
Damage Application:
Hit Actor → Interface_Health_Modify (Value: damage amount, Math: Subtract)
AI Character Setup
Section titled “AI Character Setup”Child Blueprint: BP_Character_Coursera_AI
- Disable CameraBoom and FollowCamera (Auto Activate off)
- Set nameplate widget and positioning
- Use Mixamo Xbox model and animations
- Configure default health values
Nameplate Updates:
- Same override system as player character
- Implement
F_Health_Modify
with widget casting and interface calls - Set default Character_Name in Class Defaults
Ability Bar System
Section titled “Ability Bar System”Widget Structure
Section titled “Widget Structure”W_Ability Widget:
- Canvas panels + Icon template
- Basic icon display with default settings
W_Ability_Bar Widget:
- Canvas panels (400x200 div size)
- Contains W_Ability template
- Positioned above resource bar in root widget
Input Mode Management
Section titled “Input Mode Management”Player Controller Setup: G key toggle system using Flip Flop:
- First Press:
Set Input Mode Game and UI
+ Show Mouse Cursor - Second Press:
Set Input Mode Game Only
+ Hide Mouse Cursor
This allows switching between gameplay and UI interaction modes for testing.
Ability Integration
Section titled “Ability Integration”Player Character Interface: Interface_Character_Player
Interface_Use_Ability
function- Implement on Player Character to call existing attack code
Button Binding:
W_Ability → Get W_Icon → Get Button → Bind Event to On Released
Event Implementation:
Get Player Pawn → Interface_Use_Ability
This creates clickable ability buttons that trigger the same attack functionality as keyboard input, demonstrating UI-to-gameplay integration.
The combat system provides immediate visual feedback through nameplate health updates and creates foundation for more complex combat mechanics in future development.