Building an fps game with unity

Page 1


Building an FPS Game with Unity Esta obra es propiedad del 51801- UCR

Create a high-quality first person shooter game using the Unity game engine and the popular UFPS and Probuilder frameworks

John P. Doran

'[PACKT] PUBLISHING 'BIRMINGHAM - MUMBAI


Building an FPS Game with Unity Copyright Š 2015 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

'First published: October 2015

Production reference: 1271015

Published by Packt Publishing Ltd. Livery Place 35 Livery Street ....... Birmingham B3 2PB, UK. ISBN 978-1-78217-480-6 www.packtpub.com

Cover image by John P. Doran

Sislema de Bibliolecas

1111111111111111111111111111111111111111 725189

725189

- UCR


Table of Contents Preface Chapter 1: Getting Started on an FPS Prerequisites Project creation Getting started with the Asset Store Installing UFPS Installing Prototype File organization Customizing Unity's layout Summary

Chapter 2: Building Custom Weapons Prerequisites Setting up a testbed Getting models/sounds for weapons Building our weapon - the mesh Creating a UnitBank Creating the weapon Customizing our weapon's properties Summary

Chapter 3: Prototyping Levels with Prototype

v 1 2 4

6 9 12 15 16 17

19 20 20 22 24

29 30 34

39 41

Prerequisites Level design 101 - planning Creating the architectural overview

42 44

3D modeling software Constructing geometry with brushes Modular tilesets

44 44 45

42

Creating geometry Building a doorway

46

60 [ i]


Table of Contents

Duplicating rooms / creating a hallway Preventing falls - collision Adding stairways Coloring your world Summary

Chapter 4: Creating Exterior Environments Prerequisites Introduction to Terrain Height maps Hand sculpting Creating the Terrain Adding color to our Terrain - textures Adding water Adding trees Adding details - grass Building the atmosphere - Skyboxes and Fog Summary

Chapter 5: Building Encounters Prerequisites Adding a simple turret enemy Integrating an AI system - RAIN Integrating an AI system - Shooter AI Spawning enemies with the help of a trigger Spawning multiple enemies at once Cleaning up dead AI Placing health packs/ammo Summary

Chapter 6: Breathing Life into Levels Prerequisites Building an explosive barrel Using triggers for doors Creating an elevator Summary

Chapter 7: Adding Polish with ProBuilder Prerequisites Upgrading from Prototype to ProBuilder Creating material Working with ProBuilder - placing materials Meshing your levels Summary --------------

[ii] --------------

68 73

76 84 86 87 87 88 88 90

91 97

106 108 112 114 120 121 121 122 129 153 164 179

184 186 188 189 189 190 198 208 214 215 215 216 223 227 249 253


Table a/Contents

Chapter 8: Creating a Custom GUI Prerequisites Creating a main menu: part 1 - adding text Creating a main menu: part 2 - adding buttons Creating a main menu: part 3 - button functionality Replacing the default UFPS HUD Summary

255 255 256 261 265 270 278

Chapter 9: Finalizing Our Project

279

Prerequisites Building the game in Unity Building an installer for Windows Building an installer for Windows Summary

279 279 283 287 296

297

Index

--------------

[iii] --------------


What you will learn from this book Use UFPS to build custom weapons with custom meshes and behaviors Explore level design as you prototype levels, making use of Prototype to build levels quickly Build environments that are as realistic as possible while keeping peak performance and repetitiveness down Review tips and tricks on how to create environments using terrain for outdoor areas and a modular workflow for interiors Develop a number of different opponents that your players can fight against, from a simple turret enemy to animated AI characters using the popular RAIN AI engine Discover how to create unique objects such as exploding barrels and objects you can interact with Create a custom GUI to help your game stand out from the crowd Package your game for release, create an installer, and get your game out into the world

9 781782 174806

Visit

www.PacktPub.com code, downloads,

for books, eBooks, and Packtlib.


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.