Best way to handle multiple players

Hello,
I’m having some problems figuring out how to handle multiple players in a cooperative tabletop game that I’m developing. I want to have a widget where the player clicks on a dropdown to define how many players (on the same device nothing online) will play (2, 3 or 4). I was thinking about creating 3 variants of the game to deal with this. Do you guys have any better idea or I’m just not thinking as I should?
Best regards!

make 4 teams and then just spawn in as many as the player selected

I don’t know if this is what I need because I never spawn players. I should have said that it’s a mobile game where the only thing that differentiate the players is the number of cards they have.

I dont know any other way to do this since choosing how many opponents you have means a dynamic game. that almost always involves spawning in run time. do the other players get controlled by AI?

No, they don’t. If I choose to have 3 players for example, I start playing. I receive cards and the board of the game receives “damage”. When I press “End Turn”, I want to maintain the damage on the board, but give other cards to this new player and o that in a loop until the players win or lose.
Sorry if I’m not explaining myself well enough

You should create your own player controller class and instantiate as many player controllers as your user has chosen through your dropdown menu, a real piece of cake :slight_smile: Hope that’s what you were asking for.

If it’s all on one device, no networking, and is all turn-based, and no more than one player can take action at a time, then you technically could have only one Player and just present everything as if things are another player happening, and just filter which objects can be acted upon based on whose turn it is (which could be as simple as an integer variable).

There are advantages of using the gamplay framework provided in Unreal engine, though, and if you ever want to change the game in the future you might wish you had used multiple player controllers.

In my experience, only player 0 can use the mouse and keyboard input mappings, other players have to use gamepads.
So you could actually have player 0 do all the interactions but keep track of gameplay stats in the PlayerStates of other playercontrollers, sort of a hybrid of the two aforementioned approaches.

Awesome idea man!
I will definitely try this approuch. Do you mind if I hit you up with a PM?

OKay yes you can PM. My response time may be slow as I am working at my job today so that takes priority.