Game Programming in C++: Creating 3D Games: Creating 3D Games (Game Design)
معرفی کتاب «Game Programming in C++: Creating 3D Games: Creating 3D Games (Game Design)» نوشتهٔ Sanjay Madhav، منتشرشده توسط نشر Addison-Wesley Professional در سال 2018. این کتاب در 526 صفحه، فرمت pdf، زبان انگلیسی ارائه شده است. «Game Programming in C++: Creating 3D Games: Creating 3D Games (Game Design)» در دستهٔ برنامهنویسی قرار دارد.
آیا به دنبال راهی عملی برای ورود به دنیای برنامهنویسی بازیهای ویدیویی سهبعدی هستید؟ کتاب «Game Programming in C++: Creating 3D Games» نوشتهٔ سنجی مدهو، یک راهنمای جامع و مبتنی بر تجربهٔ عملی است که شما را گامبهگام با فرآیند ساخت بازی با زبان سیپلاسپلاس آشنا میکند. این اثر که حاصل سالها تدریس نویسنده در دانشگاه کالیفرنیای جنوبی (USC) است، با زبانی ساده و پروژهمحور، مفاهیم کلیدی از گرافیک و فیزیک گرفته تا هوش مصنوعی و صدا را پوشش میدهد و به شما کمک میکند تا به یک برنامهنویس حرفهای بازی تبدیل شوید.
دربارهٔ کتاب —
«Game Programming in C++» یک کتاب عملی و دستورزی برای برنامهنویسی بازیهای ویدیویی سهبعدی با زبان سیپلاسپلاس است. این کتاب بر اساس دورههای برنامهنویسی بازی سنجی مدهو در دانشگاه کالیفرنیای جنوبی طراحی شده و رویکردی گامبهگام و پروژهمحور دارد. نویسنده مفاهیم را به شکلی ساده و قابلهضم معرفی میکند و توجه ویژهای به ریاضیات مورد نیاز برنامهنویسان حرفهای بازی دارد. از مباحث پایهای مانند گرافیک دوبعدی و بردارها شروع کرده و به تدریج به مباحث پیشرفتهتری مانند گرافیک سهبعدی با اوپنجیال (OpenGL)، هوش مصنوعی، تشخیص برخورد، و انیمیشن اسکلتی میرسد. این کتاب با ارائهٔ مثالهای کد عملی در هر فصل و پروژههای کاملی که در پایان هر بخش قرار دارند، به شما کمک میکند تا دانش خود را در عمل به کار بگیرید و مهارتهای خود را تقویت کنید.
دربارهٔ نویسنده
سنجی مدهو، نویسندهٔ این کتاب، استاد دانشکدهٔ مهندسی ویتربی در دانشگاه کالیفرنیای جنوبی است و از سال ۲۰۰۸ به تدریس دورههای برنامهنویسی و برنامهنویسی بازیهای ویدیویی در این دانشگاه مشغول است. او پیش از ورود به عرصهٔ تدریس، به عنوان برنامهنویس در شرکتهای مطرح توسعهدهندهٔ بازی مانند الکترونیک آرتس (Electronic Arts)، اورسافت (Neversoft) و پاندِمیك استودیوز (Pandemic Studios) فعالیت داشته است. از بازیهای معروفی که مدهو در توسعهٔ آنها نقش داشته، میتوان به «مدال افتخار: حملهٔ اقیانوس آرام» (Medal of Honor: Pacific Assault)، «تونی هاوک پراجکت ۸» (Tony Hawk's Project 8)، «ارباب حلقهها: فتح» (Lord of the Rings: Conquest) و «خرابکار» (The Saboteur) اشاره کرد. او همچنین نویسندهٔ کتاب «الگوریتمها و تکنیکهای برنامهنویسی بازی» (Game Programming Algorithms and Techniques) و یکی از نویسندگان «برنامهنویسی بازی چندنفره» (Multiplayer Game Programming) است و جوایز متعددی از جمله «جایزهٔ دین برای نوآوری در تدریس و آموزش» (Dean's Award for Innovation in Teaching and Education) را از آن خود کرده است.
چرا باید «Game Programming in C++» را بخوانید؟
رویکردی کاملاً عملی و پروژهمحور: این کتاب صرفاً به تئوری بسنده نمیکند و با ارائهٔ مثالهای عینی و پروژههای کامل، شما را برای توسعهٔ بازی در دنیای واقعی آماده میسازد. یادگیری گامبهگام از مفاهیم پایه تا پیشرفته: ساختار کتاب به گونهای است که از اصول اولیه مانند گرافیک دوبعدی و فیزیک شروع کرده و به مباحث پیچیدهتری مانند گرافیک سهبعدی، هوش مصنوعی و انیمیشن میرسد. تمرکز بر زبان کلیدی صنعت بازی (سیپلاسپلاس): سیپلاسپلاس زبان اصلی بسیاری از استودیوهای بزرگ بازیسازی است و تسلط بر آن، شانس شما را برای ورود به این صنعت به شدت افزایش میدهد. رفع ابهام از ریاضیات مورد نیاز برنامهنویسی بازی: نویسنده با زبانی ساده، مفاهیم ریاضیاتی را که برای درک گرافیک و فیزیک بازی ضروری هستند، توضیح میدهد و ترس از ریاضی را از بین میبرد. پوشش جامع مباحث کلیدی ساخت بازی: از گرافیک و صدا گرفته تا هوش مصنوعی، تشخیص برخورد، سیستمهای ورودی و رابطهای کاربری، تمام جنبههای مهم برنامهنویسی بازی در این کتاب پوشش داده شده است.
این کتاب برای چه کسانی مناسب است؟
این کتاب منبعی ایدهآل برای دانشجویان علوم کامپیوتر، برنامهنویسانی که قصد ورود به حوزهٔ بازیسازی را دارند، و حتی توسعهدهندگانی است که با زبانهای دیگر کار کردهاند و میخواهند مهارتهای خود را به سیپلاسپلاس و برنامهنویسی بازی گسترش دهند. با این حال، انتظار میرود که خواننده پیشزمینهای از زبان سیپلاسپلاس و ساختارهای داده داشته باشد تا بتواند از محتوای کتاب به بهترین شکل بهره ببرد. چه به دنبال شروع یک حرفهٔ جدید در صنعت بازیهای ویدیویی باشید و چه بخواهید دانش فنی خود را در این حوزه عمیقتر کنید، این کتاب با رویکرد عملی و پروژهمحور خود، شما را در مسیر درست هدایت خواهد کرد.
سوالات متداول
آیا برای مطالعهٔ این کتاب به دانش قبلی در زمینهٔ برنامهنویسی نیاز است؟
بله، این کتاب برای افرادی طراحی شده که پیشزمینهای از زبان سیپلاسپلاس و ساختارهای داده دارند و قصد دارند این دانش را در حوزهٔ برنامهنویسی بازی به کار گیرند.
آیا این کتاب صرفاً به مباحث تئوری میپردازد یا شامل پروژههای عملی هم هست؟
این کتاب بسیار عملی است و با ارائهٔ مثالهای کد در هر فصل و پروژههای کامل که با پیشرفت شما پیچیدهتر میشوند، به شما کمک میکند تا مفاهیم را در عمل پیادهسازی کنید.
آیا مطالب این کتاب برای بازار کار و استخدام در استودیوهای بازیسازی مفید است؟
بله، از آنجایی که سیپلاسپلاس زبان اصلی بسیاری از استودیوهای بزرگ بازیسازی است، تسلط بر مباحث این کتاب، شما را برای نقشهای مختلف در چرخهٔ توسعهٔ بازی آماده میکند و شانس شما را برای یافتن شغل در این صنعت افزایش میدهد.
Program 3D Games in C++: The #1 Language at Top Game Studios Worldwide C++ remains the key language at many leading game development studios. Since it’s used throughout their enormous code bases, studios use it to maintain and improve their games, and look for it constantly when hiring new developers. Game Programming in C++ is a practical, hands-on approach to programming 3D video games in C++. Modeled on Sanjay Madhav’s game programming courses at USC, it’s fun, easy, practical, hands-on, and complete. Step by step, you’ll learn to use C++ in all facets of real-world game programming, including 2D and 3D graphics, physics, AI, audio, user interfaces, and much more. You’ll hone real-world skills through practical exercises, and deepen your expertise through start-to-finish projects that grow in complexity as you build your skills. Throughout, Madhav pays special attention to demystifying the math that all professional game developers need to know. Set up your C++ development tools quickly, and get started Implement basic 2D graphics, game updates, vectors, and game physics Build more intelligent games with widely used AI algorithms Implement 3D graphics with OpenGL, shaders, matrices, and transformations Integrate and mix audio, including 3D positional audio Detect collisions of objects in a 3D environment Efficiently respond to player input Build user interfaces, including Head-Up Displays (HUDs) Improve graphics quality with anisotropic filtering and deferred shading Load and save levels and binary game data Whether you’re a working developer or a student with prior knowledge of C++ and data structures, Game Programming in C++ will prepare you to solve real problems with C++ in roles throughout the game development lifecycle. You’ll master the language that top studios are hiring for—and that’s a proven route to success. Cover Half Title Title Page Copyright Page Dedication Contents Preface Acknowledgments About the Author 1 Game Programming Overview Setting Up a Development Environment Microsoft Windows Apple macOS Getting This Book’s Source Code Beyond the C++ Standard Library The Game Loop and Game Class Anatomy of a Frame Implementing a Skeleton Game Class Main Function Basic Input Processing Basic 2D Graphics The Color Buffer Double Buffering Implementing Basic 2D Graphics Drawing Walls, a Ball, and a Paddle Updating the Game Real Time and Game Time Logic as a Function of Delta Time Updating the Paddle’s Position Updating the Ball’s Position Game Project Summary Additional Reading Exercises Exercise 1.1 Exercise 1.2 2 Game Objects and 2D Graphics Game Objects Types of Game Objects Game Object Models Integrating Game Objects into the Game Loop Sprites Loading Image Files Drawing Sprites Animating Sprites Scrolling Backgrounds Game Project Summary Additional Reading Exercises Exercise 2.1 Exercise 2.2 Exercise 2.3 3 Vectors and Basic Physics Vectors Getting a Vector between Two Points: Subtraction Scaling a Vector: Scalar Multiplication Combining Two Vectors: Addition Determining a Distance: Length Determining Directions: Unit Vectors and Normalization Converting from an Angle to a Forward Vector Converting a Forward Vector to an Angle: Arctangent Determining the Angle between Two Vectors: Dot Product Calculating a Normal: Cross Product Basic Movement Creating a Basic MoveComponent Class Creating an InputComponent Class Newtonian Physics Linear Mechanics Overview Computing Positions with Euler Integration Issues with Variable Time Steps Basic Collision Detection Circle-Versus-Circle Intersection Creating a CircleComponent Subclass Game Project Summary Additional Reading Exercises Exercise 3.1 Exercise 3.2 Exercise 3.3 4 Artificial Intelligence State Machine Behaviors Designing a State Machine Basic State Machine Implementation States as Classes Pathfinding Graphs Breadth-First Search Heuristics Greedy Best-First Search A* Search Dijkstra’s Algorithm Following a Path Other Graph Representations Game Trees Minimax Handling Incomplete Game Trees Alpha-Beta Pruning Game Project Summary Additional Reading Exercises Exercise 4.1 Exercise 4.2 5 OpenGL Initializing OpenGL Setting Up the OpenGL Window The OpenGL Context and Initializing GLEW Rendering a Frame Triangle Basics Why Polygons? Normalized Device Coordinates Vertex and Index Buffers Shaders Vertex Shaders Fragment Shaders Writing Basic Shaders Loading Shaders Drawing Triangles Transformation Basics Object Space World Space Transforming to World Space Matrices and Transformations Matrix Multiplication Transforming a Point by Using a Matrix Transforming to World Space, Revisited Adding World Transforms to Actor Transforming from World Space to Clip Space Updating Shaders to Use Transform Matrices Texture Mapping Loading the Texture Updating the Vertex Format Updating the Shaders Alpha Blending Game Project Summary Additional Reading Exercises Exercise 5.1 Exercise 5.2 6 3D Graphics The Actor Transform in 3D Transform Matrices for 3D Euler Angles Quaternions New Actor Transform in Action Loading 3D Models Choosing a Model Format Updating the Vertex Attributes Loading a gpmesh File Drawing 3D Meshes Transforming to Clip Space, Revisited Out with the Painter’s Algorithm, in with Z-Buffering The BasicMesh Shader The MeshComponent Class Lighting Revisiting Vertex Attributes Types of Lights Phong Reflection Model Implementing Lighting Game Project Summary Additional Reading Exercises Exercise 6.1 Exercise 6.2 7 Audio Bootstrapping Audio FMOD Installing FMOD Creating an Audio System Banks and Events The SoundEvent Class 3D Positional Audio Setting Up a Basic Listener Adding Positional Functionality to SoundEvent Creating an AudioComponent to Associate Actors with Sound Events The Listener in a Third-Person Game The Doppler Effect Mixing and Effects Buses Snapshots Occlusion Game Project Summary Additional Reading Exercises Exercise 7.1 Exercise 7.2 8 Input Systems Input Devices Polling Positive and Negative Edges Events Basic InputSystem Architecture Keyboard Input Mouse Input Buttons and Position Relative Motion Scroll Wheel Controller Input Enabling a Single Controller Buttons Analog Sticks and Triggers Filtering Analog Sticks in Two Dimensions Supporting Multiple Controllers Input Mappings Game Project Summary Additional Reading Exercises Exercise 8.1 Exercise 8.2 9 Cameras First-Person Camera Basic First-Person Movement Camera (Without Pitch) Adding Pitch First-Person Model Follow Camera Basic Follow Camera Adding a Spring Orbit Camera Spline Camera Unprojection Game Project Summary Additional Reading Exercises Exercise 9.1 Exercise 9.2 10 Collision Detection Geometric Types Line Segments Planes Bounding Volumes Intersection Tests Contains Point Tests Bounding Volume Tests Line Segment Tests Dynamic Objects Adding Collisions to Game Code The BoxComponent Class The PhysWorld Class Ball Collisions with SegmentCast Testing Box Collisions in PhysWorld Player Collision Against the Walls Game Project Summary Additional Reading Exercises Exercise 10.1 Exercise 10.2 Exercise 10.3 11 User Interfaces Font Rendering UI Screens The UI Screen Stack The Pause Menu Buttons Dialog Boxes HUD Elements Adding an Aiming Reticule Adding Radar Localization Working with Unicode Adding a Text Map Other Localization Concerns Supporting Multiple Resolutions Game Project Summary Additional Reading Exercises Exercise 11.1 Exercise 11.2 Exercise 11.3 12 Skeletal Animation Foundations of Skeletal Animation Skeletons and Poses The Inverse Bind Pose Matrix Animation Data Skinning Implementing Skeletal Animation Drawing with Skinning Vertex Attributes Loading a Skeleton Loading the Animation Data The Skinning Vertex Shader Updating Animations Game Project Summary Additional Reading Exercises Exercise 12.1 Exercise 12.2 13 Intermediate Graphics Improving Texture Quality Texture Sampling, Revisited Mipmapping Anisotropic Filtering Rendering to Textures Creating the Texture Creating a Framebuffer Object Rendering to a Framebuffer Object Drawing the Mirror Texture in the HUD Deferred Shading Creating a G-Buffer Class Writing to the G-buffer Global Lighting Adding Point Lights Improvements and Issues Game Project Summary Additional Reading Exercises Exercise 13.1 Exercise 13.2 14 Level Files and Binary Data Level File Loading Loading Global Properties Loading Actors Loading Components Saving Level Files Saving Global Properties Saving Actors and Components Binary Data Saving a Binary Mesh File Loading a Binary Mesh File Game Project Summary Additional Reading Exercises Exercise 14.1 Exercise 14.2 A: Intermediate C++ Review Index A B C D E F G H I J K L M N O P Q R S T U V W X Y Z "The #1 Language at Top Game Studios Worldwide. C++ remains the key language at many leading game development studios. Since it's used throughout their enormous code bases, studios use it to maintain and improve their games, and look for it constantly when hiring new developers. Game Programming in C++ is a practical, hands-on approach to programming 3D video games in C++. Modeled on Sanjay Madhav's game programming courses at USC, it's fun, easy, practical, hands-on, and complete. Step by step, you'll learn to use C++ in all facets of real-world game programming, including 2D and 3D graphics, physics, AI, audio, user interfaces, and much more. You'll hone real-world skills through practical exercises, and deepen your expertise through start-to-finish projects that grow in complexity as you build your skills. Throughout, Madhav pays special attention to demystifying the math that all professional game developers need to know. Set up your C++ development tools quickly, and get started Implement basic 2D graphics, game updates, vectors, and game physics Build more intelligent games with widely used AI algorithms Implement 3D graphics with OpenGL, shaders, matrices, and transformations Integrate and mix audio, including 3D positional audio Detect collisions of objects in a 3D environment Efficiently respond to player input Build user interfaces, including Head-Up Displays (HUDs) Improve graphics quality with anisotropic filtering and deferred shading Load and save levels and binary game data Whether you're a working developer or a student with prior knowledge of C++ and data structures, Game Programming in C++ will prepare you to solve real problems with C++ in roles throughout the game development lifecycle. You'll master the language that top studios are hiring for-and that's a proven route to success."--Page 4 de la couverture "The #1 Language at Top Game Studios Worldwide C++ remains the key language at many leading game development studios. Since it's used throughout their enormous code bases, studios use it to maintain and improve their games, and look for it constantly when hiring new developers. Game Programming in C++ is a practical, hands-on approach to programming 3D video games in C++. Modeled on Sanjay Madhav's game programming courses at USC, it's fun, easy, practical, hands-on, and complete. Step by step, you'll learn to use C++ in all facets of real-world game programming, including 2D and 3D graphics, physics, AI, audio, user interfaces, and much more. You'll hone real-world skills through practical exercises, and deepen your expertise through start-to-finish projects that grow in complexity as you build your skills. Throughout, Madhav pays special attention to demystifying the math that all professional game developers need to know. Set up your C++ development tools quickly, and get started Implement basic 2D graphics, game updates, vectors, and game physics Build more intelligent games with widely used AI algorithms Implement 3D graphics with OpenGL, shaders, matrices, and transformations Integrate and mix audio, including 3D positional audio Detect collisions of objects in a 3D environment Efficiently respond to player input Build user interfaces, including Head-Up Displays (HUDs) Improve graphics quality with anisotropic filtering and deferred shading Load and save levels and binary game data Whether you're a working developer or a student with prior knowledge of C++ and data structures, Game Programming in C++ will prepare you to solve real problems with C++ in roles throughout the game development lifecycle. You'll master the language that top studios are hiring for-and that's a proven route to success."--ONIX annotation You can program games in many languages, but C++ remains the key language used by many leading development studios. Since it's the language used in their enormous code bases, it's the language they need to maintain and improve their games, and look for most often when hiring new developers. Game Programming in C++ is today's practical, hands-on approach to programming 3D video games in C++. Drawing on the author's pioneering experience teaching game development at USC, it guides you through all key concepts hands-on, and helps you deepen your expertise through several start-to-finish, in-depth game projects. Author Sanjay Madhav introduces core concepts one at a time, in an easy-to-digest fashion, paying special attention to the math that professional game developers need to know. Step by step, you'll become increasingly comfortable with real-world C++ game development, and learn how to use C++ in all facets of game programming, including graphics, physics, AI, audio, camera systems, animations, and more