An optimized Unreal Engine 5.7 project demonstrating a performant implementation of the Gameplay Ability System (GAS), inspired by Lyra. This C++-based framework provides extensible abilities, attributes, and combat mechanics.
- Overview
- Features
- Changelog
- Quick Start
- Usage
- Project Structure
- Gameplay Ability System (GAS)
- Contributing
- License
- Contact
OptimizedGASDemo is built from the Third Person C++ template, focusing on creating an efficient and scalable GAS foundation. It includes modular combat systems, attribute sets, and example abilities, making it ideal for prototyping action-oriented games.
- Engine Version: Unreal Engine 5.7
- Language: C++ with Blueprint support
- Primary Focus: GAS optimization, attributes, and combat mechanics
- Modular GAS Framework: Extensible abilities and attribute sets (see
Source/OptimizedGASDemo/Variant_Combat/Gameplay/AttributesandAbilities) - Gameplay Variants:
- Combat: Action-oriented combat with trace attacks, combos, charged attacks, stamina system, and damage systems
- Performance Optimized: Efficient damage tracing and event handling
- Example Implementations: Ready-to-use abilities and character controllers
- Multiplayer Ready: Proper replication for attributes and abilities
- GAS Architecture: AbilitySystemComponent on PlayerState, separate AttributeSets (Health, Damage, Stamina, Movement), PawnData-driven ability granting with AbilitySets
- Replication: Proper attribute replication with COND_OwnerOnly for UI attributes (Health, MaxHealth, Stamina, MaxStamina, StaminaUsed), COND_None for gameplay attributes
- Enhanced Input: Modern input system with Input Actions and Mapping Contexts integrated with AbilitySets
- GrantedHandles Pattern: Lyra-style ability/effect management with proper cleanup during hot-reloading and pawn data changes
- Modern UE API: Updated GameplayEffect components to use current UE 5.7 standards (no deprecated warnings)
- AbilitySet Assets: UCombatAbilitySet data assets implemented to replace legacy pawn data arrays
- PawnData Migration: Completed migration from GrantedAbilities/GrantedEffects arrays to AbilitySets with input mapping
- InputConfig: Basic InputConfig system implemented for centralized input configuration (UCombatInputConfig)
- Stamina System: Comprehensive stamina mechanics with regeneration, costs, and stun effects
- Attribute System Refactor: Split UCombatAttributeSet into specialized UHealthAttributeSet, UDamageAttributeSet, UStaminaAttributeSet, and UMovementAttributeSet
- Experience System: ExperienceDefinition and experience progression system for leveling
- CameraMode: Dynamic camera mode switching system (e.g., UCombatCameraMode_ThirdPerson, UCombatCameraMode_Aim)
- HUD Management: Proper HUD layout and management system with widget switching
- Pawn Extension System: Lyra-style pawn extension components for modular pawn functionality
- Controller Extension System: Controller extension components for input handling
- Player Spawning System: Proper player spawning with pawn data application
- Game Feature System: Modular game features with activation/deactivation
For detailed roadmap and implementation guidance, see docs/LYRA_COMPLIANCE.md.
- Unreal Engine 5.7 installed
- Visual Studio or compatible IDE for C++ development
- Clone the repository:
git clone https://github.com/ngmitam/OptimizedGASDemo.git
- Open
OptimizedGASDemo.uprojectin Unreal Editor 5.7. Generate project files if prompted. - Build the project using one of the provided tasks (e.g., "OptimizedGASDemoEditor Win64 Development Build") or via command line:
Engine\Build\BatchFiles\Build.bat OptimizedGASDemoEditor Win64 Development "C:\Path\To\OptimizedGASDemo.uproject" -waitmutex
- Launch the editor and use Play in Editor (PIE) to test levels and variants.
- Building: Use the workspace tasks for different configurations (Debug, Development, Shipping).
- Editing: Modify abilities in
Source/OptimizedGASDemo/Variant_Combat/Gameplay. - Testing: Run PIE or package for standalone testing.
Source/OptimizedGASDemo/: Core C++ modules and GAS implementationsVariant_Combat/Gameplay/: Abilities, attributes, and combat logic (Health, Damage, Stamina, Movement AttributeSets; TraceAttack, Combo, Charged, ReceiveDamage, Death, StaminaRegeneration, etc. abilities)Variant_Platforming/: Platforming-specific gameplay mechanicsVariant_SideScrolling/: Side-scrolling gameplay variant*Character*,*PlayerController*,*PlayerState*: Example characters, controllers, and player states for each variant
Content/: Blueprints, assets, and levelsVariant_Combat/: Combat gameplay assets, animations, UI, VFXVariant_Platforming/: Platforming assetsVariant_SideScrolling/: Side-scrolling assets
docs/: Detailed GAS documentation (GAS_OVERVIEW.md,GAS_SEQUENCE.md,COMPLETE_SETUP_GUIDE.md,ABILITYSET_GUIDE.md,PAWNDATA_GUIDE.md,INPUTCONFIG_GUIDE.md,LYRA_COMPLIANCE.md)Binaries/: Compiled executablesPlugins/: Enabled plugins (e.g., GameplayAbilities, ModularGameplay)
For a comprehensive guide to GAS in this project, including key classes, usage examples, and extension tips, refer to docs/GAS_OVERVIEW.md.
For step-by-step setup instructions for creating AbilitySets, InputConfig, and PawnData assets for players and enemies, see docs/COMPLETE_SETUP_GUIDE.md.
For detailed instructions on creating and configuring AbilitySet assets, see docs/ABILITYSET_GUIDE.md.
For detailed instructions on creating and configuring PawnData assets for players and enemies, see docs/PAWNDATA_GUIDE.md.
For detailed instructions on creating and configuring InputConfig assets for ability input mapping, see docs/INPUTCONFIG_GUIDE.md.
- Enable
GameplayAbilitiesandModularGameplayplugins in your project settings. - Use AttributeSets for health, mana, stamina, damage, movement, and custom stats.
- Implement abilities as subclasses of
UGameplayAbility. CheckVariant_Combat/Gameplay/Abilities/for examples. - For multiplayer, ensure proper replication conditions (OwnerOnly for UI attributes, None for gameplay).
This project follows Lyra-inspired standards for multiplayer safety:
- Authority Checks: Use
HasAuthority()guards for server-only operations like ability granting and attribute initialization. - Replication Conditions: UI attributes (e.g., Health, MaxHealth) use
COND_OwnerOnlyto optimize bandwidth; gameplay attributes useCOND_None. - Net Execution Policies: Passive abilities use
ServerOnlyto prevent client-side inconsistencies; predicted abilities useLocalPredicted. - Error Handling: Log failures in data loading and ability activation for debugging.
- GrantedHandles Pattern: Uses Lyra-style ability/effect management for proper cleanup during hot-reloading and pawn data changes.
This repository is for experimentation and learning. Contributions are welcome!
- Fork the repo and submit pull requests.
- Keep changes focused (one feature or bugfix per PR).
- Document architectural changes in PR descriptions.
This project is licensed under the MIT License - see the LICENSE file for details.
Nguyen Minh Tam
GitHub: @ngmitam
Email: ngmitamit@gmail.com
This project demonstrates professional Unreal Engine development practices and serves as part of a portfolio showcasing GAS expertise.