Video Game Optimization
معرفی کتاب «Video Game Optimization» نوشتهٔ Eric Preisz, Ben Garney، منتشرشده توسط نشر Course Technology PTR در سال 2010. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Video Game Optimization» در دستهٔ بدون دستهبندی قرار دارد.
video Game Optimization Describes A Process For Increasing The Performance Of A Video Game For Better Gameplay And Visual Experience. Very Few Game Developers Understand The Process Of Optimizing An Entire Video Game, Yet Learning The Process Is Surprisingly Simple And Applicable To A Broad Audience. The Book Tackles The Process Of Optimization By First Describing How To Determine Where A Game Is Limited And Then Providing Detailed Solutions And Examples To Solving This Limitation. All The Examples Covered In The Book Can Be Applied To A Variety Of Game Types And Coverage Of How To Optimize System Memory, Cpu Processing, Graphics, And Shaders Is Included. Contents 8 Introduction 19 Chapter 1 The Basics of Optimization 24 Getting to Better Optimization 25 Optimization Lifecycle 27 1: Benchmark 28 2: Detection 29 3: Solve 30 4: Check 30 5: Repeat 31 Hotspots and Bottlenecks 31 Hotspots 31 Bottlenecks 32 Trade-Offs 32 Levels of Optimization 34 System Level 34 Algorithmic Level 35 Micro-Level 36 Optimization Pitfalls 37 Assumptions 37 Premature Optimization 37 Optimizing on Only One Machine 38 Optimizing Debug Builds 38 Bad Benchmarks 39 Concurrency 39 Middleware 40 Big O Notation 41 Conclusion 42 Chapter 2 Planning for Your Project 44 Project Lifecycle 45 The Performance Budget 47 Setting Specifications 47 Developing Line Items 48 Typical Project Trajectory 51 Maximizing Return on Investment 53 Visualizing Performance 54 Understanding Slowness 55 High Frame Rate 56 The Value of Consistency 56 Conclusion 58 Chapter 3 The Tools 60 Intrusiveness 61 Types of Tools 62 Profilers 62 System Monitors 62 System Adjusters 63 Timers 101 64 Code Instrumentation 65 Simple Timing 65 Hierarchical Profiling 66 Counters 66 Reports 66 Tool Spotlight 67 Intel VTune 67 Microsoft PIX for Windows 71 NVIDIA PerfHUD 73 NVIDIA FX Composer 75 DirectX Debug Runtime 75 gprof 77 AMD CodeAnalyst 77 AMD GPU PerfStudio 77 Conclusion 78 Sources Cited 79 Chapter 4 Hardware Fundamentals 80 Memory 80 Registers and Caches 81 Memory Mapping 82 Dynamic Random Access Memory 82 Direct Memory Access 82 Virtual Memory 83 GPU and Memory 83 Alignment and Fetching 83 Caching 85 CPU 87 Lifecycle of an Instruction 87 Running Out of Order 90 Data Dependencies 90 Branching and Branch Prediction 92 Simultaneous Multi-Threading 93 Multi-Core 94 GPU: From API to Pixel 94 Application Calls API 95 Geometry 96 Rasterization 97 GPU Performance Terms 99 GPU Programmability 101 Shader Hardware 102 Shader Languages 102 Shader Models 102 Shaders and Stream Processing 103 Conclusion 107 Works Cited 108 Chapter 5 Holistic Video Game Optimization 110 Holistic—The Optimal Approach 111 Parallelism and a Holistic Approach 111 The Power Is in the System 112 The Process 113 The Benchmark 117 GPU Utilization 118 The Decision 119 The Tools 120 CPU Bound: Overview 121 CPU: Source Bound 122 What to Expect 122 The Tools 122 Third-Party Module Bound 123 GPU Bound 124 Pre-Unified Shader Architecture 124 Unified Shader Architecture 125 Kernels 125 Graphics Bus 128 Example 129 Conclusion 130 Works Cited 131 Chapter 6 CPU Bound: Memory 132 Detecting Memory Problems 133 Solutions 135 Pre-Fetching 136 Access Patterns and Cache 137 Randomness 140 Streams 140 AOS vs. SOA 142 Solution: Strip Mining 143 Stack, Global, and Heap 144 Stack 145 Global 145 Heap 145 Solution: Don’t Allocate 146 Solution: Linearize Allocation 146 Solution: Memory Pools 148 Solution: Don’t Construct or Destruct 148 Solution: Time-Scoped Pools 149 Runtime Performance 149 Aliasing 149 Runtime Memory Alignment 150 Fix Critical Stride Issues 152 SSE Loads and Pre-Fetches 154 Write-Combined Memory 155 Conclusion 158 Chapter 7 CPU Bound: Compute 160 Micro-Optimizations 161 Compute Bound 163 Lookup Table 163 Memoization 164 Function Inlining 166 Branch Prediction 169 Make Branches More Predictable 170 Remove Branches 171 Profile-Guided Optimization 171 Loop Unrolling 171 Floating-Point Math 175 Slow Instructions 176 Square Root 177 Bitwise Operations 178 Datatype Conversions 182 SSE Instructions 183 History 183 Basics 184 Example: Adding with SIMD 184 Trusting the Compiler 188 Removing Loop Invariant Code 188 Consolidating Redundant Functions 189 Loop Unrolling 190 Cross-.Obj Optimizations 190 Hardware-Specific Optimizations 190 Conclusion 191 Works Cited 191 Chapter 8 From CPU to GPU 192 Project Lifecycle and You 193 Points of Project Failure 194 Synchronization 194 Caps Management 195 Resource Management 196 Global Ordering 196 Instrumentation 197 Debugging 197 Managing the API 198 Assume Nothing 198 Build Correct Wrappers 198 State Changes 199 Draw Calls 199 State Blocks 201 Instancing and Batching 201 Render Managers 202 Render Queues 204 Managing VRAM 205 Dealing with Device Resets 205 Resource Uploads/Locks 206 Resource Lifespans 207 Look Out for Fragmentation 207 Other Tricks 208 Frame Run-Ahead 208 Lock Culling 208 Stupid Texture (Debug) Tricks 209 Conclusion 210 Chapter 9 The GPU 212 Categories of GPU 213 3D Pipeline 214 I’m GPU Bound!? 214 What Does One Frame Look Like? 216 Front End vs. Back End 216 Back End 217 Front End 223 Special Cases 226 MSAA 226 Lights and Shadows 226 Forward vs. Deferred Rendering 228 MRT 229 Conclusion 229 Chapter 10 Shaders 232 Shader Assembly 234 Full Circle 235 Find Your Bottleneck 236 Memory 236 Inter-Shader Communication 237 Texture Sampling 237 Compute 241 Hide Behind Latency 241 Sacrifice Quality 242 Trade Space for Time 242 Flow Control 243 Constants 244 Runtime Considerations 245 Conclusion 247 Chapter 11 Networking 248 Fundamental Issues 248 Types of Traffic 249 Game State and Events 250 Bandwidth and Bit Packing and Packets, Oh My! 252 How to Optimize Networking 254 Embrace Failure 257 Lie to the User 257 Typical Scenarios 258 Asset Download 258 Streaming Audio/Video 259 Chat 259 Gameplay 259 Profiling Networking 260 How to Build Good Networking into Your Game 261 Conclusion 261 Chapter 12 Mass Storage 262 What Are the Performance Issues? 262 How to Profile 263 Worst Case 263 Best Case 264 What About Fragmentation? 264 SSDs to the Rescue! 264 The Actual Data 265 Bottom Line 265 A Caveat on Profiling 265 What Are the Big Opportunities? 265 Hide Latency, Avoid Hitches 266 Minimize Reads and Writes 266 Asynchronous Access 267 Optimize File Order 269 Optimize Data for Fast Loading 270 Tips and Tricks 274 Know Your Disk Budget 274 Filters 275 Support Development and Runtime File Formats 275 Support Dynamic Reloading 276 Automate Resource Processing 276 Centralized Resource Loading 276 Preload When Appropriate 276 For Those Who Stream 277 Downloadable Content 277 Conclusion 278 Chapter 13 Concurrency 280 Why Multi-Core? 281 Why Multi-Threading Is Difficult 282 Data and Task Parallelism 283 Performance 284 Scalability 284 Contention 286 Balancing 287 Thread Creation 288 Thread Destruction 289 Thread Management 289 Semaphore 289 Win32 Synchronization 290 Critical Sections and Mutex 290 Semaphore 291 Events 291 WaitFor*Object Calls 292 Multi-Threading Problems 292 Race Condition 292 Sharing/False Sharing 293 Deadlock 296 Balancing 297 Practical Limits 297 How Do We Measure? 298 Solutions 298 Example 299 Naïve ReadWriter Implementation 300 Array Implementation 302 Batched Array 303 Thread Count 304 Sharing, Balancing, and Synchronization 304 Conclusion 305 Chapter 14 Consoles 308 Know Your Console 309 Keep Your Fundamentals Strong 310 Push It to the Limit 310 Trimming It Down 311 Mind the Dip: Middleware 312 Support Exists 313 Understand the Contract 314 RAM and the Bus 314 Console GPUs Are Crazy 315 Pushing the Algorithms 315 Fixed Output, Tuned Data 316 Specialized Tools 316 Conclusion 317 Chapter 15 Managed Languages 318 Characteristics of a Managed Language 319 Concerns for Profiling 320 Change Your Assumptions 322 What Should Be Implemented in a Managed Language? 323 What Should Not Be Implemented in a Managed Language? 323 Dealing with the Garbage Collector 324 Under Pressure 325 The Write Barrier 327 Strategies for Better GC Behavior 327 Dealing with JIT 328 When Is JIT Active? 328 Analyzing the JIT 329 Practical Examples—ActionScript 3 and C# 330 Watch Out for Function Call Overhead 330 Language Features Can Be Traps 331 Boxing and Unboxing 332 Conclusion 332 Chapter 16 GPGPU 334 What Is GPGPU? 334 When Is It Appropriate to Process on the GPU? 335 How Fast Is the GPU for Things Other Than Graphics? 337 GPU System Execution 337 Architecture 340 Unified Cores and Kernels 340 Execution: From Bottom to Top 341 Warps 342 Block 342 Grid 343 Kernel 343 Bottlenecks 344 Host Communication 344 Memory and Compute 344 Conclusion 345 Index 346 A 346 B 347 C 347 D 349 E 349 F 350 G 350 H 351 I 351 J 351 K 351 L 352 M 352 N 353 O 353 P 353 R 354 S 355 T 356 U 357 V 357 W 357 X 357 Z 357 "Video Game Optimization describes a process for increasing the performance of a video game for better gameplay and visual experience. Very few game developers understand the process of optimizing an entire video game, yet learning the process is surprisingly simple and applicable to a broad audience. The book tackles the process of optimization by first describing how to determine where a game is limited and then providing detailed solutions and examples to solving this limitation. All the examples covered in the book can be applied to a variety of game types and coverage of how to optimize system memory, CPU processing, graphics, and shaders is included"--Resource description page This book covers the theory and practice of optimization, providing a foundation of techniques and knowledge that apply to a wide variety of hardware and software. It uses small focused performance tests to give practical numbers for common optimization scenarios.--[book cover]
دانلود کتاب Video Game Optimization