Software Architecture Planning for "Harmony's Last Stand" in Unreal Engine 5
This section provides an outline for the architecture of "Harmony's Last Stand," detailing key Unreal Engine 5 components such as GameState, GameMode, GameInstance, and GameManager.
GameState
Purpose
- To keep track of gameplay-related variables and states that are shared among all players.
Key Responsibilities
- Track the game timer (7 minutes per game session).
- Store and update the Harmony Core's health.
- Keep track of the current wave and round.
- Maintain the global and local scores.
Implementation Steps
- Create a new GameState class, either via Blueprints or C++.
- Implement variables and functions for the above responsibilities.
- Ensure GameState variables are replicated for multiplayer functionality.
GameMode
Purpose
- To define the rules of the game and to manage the game flow.
Key Responsibilities
- Spawn player characters and manage respawns.
- Start and end the game based on conditions (e.g., timer reaching zero or Harmony Core's health dropping to zero).
- Handle transitions between different game states (e.g., from gameplay to game over screen).
Implementation Steps
- Create a new GameMode class.
- Configure player spawning and game over conditions.
- Implement the game rules defined in the Game Design Document.
GameInstance
Purpose
- To hold data that should persist between different game sessions and levels.
Key Responsibilities
- Store player profile information.
- Maintain leaderboard data.
- Save and load player preferences and settings.
Implementation Steps
- Create a new GameInstance class.
- Implement variables and functions for the above responsibilities.
- Use save-game mechanisms to ensure data persistence.
GameManager
Purpose
- To serve as the central hub for game-related logic not covered by the aforementioned classes.
Key Responsibilities
- Manage enemy spawning and behavior.
- Calculate scores based on the Points Allocation Rubric.
- Manage local tournaments logic.
- Coordinate between GameState, GameMode, and other classes to ensure smooth gameplay.
Implementation Steps
- Create a GameManager class (Blueprint or C++) that operates under the GameState.
- Link the GameManager with other components like AI controllers for enemies.
- Implement key game mechanics like score calculation and enemy behavior as functions in GameManager.