Build A Multiplayer Kart Racing Game In Unity V.2019
- Description
- Curriculum
- FAQ
- Reviews
Build a Multiplayer Kart Racing Game From Scratch in Unity will use Unity 2019 and Photon networking tools to take you step-by-step through the setup and development of your own go-kart experience.
The kart racing genre goes back to the 1980s, though it was popularised by Super Mario Kart (1992) and Crash Team Racing (1999). The genre mixes racing and arcade type mechanics with well-known fictional characters and funky tracks littered with pickups and obstacles. Creating such a game combines the skills of networking, artificial intelligence, interface design, special effects and audio.
In this course, Penny reveals the most popular AI techniques used for creating NPC racing character behaviour in games using her internationally acclaimed teaching style and knowledge from over 25 years working with games, graphics and having written two award-winning books on games AI. Throughout, you will follow along with hands-on workshops designed to take you through every step of putting together your own kart racing game. You will first construct from scratch a single-player experience with intelligent NPC components and then add on networking functionality with a Photon master server to create a multiplayer game.
Learn how to program and work with:
-
Car physics and controllers built from the ground up with Unity’s wheel colliders and rigid bodies;
-
AI driven cars with waypoint navigation, smart acceleration & braking and avoidance behaviours;
-
Race Track Mini-maps with Player positions, rear view cameras and leaderboards;
-
Networking with Photon including setting up a master server, remote procedure calls and networked object instantiation;
-
Character selection for vehicle types and player names; and
-
Graphical User Interfaces.
Contents and Overview
The course begins with a detailed explanation of Unity’s vehicle physics system. A four-wheeled car will be constructed from scratch using wheel colliders and rigid bodies in which every setting is explored and all possible functionality tested and put through its paces to get the right balance of skid, acceleration, braking and weight. This system will then be transferred to a top quality Kart model and placed in a racing track environment in which artificial intelligence mechanics will be added to develop non-player character vehicles who can effectively drive around the track while avoiding or in some cases aggressively bumping other players.
You will work your way up to a completed kart racing single player game in which one player takes on three NPCs. Race places will be calculated and a heads-up display (HUD) containing a rear view camera, minimap and player leaderboard will be added. You’ll also learn how to implement a camera-following script that you can use to switch between players for differing points of view.
Once the single player game is completed, the Photon API will be used to set up a master server and then add multiplayer functionality to the game so you can then play it with your friends. You will learn how to create your own server, send remote procedure calls to other players and instantiate networked objects, some of them AI characters.
At the completion of this course you will have covered a wide variety of game development techniques from artificial intelligence, networking and user interface creation. The knowledge and skills you acquire will be applicable across numerous game genres and stand you in good stead for adding advanced functionality to your own game projects.
What students are saying about Penny’s courses:
-
Dr.Penny is a wonderful person and a true expert. All of her courses I’ve taken have been top notch and in my opinion there is no better teacher out there. Her upbeat personality makes you feel as if you’re listening to a friend than just another monotone teacher.
-
This is my first course I’ve ever bought for Unity as I’ve tinkered for years with Unity and not really done anything , but I’m only 27% through the course and I’ve already learned so many new things, it’s really opened my eyes to the power of Unity. I’ve followed Penny for a while now on YouTube and she is a brilliant instructor, very clear on the code you’re writing and explaining how it all works.
-
I really appreciate the clarity. I’ve had many dabblings with learning how to code previously and have found my knowledge comes and goes. This time around, the concepts are really sticking. There is something to the Holistic3D method!
-
1IntroductionVideo lesson
In this video Penny gives an overview to all the components taught in the course.
-
2Join the H3D Student CommunityVideo lesson
H3D has a bustling online student community. Here's how to get involved.
-
3FAQsText lesson
Here's how to get the best experience from studying this course and answers to some popular student questions.
-
4Wheel Physics Part 1Video lesson
In this lecture we will begin taking a close look at the Unity wheel collider that will be the basis for our vehicle physics system.
-
5Wheel Physics Part 2Video lesson
In this lecture we will continue to explore the suspension system and begin writing some code to drive the wheels forward and back.
-
6Wheel Physics Part 3Video lesson
In this lecture we will take a closer look at the structure of the car game object and program in the functionality to turn the wheels.
-
7Wheel Physics Part 4Video lesson
In this lecture we will finish writing the drive code so it is on a single game object and start working on rigging up a kart model.
-
8Driving MechanicsVideo lesson
In this lecture we will add braking and friction mechanics to the drivable car.
-
9Skidding Sounds and Skid MarksVideo lesson
In this lecture we will start adding special effects to the driving mechanics in the form of skidding audio and visuals.
-
10Improved SkiddingVideo lesson
In this lecture we will examine an alternative way to improve the skid mark effect.
-
11Wheel SmokeVideo lesson
In this lecture we will setup particle systems to attach to the wheel colliders to produce smoke when skidding occurs.
-
12Brake LightsVideo lesson
In this very short lecture we will add a brake light to turn on when the car is braking.
-
13Revving the Engine Part 1Video lesson
In this video we will discuss how procedural pitch control can be used to make the car engine sound like it is changing gears.
-
14Revving the Engine Part 2Video lesson
In this lecture we will wrap up the special effects for the vehicle and set the sounds for a 3D environment.
-
15Changing DriversVideo lesson
In this lecture we will separate out the human player controls from the NPC controls that are needed for adding artificial intelligence to self driving karts.
-
16WaypointsVideo lesson
In this lecture I will show you how to create a racing circuit constructed from a series of waypoints along with gizmos to help you visualise the path.
-
17Driving a Circuit with an NPCVideo lesson
In this lecture we will begin work on the AI controller and have it determine its path around a set of waypoints by setting the steering angle, acceleration and amount of braking.
-
18Auto FlippingVideo lesson
In this lecture we will create the racing track and add in some code to automatically flip cars when they roll.
-
19AntirollVideo lesson
In this lecture we will add a stabilising bar to the vehicle to transfer force from one wheel to another to help prevent flipping.
-
20Normalised Braking Part 1Video lesson
In this lecture we will start working on a smarter braking system.
-
21Normalised Braking Part 2Video lesson
In this lecture we complete the majority of the braking code by considering the sharpness of turns and speed of the vehicle.
-
22AccelerationVideo lesson
In this lecture we will be adding in acceleration as a dynamic value within the AIController class.
-
23Cars on RailsVideo lesson
In this lecture we will examine a very basic waypoints traversal system that will become the basis for improving on our NPC car performance.
-
24Progress TrackerVideo lesson
In this lecture we will device a smoother system for allowing the NPC to follow a set of waypoints that also allows it to skip a waypoint and stay on track.
-
25Controlling Tracking Braking and AccelerationVideo lesson
In this video we will complete the NPC driving code with respect to it tracking around the waypoints.
-
26Avoid Other DriversVideo lesson
In this lecture we will build in avoidance steering to the NPC vehicles to allow them take action when colliding with another car.
-
27Getting UnstuckVideo lesson
In this lecture we will examine ways to get a car unstuck when it runs into an obstacle and can't move.
-
28The Starting SignalVideo lesson
In this lecture we will add the first part of the graphical user interface that will show a countdown at the beginning of the race.
-
29A Couple of ChallengesVideo lesson
In this video we will workout getting the player character car unstuck and ensure it doesn't start driving before the race begins.
-
30First and Third Player SwitchingVideo lesson
In this lecture we will modify the camera following code to allow switching between first and third person view.
-
31The Heads Up Display Part 1Video lesson
In this lecture we will start building the HUD for the game beginning with the rear view camera.
-
32The Heads Up Display Part 2Video lesson
In this lecture we will complete the minimap component and add overhead arrows to show the car positions on the map.
-
33The Heads Up Display Part 3Video lesson
In this lecture we will create code to make the HUD elements visible or not visible depending on the player's preferences.
-
34Displaying the Players Name Part 1Video lesson
In this lecture we will create a text prefab that will attached to a vehicle and follow the car around to display the driver's name.
-
35Displaying the Players Name Part 2Video lesson
In this video we will complete the player names display by culling names when they are out of camera view and adding random names to the AI controlled cars.
-
36Setting up a Checkpoint SystemVideo lesson
In this video we will setup the game map with a checkpoint system that will assist in preventing cheating and also determine which player is winning.
-
37Detecting CheckpointsVideo lesson
In this video we will create a checkpoint monitor for each car so it can determine where on the track it is and help us to avoid players cheating.
-
38Displaying Checkpoint and Lap CounterVideo lesson
In this lecture we will add a lap counter and then observe the behaviour of cars with respect to hitting all the checkpoints.
-
39Checking the CheckpointsVideo lesson
In this lecture we will take a close look at how to setup the game environment to ensure cars go through all the checkpoints.
-
40Checking out the PlayerVideo lesson
In this video we will look at one way to setup the checkpoints on the track as well as update the player controller code to allow resetting at checkpoints.
-
41Calculating Places Part 1Video lesson
In this lecture we will take the lap and checkpoint count and turn them into the place positions of First, Second, Third and Fourth.
-
42Calculating Places Part 2Video lesson
In this lecture we will complete the place calculating system and update it's display font.
-
43Displaying the LeaderboardVideo lesson
In this video you will learn how to display the places of all players on a UI leaderboard.
-
44Getting Cars Out of Trouble ChallengesVideo lesson
In this set of challenges we will cover some of the common issues that have arisen during development of this game, ones you might experience and how to fix them.
-
45Cycling Camera through AI PlayersVideo lesson
In this article you will learn how to modify the SmoothFollow script to change the camera to any of the AI players.
-
46Who's the WinnerVideo lesson
In this lecture we will program in the end of race conditions to stop drivers going around the track after they've finished the required number of laps.
-
47Game OverVideo lesson
In this lecture we will build and program in the game over screen with a replay button.
-
48Resetting the LeaderboardVideo lesson
In this lecture we will take a quick look at dealing with the resetting of static values when a scene is reloaded.
-
49Creating Car PrefabsVideo lesson
In this lecture we will construct prefabs from the cars we've built throughout the course to make the game more flexible for player choice of vehicle as well as instantiating networked players.
-
50Creating a Main Menu ScreenVideo lesson
In this lecture we will start working on a main menu to enter a player name and select a car.
-
51Selecting a CarVideo lesson
In this lecture we will complete the player name setting and selection of player cars and pass this information through to the main game scene.
-
52Photon Network SetupVideo lesson
In this lecture you will learn how to setup a Photon Master Server and connect to it with your game in Unity.
-
53Understanding NetworksVideo lesson
In this lecture we will examine the nature of computer networks and the main types used with games.
-
54Photon PrefabsVideo lesson
In this lecture we will construct a set of vehicle prefabs with network components required by Photon.
-
55Starting a Multiplayer GameVideo lesson
In this video we will begin to separate out the single player and multiplayer functionality by adding a button to start the race when networked players are ready.
-
56Creating Networked PlayersVideo lesson
In this lecture we will write enough code to start testing the network setup with two clients and their vehicles.
-
57Creating Networked NamesVideo lesson
In this lecture we will complete writing the Networked Player code to ensure the correct names and places are written above all players.
-
58Understanding Players and ClientsVideo lesson
In this short lecture we will examine the difference between local players and connected clients.
-
59Starting the Race on External ClientsVideo lesson
In this lecture we will coordinate the game start countdown on all clients using remote procedure calls.
-
60Adding Networked AI PlayersVideo lesson
In this lecture you will learn how to add networked AI vehicles to the race and synchronise their names by passing data with prefab instantiation.
-
61Don't Forget the LeaderboardVideo lesson
In this lecture we will go back and fix the code that we took out of the leaderboard to cope with networked play.
-
62Resetting the Networked RaceVideo lesson
In this lecture we will address some issues that arise when trying to restart a networked race to ensure all values and players are reinitialised without losing connection.
-
63Final Kart ProjectText lesson
Find attached as a resource the final Kart project.

External Links May Contain Affiliate Links read more