Coming from Godot: How to setup a centralized state machine for a Player Character

In Unreal Engine (UE), the concept of composition is emphasized. For example, if you want an Actor to have interactive logic, you can create an interactive component, add this component to the Actor, and it will gain the ability to interact. If another Actor also needs to interact, simply add the interactive component to it. Components are more like abilities that can be granted or revoked, and they are implemented through component composition.

Suppose you now want to generate enemies at random positions in the scene. You can either write the logic directly in the level blueprint to generate them, or you can create a Monster Manager. You create this Manager at the beginning in the GameMode and save a reference to it. After that, you can use the Monster Manager to generate monsters. There are various ways to implement this, and the design depends on the specific logic. If your only goal is to generate monsters, I don’t think a Manager is necessary. However, if you have more complex logic and need finer control over the generated Monsters, I believe a Manager is essential.

2 Likes