Help Needed: Round-Based System with Team Persistence (CSGO-Style)

Hello,

I’m working on a multiplayer game in Unreal Engine 5 using Blueprints, and I’m aiming to implement a round-based system similar to CS:GO. Here’s what I’m trying to achieve:

System Overview:

  1. Rounds:
  • The game consists of a 3-round cycle. Players stay on the same team for all 3 rounds.
  • At the end of the 3-round cycle, the game resets, and all players can select their teams again.
  1. Team Selection:
  • When a player joins the game:
    • If the game is in the “Waiting to Start” phase, the player selects a team and spawns immediately.
    • If the game is in progress, the player selects a team but doesn’t spawn. Instead, they remain in spectator mode until the next round starts.
  1. Round Transition:
  • At the end of each round:
    • All players (including new ones) spawn at their team-specific spawn points.
    • The round state and game logic reset for the next round.
  • At the end of the 3rd round:
    • The game resets completely (scores, team IDs, etc.), and all players can re-select their teams for a new cycle.

Challenges:

  1. Respawning Players:
  • How can I cleanly reset and respawn all players at the end of each round without using ServerTravel?
  • How should I manage the transition logic between rounds while ensuring proper cleanup of actors and resetting the game environment?
  1. Team Selection for New Players:
  • How can I prevent new players from spawning mid-round while still allowing them to select a team and spawn at the start of the next round?
  1. Resetting Team IDs:
  • What is the best way to reset the team IDs and associated logic at the end of the 3-round cycle?

Current Setup:

  • Team System:
    • Each player has a TeamID variable stored in their PlayerState.
    • Team selection is handled by a widget in the PlayerController, which triggers a spawn function in the GameMode.
  • GameState and Round Management:
    • The GameState has an enum RoundState (WaitingToStart, InProgress, RoundEnd, GameEnd).
    • A replicated function (SetRoundState) updates the round state and triggers appropriate logic.
  • Spawn System:
    • The GameMode has a SpawnPlayer function that spawns players at team-specific spawn points based on their TeamID.

Questions:

  1. How should I structure the Blueprint logic to manage round transitions (e.g., resetting states, respawning players, etc.)?
  2. What’s the best way to allow new players to select a team and integrate them into the game at the start of the next round?
  3. How can I reset the game properly at the end of the 3-round cycle (team IDs, scores, etc.)?

Any guidance, tips, or examples would be greatly appreciated. Thanks in advance!

1 Like