Introduction
Creating a combat system is a complex task, and making one that is clean and decoupled from unrelated systems (such as the movement system and inventory system) is even more challenging.
To keep GCS pure and free from coupling with other systems, it provides the GCS_CombatEntityInterface. Any functionality within the combat system that may require different implementation logic or should be handled by third parties is implemented through this interface. This is accessed via a static function called GetCombatEntityInterface, which queries the combat interface on a given Actor or its components.
You can refer to the default implementation and freely reimplement this interface in an Actor or component using Blueprints or C++. Alternatively, you can copy or inherit the default implementation and start customizing it.
In the actual code implementation, any code that needs to interact with external systems is referred to as "glue code," which serves to link different systems together.
Note
CombatInterface was renamed to CombatEntityInterface since GCS1.5
Design Diagram

Default Implementation Overview
Since GCS already provides a default implementation, the content of this document is more suited for users who enjoy assembling different systems or those who have ongoing projects and wish to switch combat solutions midway. It is also for users who are not satisfied with the simple default implementation.
The GCS demo project provides a straightforward default implementation to handle logic such as movement state logic and equipment switching logic.
In practical projects, you likely already have your own inventory or movement system, so modifying the default implementation of the Combat Interface is the best way to integrate it into your project.
I also have my own generic movement system and inventory system, and I used the same approach to replace them with my own implementations, which did not affect the logic of the combat system itself.
Generic Combat System and Generic Movement System can make a perfect combination of combat and locomotion.
Implementing the Combat Entity Interface

Each function in this interface is documented with detailed comments and implementation guidelines, so I won't repeat those descriptions here. You can implement this interface in an Actor, but I recommend implementing it via a component.
Using the Combat Entity Interface
Typically, you should not directly use objects that implement the interface; instead, call the relevant interface functions through GetCombatEnityInterface or FindCombatEnityInterface.
For example, as shown in the following image, you just need to ensure that the AvatarActor or one of its components indeed implements GCS_CombatEntityInterface, allowing you to correctly obtain a reference to the combat interface and call the relevant functions.

Use Case
I have a skill called GA_GCS_Sprint that controls whether the character is running. This skill includes OnSprintStart and OnSprintEnd events.
Since this skill affects the character's movement style, instead of directly setting the parameters of the CharacterMovementComponent within the skill, I call it as follows:


For instance, in the default implementation (BC_GCS_DemoCombatEntity),



You can see that I only retrieve the CharacterMovementComponent at the end and set the relevant parameters. You might think this approach takes a long way around, but it has several benefits:
- It ensures the reusability of
GA_GCS_Sprintwithout coupling it to theCharacterMovementComponent. - You can add new rotation modes, making the use of Tags flexible enough.
- Epic is developing Mover 2.0 to replace the traditional
CharacterMovementComponent, so when you truly wish to switch to Mover 2.0, you won't need to search everywhere for instances ofCharacterMovementComponent.
