You are previewing Game Programming Algorithms and Techniques: A Platform-Agnostic Approach.
O'Reilly logo
Game Programming Algorithms and Techniques: A Platform-Agnostic Approach

Book Description

Game Programming Algorithms and Techniques is a detailed overview of many of the important algorithms and techniques used in video game programming today. Designed for programmers who are familiar with object-oriented programming and basic data structures, this book focuses on practical concepts that see actual use in the game industry.

Sanjay Madhav takes a unique platform- and framework-agnostic approach that will help develop virtually any game, in any genre, with any language or framework. He presents the fundamental techniques for working with 2D and 3D graphics, physics, artificial intelligence, cameras, and much more.

Each concept is illuminated with pseudocode that will be intuitive to any C#, Java, or C++ programmer, and has been refined and proven in Madhav’s game programming courses at the University of Southern California. Review questions after each chapter help solidify the most important concepts before moving on.

Madhav concludes with a detailed analysis of two complete games: a 2D iOS side-scroller (written in Objective-Cusing cocos2d) and a 3D PC/Mac/Linux tower defense game (written in C# using XNA/ MonoGame). These games illustrate many of the algorithms and techniques covered in the earlier chapters, and the full source code is available at gamealgorithms.net.

Coverage includes

  • Game time management, speed control, and ensuring consistency on diverse hardware

  • Essential 2D graphics techniques for modern mobile gaming

  • Vectors, matrices, and linear algebra for 3D games

  • 3D graphics including coordinate spaces, lighting and shading, z-buffering, and quaternions

  • Handling today’s wide array of digital and analog inputs

  • Sound systems including sound events, 3D audio, and digital signal processing

  • Fundamentals of game physics, including collision detection and numeric integration

  • Cameras: first-person, follow, spline, and more

  • Artificial intelligence: pathfinding, state-based behaviors, and strategy/planning

  • User interfaces including menu systems and heads-up displays

  • Scripting and text-based data files: when, how, and where to use them

  • Basics of networked games including protocols and network topology

Table of Contents

  1. About This eBook
  2. Title Page
  3. Copyright Page
  4. Dedication Page
  5. Contents
  6. Acknowledgments
  7. About the Author
  8. Preface
    1. Why Another Game Programming Book?
    2. Who Should Read This Book?
    3. How This Book Is Organized
    4. Book Features and Conventions
    5. Companion Website
  9. Chapter 1. Game Programming Overview
    1. Evolution of Video Game Programming
    2. The Game Loop
    3. Time and Games
    4. Game Objects
    5. Summary
    6. Review Questions
    7. Additional References
  10. Chapter 2. 2D Graphics
    1. 2D Rendering Foundations
    2. Sprites
    3. Scrolling
    4. Tile Maps
    5. Summary
    6. Review Questions
    7. Additional References
  11. Chapter 3. Linear Algebra for Games
    1. Vectors
    2. Matrices
    3. Summary
    4. Review Questions
    5. Additional References
  12. Chapter 4. 3D Graphics
    1. Basics
    2. Coordinate Spaces
    3. Lighting and Shading
    4. Visibility
    5. World Transform, Revisited
    6. Summary
    7. Review Questions
    8. Additional References
  13. Chapter 5. Input
    1. Input Devices
    2. Event-Based Input Systems
    3. Mobile Input
    4. Summary
    5. Review Questions
    6. Additional References
  14. Chapter 6. Sound
    1. Basic Sound
    2. 3D Sound
    3. Digital Signal Processing
    4. Other Sound Topics
    5. Summary
    6. Review Questions
    7. Additional References
  15. Chapter 7. Physics
    1. Planes, Rays, and Line Segments
    2. Collision Geometry
    3. Collision Detection
    4. Physics-Based Movement
    5. Physics Middleware
    6. Summary
    7. Review Questions
    8. Additional References
  16. Chapter 8. Cameras
    1. Types of Cameras
    2. Perspective Projections
    3. Camera Implementations
    4. Camera Support Algorithms
    5. Summary
    6. Review Questions
    7. Additional References
  17. Chapter 9. Artificial Intelligence
    1. “Real” AI versus Game AI
    2. Pathfinding
    3. State-Based Behaviors
    4. Strategy and Planning
    5. Summary
    6. Review Questions
    7. Additional References
  18. Chapter 10. User Interfaces
    1. Menu Systems
    2. HUD Elements
    3. Other UI Considerations
    4. Summary
    5. Review Questions
    6. Additional References
  19. Chapter 11. Scripting Languages and Data Formats
    1. Scripting Languages
    2. Implementing a Scripting Language
    3. Data Formats
    4. Case Study: UI Mods in World of Warcraft
    5. Summary
    6. Review Questions
    7. Additional References
  20. Chapter 12. Networked Games
    1. Protocols
    2. Network Topology
    3. Cheating
    4. Summary
    5. Review Questions
    6. Additional References
  21. Chapter 13. Sample Game: Side-Scroller for iOS
    1. Overview
    2. Code Analysis
    3. Exercises
    4. Summary
  22. Chapter 14. Sample Game: Tower Defense for PC/Mac
    1. Overview
    2. Code Analysis
    3. Exercises
    4. Summary
  23. Appendix A. Answers to Review Questions
    1. Chapter 1: Game Programming Overview
    2. Chapter 2: 2D Graphics
    3. Chapter 3: Linear Algebra for Games
    4. Chapter 4: 3D Graphics
    5. Chapter 5: Input
    6. Chapter 6: Sound
    7. Chapter 7: Physics
    8. Chapter 8: Cameras
    9. Chapter 9: Artificial Intelligence
    10. Chapter 10: User Interfaces
    11. Chapter 11: Scripting Languages and Data Formats
    12. Chapter 12: Networked Games
  24. Appendix B. Useful Tools for Programmers
    1. Debugger
    2. Source Control
    3. Diff and Merging Tools
    4. Issue Tracking
  25. Index