Multiplayer board game in Unreal Engine using Blueprints

I’m making a multiplayer board game in Unreal Engine using Blueprints.

I have a color assignment system for players.

Setup:

* GameMode stores an array of available colors:
Red, Blue, Green, Purple.
* When the match starts, each PlayerController calls a `ChooseColor` Server RPC.
* Server picks a random color from `AvailableColors`.
* The selected color is assigned to the player’s `BP_PlayerState.PlayerColor`.
* After assignment, the used color is removed from the array (`Remove Index`) to avoid duplicates.

`PlayerColor` is an Enum variable inside `BP_PlayerState`.

Settings:

* `PlayerColor` → RepNotify enabled.
* `BP_PlayerState` is assigned in GameMode’s `Player State Class`.

Problem:

The server seems to assign colors correctly.

Example logs:

Server:
Player1 = Purple
Player2 = Red

However, clients receive incorrect replicated results:

Client1 = Purple
Client2 = Purple

So the server shows different colors, but clients see the same color.

Current logic inside PlayerController:

ChooseColor (Run on Server)
→ Get GameMode
→ Cast to BP_GameMode
→ Get AvailableColors
→ Length > 0 check
→ Random Integer In Range
→ Get(Array)
→ Get PlayerState
→ Cast to BP_PlayerState
→ Set PlayerColor
→ Remove Index from AvailableColors

Current logic inside GameMode:

Current logic inside PlayerState(OnRep_PlayerColor):

Questions:

* Is my architecture correct for multiplayer color assignment?
* What’s the proper way to store and replicate unique player colors using PlayerState?
* What is the safest way to reference the correct PlayerState in PlayerController / UI / Character Blueprints?

I can also provide Blueprint screenshots if needed.

Sorry if my bluprint is too bad, I just started learning it recently

hi, if as per your game logic, choose color logic has to start in starting phase itself? why not call and manage directly from game mode? and for this kind of players management, i believe that correct ones are game mode and game state

Hello

Do you mean that I should handle the player color assignment inside GameMode and store the assigned color in GameState (or PlayerState)?

Sorry, my English is very poor.

No matter how I try to implement it, the color assignment behaves incorrectly either for the server or for clients. I think this is because I still lack experience and knowledge in Unreal Engine to fully understand why my setup keeps breaking.

Hi, may i know when you preview, how much count you keep? like 4 and then play, and so, 1 player is server and other 3 are clients or how you are previewing this multiplayer behavior?

and yes, game state has a variable i think get players array i believe, where we get player states of all players in level and this event can be fired from game mode. So the idea is, game starts, players are initialized, their player states are valid, game mode calls an event in game state. game state first starts picking the color, does the loop, cast to your player state, sets color, now again loop runs, basically what your setup is there, if you can keep in game state and also,

try not to club many things altogether, first thing is that, take 2 players, make this work with assigning proper colors for server and client (make sure the other player is also correct color instead of default one) and then expand

Hi, thanks for the explanation, I think I understand your point now.

I’m testing multiplayer using PIE with **2 players (2 clients)** in “New Editor Window (PIE)” mode. Previously I also tried “Play as Listen Server”, but currently I’m using **Play as Client**.

When I tested with only 1 player, everything worked correctly and the color assignment logic was consistent.
However, when I switch to 2 players, the behavior breaks and I get inconsistent results like:

Here is the exact output I get when testing with 2 players in PIE (New Editor Window):

```
Client 2: Green
Client 2: Purple

Client 1: Green
Client 1: Purple

Server: Purple
Server: Green

Client 1: Blue
Server: Blue
```

As you can see, the values are inconsistent and change multiple times per run. The same player receives different colors during the same session, and the server/client outputs are not stable or synchronized.( I moved the logic from the PlayerController into the GameMode.)

From what I understand, GameMode should be authoritative, but I might be misunderstanding replication timing or where the logic should run. It seems like the color assignment is being executed multiple times or on different instances in an unexpected order.

I will simplify the setup as you suggested:

* First, I will test with only 2 players
* Ensure server + client both get correct and stable color assignment
* Then expand the logic after it works correctly

If you have any tips on this, it would be very helpful.

Thanks!

my event ChooseColor in GameMode:

OnPostLogin:

i hope this helps ..