In this exercise, you will create an online racing game. The player will be able to race with another player to see who is faster. When you feel stuck remember that once, a man could not work out how to fasten his seatbelt. But then it suddenly clicked!
You will learn to analyze the code and understand what the developer did before you, and adapt it to extend the gameplay to continue the development of the game.
In order to start the project, you will have to open the Epic Games Launcher, switch to the Learn tab and search for the Vehicle Game project. Once you find it and download it, you can create a new Vehicle Game project and that will be the base of your project.
- If the player chooses to Host, the game should ask you for a server name, number of players allowed on the server, whether the player wants to host via LAN or ONLINE, and a host button that launches the player into a multiplayer Lobby.
- The maximum number of players should be 4 and the minimum should be 2.
- If the server name is not provided, the player can not yet host the server and a warning message should appear requesting to insert a name for the server.
- If you press the Join button, the game should display, a list of available sessions which the player can join. Also a refresh button should be available to search for sessions again.
- On the host lobby, before the creator of the session starts the game, the player should be able to drive around the map.
- If you are not the host, a widget should pop on the screen saying “Waiting for the host to start” and if you are the host it should be a “Click START to start” widget. Therefore the host of the server should have a Start button available.
- Once the game started, all players spawn on the map and the race starts after a countdown (A little delay may occur for the client but it quickly goes back to normal so do not worry about this possible issue).
- Use Game State and replicated variables to know who is the winner of the game. If you have more info to share for all players on the game, do it through Game State using server replication.