By the way, I know it seems like I just made a little rant about the Gameplay Framework, but I completely agree with the others that it is much better to just bite the bullet and learn how to use it.
The official doc never managed to clearly explain the Gameplay Framework to me. It says things like “the player name and score goes in PlayerState, and the game’s rules go in GameMode”. That just leaves me with more questions than answers. WHY do things have to be like this? What do you mean by “game rules” and how do they even get applied? What does it actually do in practice? What is the lifecycle of all these objects? Why do game-specific things like name and score come built-in into the engine? It’s ugly!!!
But then I found this: http://cedric.bnslv.de/Downloads/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
It explains everything clearly, and from a programmer’s perspective. Read pages 7 to 47 carefully, and suddenly everything will become clear. You’ll see that the Gameplay Framework is actually a brilliant generic structure for online games.
I’ve tried to think of games that wouldn’t work well with the Gameplay Framework, and I couldn’t think of any. Even games with an atypical online structure such as Dark Souls or DayZ, or even games that people say UE4 “doesn’t do well” like RTSs (my guess is that the people who say that are mostly non-programmers who are used to having everything pre-made for their game in advance. UE4 comes with a lot of pre-made shooter gameplay classes that you can use if you make a shooter game, but since it doesn’t have pre-made RTS-gameplay-specific classes, they think it can’t do RTSs). They all work well. The Gameplay Framework is generic enough that you don’t have to worry about specific game compatibility. **The worst case scenario is that you won’t use certain aspects of the framework, but it will never actually prevent you from doing anything **
It basically consists of:
- A class that serves as server-only logic (GameMode)
- A class that represents the client as a whole, and can communicate with the Server (PlayerController)
- A class that represents the public data of every client, accessible to everyone on the network (PlayerState)
- A class that is the central place to store data accessible to everyone on the network (GameState)
- A bunch of functions to make all connected players safely travel to new maps with everything getting properly cleared and initialized, handy Login() and Logout() events, etc…