MAGE is an experimental learning project that explores implementing Entity Component System (ECS) patterns and Gameplay Ability System (GAS) concepts in Unreal Engine. It serves as an educational resource for understanding how to bridge different architectural approaches in game development.
This is a learning project designed to explore and understand:
- ECS architecture principles in an Unreal context
- Alternative approaches to Unreal's Gameplay Ability System
- High-performance entity management
- Data-oriented design patterns
While functional, this framework is primarily for educational purposes and may not be suitable for production use without significant testing and refinement.
-
Learning & Exploration
- Understand ECS principles
- Study GAS architecture
- Explore performance optimization
- Practice systems design
-
Architectural Experimentation
- Bridge ECS and Unreal's actor model
- Implement GAS concepts without actor dependencies
- Explore data-oriented design
- Test different optimization strategies
-
Documentation & Teaching
- Clear code examples
- Detailed explanations
- Implementation alternatives
- Design decision rationales
-
ECS-Style Architecture
- Entity pooling for performance
- Component-based design
- System-driven logic
- Data-oriented approach
-
Gameplay Tags Integration
- Tag-based filtering
- Component categorization
- System matching
- Dynamic queries
-
Ability System Concepts
- Ability definitions
- Effect management
- Visual feedback
- State handling
-
Performance Focus
- Efficient entity storage
- Component pooling
- Optimized queries
- Minimal overhead
-
Entity Management
// Entities are just IDs, all data lives in components struct FMAGEEntityId { uint32 Index; uint32 Version; };
-
Component Storage
// Components are pure data struct FHealthComponentData : public FMAGEComponentData { float CurrentHealth; float MaxHealth; };
-
System Architecture
// Systems process component data class UHealthSystem : public UMAGESystemBase { virtual void Update(float DeltaTime) override; };
This project draws inspiration from and builds upon these concepts:
- Entity Component System Overview
- Unreal Engine Gameplay Ability System
- Data-Oriented Design
- Gameplay Tags in Unreal Engine
-
Clone the Repository
git clone https://github.com/your-username/mage-framework.git
-
Add to Your Project
Copy the MAGE plugin to your project's Plugins directory Enable the plugin in your .uproject file
-
Basic Usage
// Create an entity FMAGEEntityId Entity = EntityManager->CreateEntity(); // Add components auto& Health = EntityManager->AddComponent<FHealthComponentData>(Entity); Health.MaxHealth = 100.0f; // Systems automatically process matching components
-
Entity Management
- Entity creation/destruction
- Component attachment
- Entity pooling
- Memory management
-
Component System
- Data storage
- Tag integration
- State management
- Efficient access
-
Ability Framework
- Ability definitions
- Effect system
- Visual feedback
- State handling
// Define a component
USTRUCT()
struct FHealthComponent : public FMAGEComponentData
{
GENERATED_BODY()
float CurrentHealth = 100.0f;
float MaxHealth = 100.0f;
};
// Create a system
UCLASS()
class UHealthSystem : public UMAGESystemBase
{
GENERATED_BODY()
virtual void Update(float DeltaTime) override
{
// Process all entities with health components
auto View = GetEntityManager()->CreateView<FHealthComponent>();
for (auto [Health] : View)
{
// Update health logic
}
}
};
- Experimental Nature: This is a learning project, not production-ready code
- Performance Testing: Needs thorough benchmarking
- Networking: Basic implementation, needs more work
- Documentation: Work in progress
- Testing: Needs more comprehensive tests
This is an educational project, and we welcome contributions that help others learn:
- Code examples
- Documentation improvements
- Performance optimizations
- Tutorial content
- Bug fixes
-
Understanding ECS
- Component data separation
- System-driven logic
- Entity management
- Performance optimization
-
GAS Concepts
- Ability implementation
- Effect systems
- State management
- Visual feedback
-
Performance Patterns
- Data orientation
- Memory management
- Efficient iteration
- Cache optimization
This project is licensed under the MIT License - see the LICENSE file for details.