How would I go about creating a round system in UE5 multiplayer?

i wish to create a round system with 5 rounds, each having a 60 second timer.

i then want the deaths to be tracked so that at the end of the 5th round a winner is determined by the one with the least deaths.

does anyone know roughly how i’d go about doing this?

Handled mostly in the Game mode.

Use a Timer (Set Timer by Event/Function) to handle the round durations.

Handling death counts should be in the Player Controller (Server-Side). Create a Deaths (int) replicated variable. On death you increment that value for the given player.

At the end of the game you look loop the GS PlayerArray (get game State → Get PlayerArray). The player array is an array of all Player Controllers.

Create a Function to return the winner via Looping the PlayerArray getting the Deaths value and comparing it to a local. The locals default value is enormous, so player values will always be lower.


You’ll probably want to consider Ties. Multiple players could have 1 death or 0 deaths.
For matching deaths greater than zero you look at who died last. So each time you increment a death in the controller you’d update a new variable classed Last Death Time (gametime). Your loop would then change to:
((Deaths <= Least Deaths) && ( Last Death Time < Current Last Death Time))

For multiple zero death situations you’ll need another criteria like score to weigh against. Or just use score for both scenarios.

2 Likes

This is great thank you! but now how would i go about tracking the player deaths? as I have the death event within my thirdpersoncharacter blueprint

you’ll want to move it to the player state ideally

Track whos died and how and whatever else that everyone will need to see in your playerstate, then in gamemode you can access all of them and loop threw the array of playerstates

This will help it all make sense, on who can access what

1 Like