It’s been a while since I posted this and I now have a better understanding of the engine architecture.
Since no one gave an answer I’ll give my own:
The engine relies on a gameplay framework. So in general you’ll be building your game in the context of this framework.
The framework declares a bunch of classes that make up the structure of a typical UE game and provides default implementations of these. You can provide custom implementations too, but otherwise, at the very least your game will always use the framework’s defaults. So thats’ where the ‘magic’ comes from.
For example, when you start simulating or playing a level, you will always have:
- 1 game instance per the whole game.
- 1 game mode per level (unless you are client in multiplayer).
The game mode in turn instantiates:
- 1 playercontroller per player, Replicated only to its owning client.
- 1 pawn per player controller, replicated to all clients.
- 1 game state, replicated to all clients.
- 1 player state per player controller, replicated to all clients.
There’s more classes than these but these are some of the core ones. And there is no way to opt out of using them. You can however, use your own implementation of these classes. And to do so, you first need to create a subclass of AGameModeBase, which allows you to then replace any of the above classes with your subclasses (i.e. under Maps & Modes in Project Settings or per level, thru the World panel).