Join Bruce Van Horn for an in-depth discussion in this video What we'll build: Network tank battle, part of Unity 5: Network Gaming.
- [Instructor] Let's take a look at the game we'll be building. I'm going to open it in Unity. It's in the exercise files which I've downloaded and unzipped to my desktop. So I'm going to select Open, Desktop, Exercise Files, Chapter 2. I'm going to go all the way down to the bottom to Lesson 15. Open the Done folder and load the project. Now I'm going to run my project by going up to File, Build & Run. And I'll go ahead and select a screen resolution of 800 by 600 and Windowed so that I can see everything on one screen.
I'll select Play. And I'll go ahead and click LAN Host to start this in host mode. You can see we have a tank appear on the screen. Now I need to start a second copy of my game, so I'm going to switch back over to Unity and run it in the editor. This time I'll click Client and now I've got two tanks on the screen. I'm going to switch over to my running copy so that we can see the game in both windows. And now we can see a good representation of what we'll be building.
This will be a homage to one of the oldest video games titled Combat, which shipped with the Atari 2600 game system and was made popular during the late '70s and '80s. It was a two player game where each player controlled a tank and the objective was fairly obvious, to shoot the other tank. Today we're going to make a similar game, except rather than two players sitting next to each other, our game will be played with potentially many players over a network. For this course, we won't be focusing too much on what the game looks like. We'll employ very simple graphics and assets and this will allow us to focus on the challenges that typically come with developing a network game.
As we work through building this network game, we'll start each piece by building it first with something simple that's non-networked. Then we'll add the network features as each piece evolves. If you've ever developed network games before, perhaps with technology like Flash or Electrotank, you'll be pleasantly surprised at how easy it is to get the basics working. You won't be needing a dedicated server and you'll be doing all the work in Unity rather than building part of your game as a client and then a separate piece of software acting as the server. With that said, we still have a lot to do so let's get started.
- Reviewing how network gaming works
- Creating a multiplayer game
- Setting up the Network Manager
- Testing the game
- Firing projectiles
- Adding a health indicator
- Fragging the enemy