Core Techniques and Algorithms in Game Programming
Total Page:16
File Type:pdf, Size:1020Kb
Core Techniques and Algorithms in Game Programming Core Techniques and Algorithms in Game Programming To even try to keep pace with the rapid evolution of game development, you need a strong foundation in core programming techniques-not a hefty volume on one narrow topic or one that devotes itself to API- specific implementations. Finally, there's a guide that delivers! As a professor at the Spanish university that offered that country's first master's degree in video game creation, author Daniel Sanchez-Crespo recognizes that there's a core programming curriculum every game designer should be well versed in-and he's outlined it in these pages! By focusing on time-tested coding techniques-and providing code samples that use C++, and the OpenGL and DirectX APIs-Daniel has produced a guide whose shelf life will extend long beyond the latest industry trend. Code design, data structures, design patterns, AI, scripting engines, 3D pipelines, texture mapping, and more: They're all covered here-in clear, coherent fashion and with a focus on the essentials that will have you referring back to this volume for years to come. Table of Contents Introduction What You Will Learn What You Need to Know How This Book Is Organized Conventions Chapter 1. A Chronology of Game Programming Phase I: Before Spacewar Phase II: Spacewar to Atari Phase III: Game Consoles and Personal Computers Phase IV: Shakedown and Consolidation Phase V: The Advent of the Game Engine Phase VI: The Handheld Revolution Phase VII: The Cellular Phenomenon Phase VIII: Multiplayer Games In Closing Chapter 2. Game Architecture Real-Time Software The Game Logic Section The Presentation Section http://gamealgorithms.tar.hu/ (1 of 7)2/9/2009 5:40:12 PM Core Techniques and Algorithms in Game Programming The Programming Process In Closing Chapter 3. Data Structures and Algorithms Types, Structures, and Classes Data Structures The Standard Template Library In Closing Chapter 4. Design Patterns Design Patterns Defined Some Useful Programming Patterns Usability Patterns In Closing Chapter 5. User Input The Keyboard Mouse Joysticks Hardware Abstraction Force Feedback In Closing Chapter 6. Fundamental AI Technologies Context Structure of an AI System Specific Technologies In Closing Chapter 7. Action-Oriented AI On Action Games Choreographed AIs Object Tracking Chasing Evasion Patrolling Hiding and Taking Cover Shooting Putting It All Together In Closing Chapter 8. Tactical AI Tactical Thinking Explained http://gamealgorithms.tar.hu/ (2 of 7)2/9/2009 5:40:12 PM Core Techniques and Algorithms in Game Programming Military Analysis: Influence Maps Representing Tactics In Closing Chapter 9. Scripting Building a Scripting Language Embedded Languages Socket-Based Scripting In Closing Chapter 10. Network Programming How the Internet Really Works The Programmer's Perspective: Sockets Clients A Simple TCP Server Multiclient Servers UDP Servers Preventing Socket Blocks Designing Client-Server Games Massively Multiplayer Games In Closing Chapter 11. 2D Game Programming On Older Hardware Data Structures for 2D Games Mapping Matrices 2D Game Algorithms Special Effects In Closing Chapter 12. 3D Pipeline Overview A First Look Fundamental Data Types Geometry Formats A Generic Graphics Pipeline In Closing Chapter 13. Indoors Rendering General Analysis Occluder-Based Algorithms Binary Space Partition Algorithms Portal Rendering http://gamealgorithms.tar.hu/ (3 of 7)2/9/2009 5:40:12 PM Core Techniques and Algorithms in Game Programming Hierarchical Occlusion Maps Hybrid Approaches Hardware-Assisted Occlusion Tests In Closing Chapter 14. Outdoors Algorithms Overview Data Structures for Outdoors Rendering Geomipmapping ROAM Chunked LODs A GPU-Centric Approach Outdoors Scene Graphs In Closing Chapter 15. Character Animation Analysis Explicit Versus Implicit Methods Explicit Animation Techniques Implicit Animation Overview Prop Handling A Note on Vehicles Limb Slicing Facial Animation Inverse Kinematics Blending Forward and Inverse Kinematics In Closing Chapter 16. Cinematography First-Person Shooters Handling Inertia Flight Simulators and Quaternions Third-Person Cameras Cinematic Cameras: Camera Styles Cinematic Cameras: Placement Algorithms Agent-Based Approaches In Closing Chapter 17. Shading Real-World Illumination Light Mapping http://gamealgorithms.tar.hu/ (4 of 7)2/9/2009 5:40:12 PM Core Techniques and Algorithms in Game Programming The BRDF Nonphotorealistic Rendering In Closing Chapter 18. Texture Mapping Types of Textures Tiling and Decals Filtering Mipmapping Texture Optimization Multipass Techniques Multitexture Texture Arithmetic and Combination Detail Textures Environment Mapping Bump Mapping Gloss Mapping In Closing Chapter 19. Particle Systems Anatomy of a Particle System The Particle Data Structure Some Notes on Architecture Speed-Up Techniques In Closing Chapter 20. Organic Rendering Nature and Complexity Trees Grass Clouds Oceans In Closing Chapter 21. Procedural Techniques Procedural Manifesto Renderman Real-Time Shading Languages Types of Shaders Texture Mapping Particle Systems http://gamealgorithms.tar.hu/ (5 of 7)2/9/2009 5:40:12 PM Core Techniques and Algorithms in Game Programming Animation Special Effects In Closing Chapter 22. Geometrical Algorithms Point Inclusion Tests Ray Intersection Tests Moving Tests Point Versus Triangle Set Collision (BSP-Based) Mesh Versus Mesh (Sweep and Prune Approach) Computing a Convex Hull Triangle Reduction In Closing Appendix A. Performance Tuning Analysis Techniques Analysis Tools General Optimization Techniques Application Efficient Data Transfer Tuning the Geometry Pipeline Tuning the Rasterizer Stage Other Optimization Tools In Closing Appendix B. OpenGL Philosophy Basic Syntax Immediate Mode Rendering Transformations Camera Model Lighting Texturing Working in RGBA Mode Display Lists Vertex Arrays OpenGL Extensions Efficiency Considerations Geometric Representation In Closing http://gamealgorithms.tar.hu/ (6 of 7)2/9/2009 5:40:12 PM Core Techniques and Algorithms in Game Programming Appendix C. Direct3D History Booting Direct3D Handling Geometry Indexed Primitives User Pointer Primitives Efficient Geometry Delivery Flexible Vertex Formats Matrices, Cameras, and Transforms Working with Texture Maps Lighting Render States The Extension Library Animation Helpers In Closing Appendix D. Some Math Involved Distances Trigonometry Vector Math Matrices Appendix E. Further Reading Index http://gamealgorithms.tar.hu/ (7 of 7)2/9/2009 5:40:12 PM Tár.hu tar.hu freeweb.hu altavizsla.hu generalmedia Gyors statisztika: keresés altavizslával: » 183959 felhasználó » 519576 galéria | 19148959 kép » 5266 GByte Tár KÉP KERESÉS WEB TOPLISTA KÉP TOPLISTA TÁR.HU Ismertetõ Kapcsolat Képelõhívás akció! | 2008 október 13. Login: Web.Tár Top10 1. filmletolte... Megtetszett egy kép, vagy adnál egyet a sajátjaidból? Készíttess papírképet 2. film-bazar Jelszó: digitális fotóról! 3. mobiltelefo... A részletekért kattints a képre! 4. aiciu1ae Elfelejtett 5. bdforum jelszavak... 6. jaall 7. games22 Tár.hu Kép.Tár 8. zsoldos22 9. topmodell 10. vmk Fotópályázat Levél.Tár » A nap képe Kép.Tár menü Képeslapküldõ közel 7 millió képpel | 2008 október 10. Tár.hu menü A Tar.hu képeslapküldõ szolgáltatásunkkal nem csupán klasszikus, képeslap jellegû képeket lehet küldeni barátainknak, ismerõseinknek, hanem bármely fotót, »Regisztráció rajzot, amely megtalálható a Kep.Tar rendszerében. Ennek köszönhetõen akár saját nyaralási képeit is elküldheted mint képeslap. »Tár.hu Ismertetõ A rendszer használata igen egyszerû, minden kép közepes méretû nézeténél megjelenik a kép mellett egy képeslap ikon, melyre rákattintva megírhatjuk a »Toplista lapot, kiválaszthatod üdvözlõlapod betûtípusát és színét. A küldés során lehetõség van akár idõzített küldésre is, így az elfelejtett »Keresés születésnapok, névnapok, évfordulók mostantól nem okoznak problémát és a hagyományos képeslapküldõ szolgáltatáshoz képest a tar.hu-n keresztül elküldött »Gyakran Ismételt üdvözlõlapodra akár saját személyes fotóit is elhelyezheted, vagy válogathatsz több mint 7 millió publikus kép között. Kérdések A képeslap elolvasásáról a rendszer e-mail visszajelzést is küld a feladónak. »Technikai Információk »Elküldött megrendeléseim »Kapcsolat Levél.Tár menü © Generál Média Kft. Minden jog fenntartva! Impresszum | Médiaajánlat | Adatvédelmi nyilatkozat http://tar.hu/2/9/2009 5:40:40 PM Introduction Introduction For many years, the best ideas about game programming were handwritten on the back of a napkin. Knowledge was shared informally, with developers sketching ideas at meetings or industry gatherings, or talking with other fellow developers. Our craft was highly unorganized. Years have gone by, and today coding games is more complex than it ever was. The pursuit of realism and immersion have increased team sizes, budgets, and schedules. These are exciting times in which to be a game developer. But we can no longer be unorganized in an industry of our size and importance. Today, professional game development must be efficient, and developers must be reliable. We simply cannot risk the failure of a project because one feature does not turn out as expected or because we don't know how to code a certain effect. Our industry needs structured ways to train new professionals. Our attitude is changing. Events like the Game Developer's Conference, magazines like Game Developer, organizations like the International Game Developers Association (IGDA), and schools all over the world have begun creating this new consciousness