Procedural Content Generation for Unity Game Development [1 ed.] 978-1-78528-747-3

Procedural Content Generation is a process by which game content is developed using computer algorithms, rather than thr

248 37 5MB

English Pages 601 Year 2016

Report DMCA / Copyright

DOWNLOAD EPUB FILE

Table of contents :
Procedural Content Generation for Unity Game Development
Credits
Disclaimer
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
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
2. Roguelike Games
An introduction to Roguelike games
Why Roguelike?
Our own Roguelike project
Setting up the project
Importing the base project
File overview
Animation
Fonts
Prefabs
Scenes
Scripts
Summary
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
4. Generating Random Dungeons
Algorithm design
Algorithm overview
The grid
Essential path
Random path and chambers
Filling in the rest of the gird
Placing the entrance and exit
Algorithm summary
Data structures
Back to the map
Queue
Prefab setup
An exit sign
DungeonManager
BoardManager
Player
GameManager
Back to the Unity Editor
Seeding the dungeon
Challenge
Summary
5. Randomized Items
Generating health items in the game world
Implementing health item generation
Setting up sprites
Generating items in the dungeon
The Chest prefab
Chest implementation
Spawning the chest
The Item prefab
Item code
Adding player to item interaction
Summary
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
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
8. Generating Music
Concept of music
Tempo
Melody
Repetition
Procedurally generated music algorithm
Measure
Dividing the measure
The base line
Setting up the script
The Sound Manager script
Adding tension
Summary
9. Generating a 3D Planet
Adding a third dimension
3D versus 2D
Know your geometry
Working with the Unity primitive sphere
Generating a sphere
Adding randomization
Bad time and space complexities
Multi mesh planet
Exploring the planet
Summary
10. Generating the Future
Models
Items
Levels
Texture
Terrain
Physics
Animation
AI
Story
The player sandbox
Summary
Index

Procedural Content Generation for Unity Game Development [1 ed.]
 978-1-78528-747-3

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
Recommend Papers