Maximum number of local players on one PC, can you have more than 4?
I am wanting to create a local play game for the PC and want more than 4 players. Is 4 the maximum number for local play or can I create more. I am not using split screen.
asked Jan 07 '15 at 09:49 PM in Blueprint Scripting
,Did anyone figure out if this works?
answered Sep 27 '17 at 06:33 AM
I got this to working! I'm using the Launcher version, no need to access any source code to modify any engine files. So, in the editor, make a C++ class child of GameInstance.
The Header file should look like this:
While the cpp file should look like this:
What I did was I made a copy of the function that creates a player. the Engine one checks for UGameViewport's MaxSplitscreenPlayers, which is hard coded to 4. So instead of go look for the value elswhere, my copy of the function is just set to 5. The function is Callable from Blueprints, so then you just do this, probably from a GameMode on your 1st map. Keep in mind you need to set MyGameInstance c++ class as your default game instance in order for it to exist in the game.
answered Feb 24 '18 at 02:36 PM
Ok, i found the source of this 4 Player restriction, but i can't tell you if it's save to change this:
Inside the GamePlayStatics.cpp we have this function (available in Blueprints)
It, calls this function through the GameInstance.cpp:
I deleted some parts that aren't interesting. If you want to see the full code, please look it up on github yourself.
It seems the 4 comes from the "MaxSplitscreenPlayers Variable that is set inside the GameViewportClient.cpp.
I can't tell you if changing it to 5 will break something if you don't use the splitscreen.
Maybe better wait for a Staff member to explain the 4. :D
answered Jan 08 '15 at 12:16 AM
Max local player is setable in UGameViewportClient class
Problem is there no way to set it in blueprint, you need to do that in C++, by overriding UGameViewportClient ( create your own child class) and set MaxSplitscreenPlayers to whatever you want.in constructor or set it on AGameMode's BeginPlay()
I guess it's set to 4 by default as newest consoles support only 4 controller at once (fun fact: PS3 supported 7 :p)
answered Jan 08 '15 at 12:24 AM
This is awesome! I dont suppose it works to create more splitscreen divisions but this opens lots of new gameplay possibilities.
answered Feb 25 '18 at 04:43 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here