Procedural Content Generation for Unity Game Development

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Procedural Content Generation is a process by which game content is developed using computer algorithms, rather than through the manual efforts of game developers. This book teaches readers how to develop algorithms for procedural generation that they can use in their own games. These concepts are put into practice using C# and Unity is used as the game development engine.

This book provides the fundamentals of learning and continued learning using PCG. You'll discover the theory of PCG and the mighty Pseudo Random Number Generator. Random numbers such as die rolls and card drafting provide the chance factor that makes games fun and supplies spontaneity. This book also takes you through the full development of a 2D game.

Starting with level generation, you'll learn how PCG can make the game environment for you. You'll move into item generation and learn the different techniques to procedurally create game items. Thereafter, you'll be guided through the more abstract PCG areas such as scaling difficulty to the player and even generating music! The book helps you set up systems within your games where algorithms create computationally generated levels, art assets, quests, stories, characters, and weapons; these can substantially reduce the burden of manually creating every aspect of the game.

Finally, you'll get to try out your new PCG skills on 3D terrain generation.

Author(s): Ryan Watkins
Edition: 1
Publisher: Packt Publishing
Year: 2016

Language: English
Commentary: True PDF
Pages: 260
City: Birmingham
Tags: Programming; Game Development; Unity; Unity3d

Cover
Copyright
Credits
Disclaimer
About the Author
About the Reviewers
www.PacktPub.com
Table of Contents
Preface

Chapter 1: Pseudo Random Numbers
Introducing PCG
Usage of PCG
Application of PCG
Pseudo random numbers
Random versus pseudo random numbers
PRNs in PCG
Random Hello World
Classic Hello World
PCG Hello World
Challenge
Summary

Chapter 2: Roguelike Games
An introduction to Roguelike games
Why Roguelike?
Our own Roguelike project
Importing the base project
File overview
Scenes
Scripts
Summary

Chapter 3: Generating an Endless World
Data structure choice
Array
Linked list
Dictionary
PCG algorithm overview
Scene setup
Player positioning
Camera following
Layers
Initial Game Board
Connecting code
The PCG Game Board
Summary

Chapter 4: Generating Random Dungeons
Algorithm overview
The grid
Essential path
Random path and chambers
Filling in the rest of the gird
Placing the entrance and exit
Algorithm summary
Back to the map
Queue
Prefab setup
An exit sign
DungeonManager
BoardManager
Player
GameManager
Back to the Unity Editor
Seeding the dungeon
Summary

Chapter 5: Randomized Items
Implementing health item generation
Setting up sprites
The Chest prefab
Chest implementation
Spawning the chest
The Item prefab
Item code
Adding player to item interaction
Summary

Chapter 6: Generating Modular Weapons
PCG with modules
Statistics of modular PCG
Creating and configuring new sprites
Creating a multiple image prefab
Modular weapon scripts
Adding a spawn point
Adding a weapon pick up
Adding scripted weapon animation
Adding character facing directions
Summary

Chapter 7: Adaptive Difficulty
Setting up sprites
Adding enemies to the world board
Adding enemies to the Dungeon Board
Fighting the enemy
Adaptive difficulty
Enemy AI
Finishing up
Summary
Concept of music
Tempo
Melody
Repetition
Measure
Dividing the measure
Setting up the script
The Sound Manager script
Adding tension
Summary

Chapter 9: Generating a 3D Planet
Adding a third dimension
3D vs 2D
Working with the Unity primitive sphere
Generating a sphere
Adding randomization
Bad time and space complexities
Multi mesh planet
Exploring the planet
Summary

Chapter 10: Generating the Future
Models
Items
Levels
Texture
Terrain
Physics
Animation
AI
Story
The player sandbox
Summary
Index