I’m trying to work out what would be the best way to allow for multiple players per client.
What I’m aiming for is multiple players on one client, using either keyboard or controllers, and that client is able to connect to a server with other players playing in the same fashion.
Clients would probably have to manage their local players and inputs, and send details about the players when joining a game.
Maybe I can override AGameMode::Login to create a controller for each player?
But if you override some function you should first check whats the original code, what you will override since if you don’t execute parent code you might incidently paralize or bug out some other code in class:
Overall i recommend you to explore entire GameMode class in functions that really interest you, you might find different and less invasive methods to achieve what you want to achieve. Really don’t be shy to explore engine code, your game code physically becomes part of engine, so better you know engine code the better you know what to code.
It’s been over 2 years since I asked this question, and in that time I’ve learned a lot about UE including how to dive into the source and answer my own questions, however when I asked this I knew almost nothing and looking through engine source was not something that was easy for me at the time.
For anyone else finding this looking for a solution, I haven’t required this functionality since I initially asked the question, but I did a quick test just now and found that if you add a player to the client via “debugcreateplayer -1” console command it seems to add another player connected and controlled through that client completely out of the box with no extra code required.