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 projects in this course have been tested and work with Unity 6.
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 projects in this course have been tested and work with Unity 6.
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.
In this video Penny gives an overview to all the components taught in the course.
H3D has a bustling online student community. Here's how to get involved.
How to contact us
Here's how to get the best experience from studying this course and answers to some popular student questions.
While this course was developed in a previous version of Unity, we've tested the projects and they work with Unity 6. This video is a guide to help you adjust your learning in this course to use Unity 6.
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.
In this lecture we will continue to explore the suspension system and begin writing some code to drive the wheels forward and back.
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.
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.
In this lecture we will add braking and friction mechanics to the drivable car.
In this lecture we will start adding special effects to the driving mechanics in the form of skidding audio and visuals.
In this lecture we will examine an alternative way to improve the skid mark effect.
In this lecture we will setup particle systems to attach to the wheel colliders to produce smoke when skidding occurs.
In this very short lecture we will add a brake light to turn on when the car is braking.
In this video we will discuss how procedural pitch control can be used to make the car engine sound like it is changing gears.
In this lecture we will wrap up the special effects for the vehicle and set the sounds for a 3D environment.
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.
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.
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.
In this lecture we will create the racing track and add in some code to automatically flip cars when they roll.
In this lecture we will add a stabilising bar to the vehicle to transfer force from one wheel to another to help prevent flipping.
In this lecture we will start working on a smarter braking system.
In this lecture we complete the majority of the braking code by considering the sharpness of turns and speed of the vehicle.
In this lecture we will be adding in acceleration as a dynamic value within the AIController class.
In this lecture we will examine a very basic waypoints traversal system that will become the basis for improving on our NPC car performance.
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.
In this video we will complete the NPC driving code with respect to it tracking around the waypoints.
In this lecture we will build in avoidance steering to the NPC vehicles to allow them take action when colliding with another car.
In this lecture we will examine ways to get a car unstuck when it runs into an obstacle and can't move.
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.
In this video we will workout getting the player character car unstuck and ensure it doesn't start driving before the race begins.
In this lecture we will modify the camera following code to allow switching between first and third person view.
In this lecture we will start building the HUD for the game beginning with the rear view camera.
In this lecture we will complete the minimap component and add overhead arrows to show the car positions on the map.
In this lecture we will create code to make the HUD elements visible or not visible depending on the player's preferences.
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.
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.
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.
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.
In this lecture we will add a lap counter and then observe the behaviour of cars with respect to hitting all the checkpoints.
In this lecture we will take a close look at how to setup the game environment to ensure cars go through all the checkpoints.
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.
In this lecture we will take the lap and checkpoint count and turn them into the place positions of First, Second, Third and Fourth.
In this lecture we will complete the place calculating system and update it's display font.
In this video you will learn how to display the places of all players on a UI leaderboard.
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.
In this article you will learn how to modify the SmoothFollow script to change the camera to any of the AI players.
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.
In this lecture we will build and program in the game over screen with a replay button.
In this lecture we will take a quick look at dealing with the resetting of static values when a scene is reloaded.
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.
In this lecture we will start working on a main menu to enter a player name and select a car.
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.
In this lecture you will learn how to setup a Photon Master Server and connect to it with your game in Unity.
In this lecture we will examine the nature of computer networks and the main types used with games.
In this lecture we will construct a set of vehicle prefabs with network components required by Photon.
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.
In this lecture we will write enough code to start testing the network setup with two clients and their vehicles.
In this lecture we will complete writing the Networked Player code to ensure the correct names and places are written above all players.
In this short lecture we will examine the difference between local players and connected clients.
In this lecture we will coordinate the game start countdown on all clients using remote procedure calls.
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.
In this lecture we will go back and fix the code that we took out of the leaderboard to cope with networked play.
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.
Find attached as a resource the final Kart project.
Where you should take your game development learning journey next.
This link provides further information on the courses you can look at taking based on your interests and skill level.
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.