更新时间:2021-07-16 09:38:07
封面
版权页
Credits
About the Author
Acknowledgment
About the Reviewer
www.PacktPub.com
Support files eBooks discount offers and more
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Chapter 1. An Introduction to Procedural Generation
Procedural generation versus random generation
Introducing randomness
Seeds
The use of procedural generation in games
Texture creation
Benefits of procedural generation
The drawbacks of procedural generation
A brief history of rogue-like games
How we'll implement procedural generation
Creating unique art
Audio manipulation
Component-based design
The complete game
Exercises
Summary
Chapter 2. Project Setup and Breakdown
Choosing an IDE
Breaking down the game template
Simple and Fast Multimedia Library (SFML)
Polymorphism
The roguelike template setup
Chapter 3. Using RNG with C++ Data Types
Setting the game seed
Setting Boolean values randomly
Random number distribution
Giving the player random stats
Accessing random elements of a collection
Spawning a random item
Generating random characters
Repeating loops
Spawning a random number of items
Chapter 4. Procedurally Populating Game Environments
Potential obstacles
Level tiles
Defining the spawn area
Selecting a suitable game tile
Spawning items at a random location
Spawning random tiles
Chapter 5. Creating Unique and Randomized Game Objects
Creating a random player character
Procedurally generating an enemy class
Procedural items
The random potion class
Chapter 6. Procedurally Generating Art
How procedural generation is used with art
The benefits of procedurally generated art
The drawbacks of procedurally generated art
Using SFML sprite modifiers
Saving modified sprites
Creating enemy sprites procedurally
Editing the game tiles
Chapter 7. Procedurally Modifying Audio
An introduction to SFML audio
Selecting a random main track
Adding sound effects
Editing sound effects
Playing a sound function
3D sound – spatialization
Chapter 8. Procedural Behavior and Mechanics
An introduction to pathfinding
A breakdown of A*
Coding the A* pathfinding algorithm
Implementing A* in the game
Procedurally generated level goals
Chapter 9. Procedural Dungeon Generation
The benefits of procedural level design
Considerations
An overview of dungeon generation overview
The recursive backtracker
Procedurally generating a dungeon