Dev Log 03/03/2021
The character and coin pickup actor have been added inline with the project’s requirements.
The base character class is derived from the base class template in Unreal Engine 4 so it uses the inherited replication components including movement. Using the third person character as a template, the movement and camera systems were created to learn how to set up these systems in relation to input devices within the project settings.
Although not a part of the initial project specification, there is a use action in this character for object interaction in the future. This can be expanded later so that the player’s can trigger events as well as test the effects on both the server and clients connected to the game.
The coin pickup has a placeholder mesh and a basic collision with the player pawn. The coin can be collected by the player and adds to their team score. Once the coin is picked up when a character runs into it, the coin despawns after two seconds.
Coin pickup header file
The game mode, player state and game state classes have also been added to the project’s source code as part of the framework.
The game mode handles the team assignment. The team assignment takes place at the post login phase and provided to the individual player states including the host and clients. This keeps their ID unique and replicates over the network for easy access.
Game mode post login method
Currently, the game mode contains the checks for red and blue team scores. The check score function checks the teams score against the winning score and calls an end match state that displays a message in the output log.
However, the team scores will be moved to the game state to allow better accessibility and visibility of the values over the network on both clients and the server. The game state can be accessed by the game mode to perform the check to see if there is a winning team.
Check score method in game mode
Team colours have been added into the game via blueprints for now with a delay to compensate for the begin play tick. This can be refactored into c++ but as it’s only a cosmetic feature to show team colours it will do.
Team colours
Things to do next
Move the game rules into game state from game mode.
Fix the despawning issue on the coin as 2 seconds seems too long.
Add a game loop within in game state - begin match, game over, x team wins etc.
Comments