58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it...

18
Conclusions You have reached the final chapter of this book on Microsofts DirectX. At this point you should have a good understanding of DirectX 11 from graphics to input and audio as well as basic, yet common, math concepts for both 2D and 3D games. Although a lot of information was covered in this book, this marks only the beginning of the journey into video game development. Creating a video game is a lot of hard and fulfilling work, and for beginners, understanding the concepts in this book is an important first step. In this chapter we will briefly recap what you have learned and discuss the next steps to take what youve learned to the next level. Where to go from here is not always a trivial choice and, depending on what your passions are, will determine how you focus your time as you move forward. Each role on a video game development team takes a level of expertise that often requires a dedicated and focused individual to master. Recap Each chapter in this book served a specific purpose. As you made your way through this book, the goal was to slowly advance what you know about DirectX as a whole and especially Direct3D for graphics rendering. In this section we will briefly recap what you should have taken away from each chapter of this book. At any point, dont hesitate to go back and reread a chapter when you feel you can improve your understanding, because having a firm grasp of the basics Chapter 9 1

Transcript of 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it...

Page 1: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

Conclusions

You have reached the final chapter of this book on Microsoft’s DirectX. At thispoint you should have a good understanding of DirectX 11 from graphics toinput and audio as well as basic, yet common, math concepts for both 2D and3D games. Although a lot of information was covered in this book, this marksonly the beginning of the journey into video game development. Creating avideo game is a lot of hard and fulfilling work, and for beginners, understandingthe concepts in this book is an important first step.

In this chapter we will briefly recap what you have learned and discuss the nextsteps to take what you’ve learned to the next level. Where to go from here is notalways a trivial choice and, depending on what your passions are, will determinehow you focus your time as you move forward. Each role on a video gamedevelopment team takes a level of expertise that often requires a dedicated andfocused individual to master.

RecapEach chapter in this book served a specific purpose. As you made your waythrough this book, the goal was to slowly advance what you know about DirectXas a whole and especially Direct3D for graphics rendering. In this section we willbriefly recap what you should have taken away from each chapter of this book.At any point, don’t hesitate to go back and reread a chapter when you feel youcan improve your understanding, because having a firm grasp of the basics

Chapter 9

1

Page 2: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

discussed in this book is important for making it easier to learn more advancedtopics in the future. In fact, it is essential.

Chapters 1 and 2The purpose of Chapter 1 was to introduce DirectX, specifically DirectX 11, andthe various components that comprise it. This chapter essentially gave anoverview of the technology, both past and present, and the various parts thatmake up the SDK. Not all parts of DirectX 11 fit within the scope of this book,and now that you are finished with this book it might be beneficial to explorethose other areas as well. In this beginner’s book we’ve covered a lot of topicsnecessary to understand when starting off with DirectX, but there is a ton ofadvanced aspects that DirectX offers developers.

The purpose of Chapter 2 was to quickly introduce you to Direct3D 11 and thebasics of drawing graphics using the API. Chapter 2 focused on the bare basicsof rendering with Direct3D 11 and wrapped up by drawing a simple 2D triangle.From this chapter, you should have walked away with the following knowledge:

n How to initialize Direct3D

n How to create rendering destinations (swap chains and render targets)

n How to clear the color buffer of the main rendering target

n How to draw simple geometry to the screen

n How to properly release DirectX objects from memory

The first two chapters are largely meant for readers starting out with graphicsprogramming in DirectX 11. Readers with experience with previous versions ofDirectX, especially DirectX 10, will find these chapters to be a brief recap of whatthey should already generally know. Remember, DirectX 11 is very close toDirectX 10 in many areas, so those with experience with DirectX 10 should havea leg up on learning DirectX 11. Readers coming from DirectX 9 and later willhave quite an adjustment to make, but this adjustment is definitely for the better,as DirectX 10 and 11 are very friendly to work with.

Chapters 3 and 4The purpose of Chapter 3 was to dive a little deeper into rendering withDirect3D 11 by focusing more on 2D concepts. This was done to give those new

2 Chapter 9 n Conclusions

Page 3: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

to DirectX a much more manageable stepping stone to learning the graphicsAPI, while also providing a necessary foundation for rendering with DirectX.

Chapter 3 differs from Chapter 2 in that it is more focused on geometry andtexture mapping. This separation was done not only to make each chapter moremanageable in size, but also to split the focus from the two extremes of basicrendering (i.e., learning to get something drawn and learning to expand thatknowledge with textures). Chapters 2 and 3 represent two different levels of skillwhen it comes to rendering simple shapes. Readers should have walked awayfrom Chapter 3 with the following knowledge:

n How to create custom vertex layouts and structures

n How to render geometry

n How to perform texture mapping

n How to create and utilize vertex and pixel shaders

Text and strings are important elements in any video game, but unlike pastversions of DirectX, such as DirectX 9, text rendering support in the API nolonger exists, and it is up to the developers to write their own text system. Thepurpose of Chapter 4 was to show you how to draw text in Direct3D 11 using avery simple method of generating the geometry and texture coordinates thatmake up the strings of text. Although this system is fairly simple, more advancedand efficient systems would require more skill than you would have obtainedthis early in the book; therefore the simple system was introduced to give you astart with the topic.

Chapter 4 was directly influenced by the information provided in Chapter 3.You should have walked away from Chapter 4 with the following knowledge:

n How to generate simple geometry for the purpose of drawing strings oftext

n How to generate texture coordinates based on the region of the textureyou wish to use (letter of the text) and use this to build strings of text

Chapter 5The purpose of Chapter 5 was to introduce you to input detection and responsefor keyboards, mice, and Xbox game controllers (which work as USB controllers

Recap 3

Page 4: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

on the PC). Input in some form—even exiting the application via the Escapekey—is important to games and demos. Covering input early on could onlybenefit you, since none of the graphics-related topics of later chapters had anybearing on a chapter dedicated to input. You should have walked away fromChapter 5 with the following knowledge:

n An understanding of DirectInput

n The ability to detect input from keyboards

n The ability to detect input from mice

n The ability to use Xbox 360 game controllers as input devices

Chapter 6No book on games or graphics programming can afford not to cover at least thebasics of the mathematics important to the field of game development. Althoughmath is a huge topic in which you would benefit from formal education, thereare some topics that cannot be left out of a book of this nature, especially a booktargeted toward beginners.

The purpose of Chapter 6 is to give you a basic overview of the various mathconcepts that are popular in video games and would be necessary for this book.Although you do not need a lot of previous experience with the math topics inthis chapter to follow along, everyone needs some exposure and explanation tohelp them understand what is being performed and how they can leverage thisknowledge for their benefit.

Chapter 6 largely covered the math necessary for the 3D-oriented chapters thatfollowed (Chapters 7 and 8) and also went into more depth of the 2D mathconcepts explored in previous chapters. You should have walked away fromChapter 6 with the following knowledge:

n An understanding of XNA Math

n An understanding of vectors and normalized vectors

n An understanding of matrices

n An understanding of coordinate spaces

n An understand of transformations

4 Chapter 9 n Conclusions

Page 5: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

Chapter 7The purpose of Chapter 7 was to go into deeper detail of shaders and effects inDirect3D 11. This chapter not only examined the new effects but also createdexamples of some of the shader types Direct3D 11 supports in order to get youfamiliar with creating them. Also, a few common yet straightforward effectswere created in this chapter as examples. You should have walked away fromChapter 7 with the following knowledge:

n An understanding of the High Level Shading Language (HLSL)

n An understanding of effect files

n An understanding of vertex and pixel shaders

n An understanding of lighting

n An understanding of geometry shaders

n An understanding of the tessellation-based shaders (domain and hull)

n An understanding of compute shaders

Because Direct3D 10, 11, and presumably higher versions will only use shadersfor graphics rendering, it is highly important to have a firm understanding of theHigh Level Shading Language and the nature of shaders in general beforeconcluding this book.

Chapter 8The purpose of Chapter 8 was to provide information on loading morecomplex 3D models and objects than what was seen in the rest of the book.3D cameras were also discussed in this chapter, which built off of the mathinformation discussed in Chapter 6. Throughout this book we’ve touchedupon simple shapes in 2D and 3D form, but this chapter takes it to a wholenew level. Although this is a beginner’s book, we could not leave out the onetopic that every reader will need to learn from this book: the ability to drawmodels.

This chapter is important for a number of reasons. First, it shows you how tocreate complex 3D models, which allows you to begin creating 3D objects andenvironments that you commonly see in the 3D games that you play. Secondly,it discusses how to create cameras in a 3D environment. Rendering characters

Recap 5

Page 6: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

and models can become very advanced when looking at next-generation gamessuch as Naughty Dog’s Drake’s Uncharted 3, and this book covered thefoundations to get you started. You should have walked away from Chapter 8with the following knowledge:

n The ability to render complex 3D models

n The ability to utilize a 3D camera in a virtual scene

n The ability to load and utilized models stored in various file formats

n A basic understanding of how game worlds are represented andcomposed

Game Graphics ProgrammingGraphics is a very important topic for video games and has been for a very longtime. The power of Direct3D 11 comes from its ability to provide next-generation effects to 3D games in a way that is efficient and effective. Graphicsis largely a marriage between art (textures, models, etc.) and technology.

There is much more to graphics than the API being used. Graphics optimiza-tions require knowledge of graphics hardware, the ability to profile and findbottlenecks, and many times some very creative thinking when it comes toproblem solving, where the problem is often about how to get the most out ofwhat we have. Scene and state management are also topics that will quicklycome up as your scenes become more complex because increasing performanceis often related to what you are not doing (or drawing) rather than what you aredoing. In other words, if you can avoid costly state switches (e.g., instead ofchanging textures for every object, draw every object that uses texture A, switchto texture B, and then draw all objects for texture B and so forth) and only drawgeometry that the user can see, then performance can be increased by reducingthese things as much as possible. Other topics that go with this includeinstancing (using fewer draw calls), level of detail (using less geometry fordistant objects), and so much more.

But in addition to drawing geometry, there is also the effects side of graphicsprogramming, and the fill-rate can have a tremendous impact on performance.This includes lighting, shadowing, motion-blur, depth-of-field, high dynamicrange rendering, explosions and smoke, and so much more.

6 Chapter 9 n Conclusions

Page 7: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

There are many resources available to improve your graphics programmingskills. The Game Programming Gems books from Course PTR and ShaderXbooks from Charles River Media are excellent resources for learning advancedgraphics programming techniques. To excel at graphics programming, it helpsto have a strong math background. For those without this background, it is oftennecessary to invest in some really good math books. These math books do notnecessarily need to be focused on video games, but game math books could helpnarrow the focus on the topics most important to an aspiring game developer aswell as present the information in a manner an aspiring game developer canrelate to. The book Mathematics for 3D Game Programming and ComputerGraphics from Charles River Media can be a good reference, depending on yourcurrent level of mathematics skills.

Game ProgrammingIt is a safe bet that your goal in purchasing this book is to learn to make your ownvideo games. This book marked an important first step toward that goal, and asyou now can see, making even simple video games requires skill and experience.It is not always easy work, but it can be quite challenging and fulfilling to playyour own creation and to share that experience with other people.

At this juncture you should have enough information to begin writing your ownvideo games. Realistically, a beginner will not be able to tackle a massivelymultiplayer online role-playing game like World of Warcraft (from ActivisionBlizzard) or a next-gen shooter like Epic Game’s Bulletstorm, but a gameinspired by Pong, Asteroids, Tic-Tac-Toe, etc. is a great way to get thatexperience writing your own games without overburdening yourself. As thewise saying goes, practice makes perfect, and when learning video gamedevelopment, it is best to start small and work your way up.

When creating your own video games, whether it is a hobby, for a portfolio, orwhatever, certain game elements should be present when showcasing yourwork. Complete games are composed of menus, high-score screens (if appli-cable), in-game user interfaces, input, audio, load- and save-game capabilities(if applicable), polish (steady frame-rate, nice visuals, stable execution), andspecial effects to name a few. When putting together a portfolio, it is importantto create games that are as complete as reasonably possible. If you’re starting

Game Programming 7

Page 8: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

off as a hobbyist or a student, no company will expect “AAA” game titleswithin your portfolio, but your games should be complete, stable (bug free),and reasonably polished.

When programming a video game, you are programming the game logic andmechanics that create the experience the users are enjoying. This can beanything from writing code for a death-match game mode in a first-personshooter to a capture-the-flag game mode, to a single-player game level of anaction game, and so much more. Being able to write simulations efficiently is noeasy task; it takes practice and experience to do it well. But as you gain moreexperience, you will find yourself exploring new designs and ideas with moresuccess and fulfillment. Try not to take on too much, however, because it is easyto get overwhelmed when you start swimming in the deep end.

This book’s companion website located at www.UltimateGameProgramming.com (or www.courseptr.com/downloads) has several tutorials on creating videogames, game tools and editors, and game engines. Content for the beginnerlevel tutorials is being developed, including a series on creating your firstcomplete 2D game, first complete 3D game, your first level editors, and anintroduction to 2D and 3D game engines. More content is being planned anddeveloped, so expect this website to grow considerably over time. The book’sspecific URL is www.UltimateGameProgramming.com/BeginningDirectX11.Or you can use www.courseptr.com/downloads..

In the following section we’ll discuss some games and demos you can create tomove you from a beginner of DirectX to the next level. Although some of thesegames might not be the most exciting to play, for a beginner they are veryimportant to create.

Your First 2D GameIt is often recommended that new game programmers start with a simple gameas a first project, and one popular game to start with is a clone of the classicPong, which can be thought of as the “Hello World” of video game program-ming. At UltimateGameProgramming.com, the first game programming tutorialis a 2D Pong-inspired game built complete with menus, audio, and keyboard andgame pad input. The overall goals of this tutorial include the following:

8 Chapter 9 n Conclusions

Page 9: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

n Learn to create a basic menu system involving game screens

n Learn basic artificial intelligence in the single-player game mode

n Implement local two-player support for the multiplayer game mode

n Design and implement an in-game heads-up display (HUD)

Starting off with a simple game inspired by Pong allows this beginner-leveltutorial to touch upon a few key topics without overwhelming you. This tutorialis targeted to beginners who have finished this book and are looking toimplement their acquired knowledge into a working video game. A screenshotof an early version of the tutorial can be seen in Figure 9.1.

Also part of the introduction to the game programming tutorial set is a tutorial oncreating a Tic-Tac-Toe game (Figure 9.2) and a card matching game (Figure 9.3),each of which reinforces the main topics learned during the first game program-ming tutorial.

For each of these tutorials in the introductory series, you will need to know howto perform input with the keyboard and mouse or Xbox 360 game pad (learnedfrom Chapter 5 of this book), play game audio for sound effects (learned fromAppendix B from the companion website), and how to render 2D graphics(learned from Chapters 2 and 3 of this book).

Figure 9.1A screenshot of an early version of the Pong-inspired game programming tutorial.

Game Programming 9

Page 10: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

Following the tutorials in the introductory series will be more 2D themedtutorials aimed at learning other topics such as online multiplayer gameprogramming, game programming for multicore machines, and genre-basedgame programming (e.g., top-down games, side-scrollers, platforming games,etc.). These tutorials will increase in difficulty and will introduce more topics

Figure 9.2A screenshot of an early version of the Tic-Tac-Toe-inspired game tutorial.

Figure 9.3A screenshot of an early version of the card-matching game tutorial.

10 Chapter 9 n Conclusions

Page 11: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

and techniques to aid in learning how to make video games. The goal of thesetutorials is to provide fun exercises for creating games using the knowledge ofDirectX that you have gained in books such as this.

Your First 3D GameCreating 2D games can be fun, but chances are if you are learning DirectX 11,your goal is to eventually make 3D video games. Making a 3D video gamepresents its own challenges, especially when it comes to the management of theart content and the techniques used to gain the best performance out of theapplication.

When starting out with 3D, it is useful to take simple ideas and bring them intothe 3D realm. For example, creating a spaceship flying through a 3D outer-spaceenvironment while shooting asteroids can be a good first step because:

n You can keep the player’s avatar (spaceship), asteroids, and environment(outer space) fairly simple artistically (assuming you are more of a pro-grammer than an artist).

n You can practice adding particle explosions and other special effects toenhance the game’s visual for the weapons and the destruction ofasteroids.

n It allows you to design and implement a simple 3D rendering systemthat operates on a higher level than the graphics API itself, which can bea baby step toward making your first simple game framework (i.e., gameengine).

n It allows you to figure out how to control the ship in a 3D environmenteffectively using common input devices.

n It allows you to implement more complex camera systems than wereused in the 2D games.

UltimateGameProgramming.com will also have an introduction to 3D gameprogramming tutorial based around this very concept. The idea is to take whatwas done in the introduction tutorials (2D games) and move into the 3D world.Firing at asteroids allows readers to move into the 3D realm without having toworry about physics (such as gravity, rag dolls, etc.) and artificial intelligence,

Game Programming 11

Page 12: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

both of which are challenging to learn individually, let alone together or withother topics.

Other game tutorials that can make good starting points for learning 3D gameprogramming include an introduction to first-person shooters, a third-personplatformer, and a simple rail shooter (e.g., Sega’s House of the Dead and VirtualCop games).

Your First Multiplayer GameThere is a difference between writing a single-player game, a local multiplayergame, and an online networked multiplayer game. With a single-player gamethere is usually one input device that is polled and responded to each frame asthe game is being played. The same can be said for local multiplayer gameswhere one or more input device (game pad, etc.) is plugged into a singlemachine that both players are interfacing with. This was the main method ofmultiplayer gaming before the rise of online networked games.

Networked games can generally be seen in two flavors. First there are LAN (localarea network) games. LAN matches are popular for competitive gaming events(tournaments), gaming parties and get-togethers, and any time multiplemachines are connected to one another via a network cable but not necessarilyconnected to the Internet. Many gamers have played the original Xbox’s Halotitle with their friends by getting together a few Xboxes, a few TVs, and a lot ofpizza and having themselves a LAN party!

The second flavor of networked games includes games played over the Internetbetween two or more remote players. This type of gaming session involves manychallenges and obstacles that need to be addressed. Lag, which is the time inmilliseconds it takes for one machine to receive a response from another, is ahuge obstacle to get around. Not only is the frequency with which machinessend messages to one another dynamic, but also the quality of gaming sessionscan be adversely affected by the overall network conditions. And that assumesthe message from one machine actually reaches the other(s).

When starting off with networked multiplayer games over the Internet, one topicthat is sure to come up is predication and smoothing algorithms to keep thesimulation stable and consistent for all players. Usually in LAN matches the lag is

12 Chapter 9 n Conclusions

Page 13: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

not an issue because the distance between machines is fairly small, whereas withthe Internet you can be playing with people in other states and countries, not tomention all of the devices such as routers and stops between you and the otherplayers. To keep the simulation smooth for all players, games must apply varioustechniques to keep everything looking good. This is extremely challenging butalso makes network game programming very interesting and fun to tackle.

There are also issues with network manipulation by players who willingly engagein cheating or network disruption, bandwidth limitations, the handling of playerswho quit or are dropped, migrating between hosts (the game that sets up andruns the game) if the host leaves the game, and many more topics that makemultiplayer game programming over a network something not to take lightly.

Although a set of multiplayer game programming tutorials has yet to startdevelopment at the time of writing this chapter, there are at least three planned,with the first being local multiplayer gaming, LAN multiplayer gaming, andonline multiplayer gaming. Each of these tutorials builds off of one another andscales from beginner to advanced.

3D Game Engines and ArchitectureWe talked about graphics programming, we talked about game programming,and then there is game engine development. Generally, the game engine is acollection of tools and editors used to build games via content and scripts, suchas Epic’s Unreal game engine (see Figure 9.4). These tools can be actualapplications such as light-map compilers, virtual machines, compilers forscripting systems, and so on, as well as being code such as data structures,algorithms, helpers and utilities, and much more.

DirectX is not considered a game engine because, although it does have manybase components that are used by games and game engines, DirectX is acollection of APIs for interfacing with various components such as the graphicshardware, input devices, audio, and so forth. Also, there is far more that goesinto a game such as memory management, content management and pipelinetools, multithreading systems, a host of data structures and algorithms, toolsused for automation, and many more tools that are far beyond what DirectXalone provides. Direct3D, which was the focus of many chapters throughout this

3D Game Engines and Architecture 13

Page 14: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

book, is a rendering application programming interface and not a renderingengine for the same reasons.

But for those unfamiliar with the term game engine, what is it? A game engine isa framework that a game is built upon. This framework is usually abstract andnot specific to any one game title, although it can be tailored toward specificgame genres and is usually originally developed around an initial game thatproves the tech. Typically, all game engines, both simple and complex, includethe following components:

n A rendering system used to draw objects and interfaces

n Scene management and environment partitioning for non-basic gameworlds

Figure 9.4A screenshot from Epic Game’s UDK (Unreal Development Kit).

14 Chapter 9 n Conclusions

Page 15: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

n Editors and tools such as level editors, light compilers, collision com-pilers, content management tools, and much more

n Character animation systems

n A system for playing audio and music within games

n Support for common input devices

More advanced game engines of today can also include additional componentssuch as the following:

n Multithreaded support

n The ability to stream content via a hard drive or disk

n Advanced material and rendering systems

n Advanced animation generation systems

n Powerful scripting languages, compilers, virtual machines, etc.

n Cinematic systems (cut-scenes)

n Advanced rendering pipelines for next-generation effects

n Destructible environments

n Advanced physics and collision systems

n Networking systems

n Auto-update abilities

n Defenses against cheating

n And much more

Rendering systems are usually built on top of rending APIs. A rendering systemin a game engine is often a collection of data structures and algorithms that feedthe rendering API data to draw. Think of the two as two systems workingtogether, where the rendering API draws what it is told to draw and therendering system decides what needs to be drawn and how best to present thatdata to the rendering API.

Rendering systems (also sometimes referred to as rendering engines) are high-level tools used to make drawing and data management efficient. For example,part of a rendering system might be to take a subdivided game world and submit

3D Game Engines and Architecture 15

Page 16: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

only parts of that game world to the rendering API for rendering. By identifyingwhat the user can see and then only drawing that data, games can increaseperformance tremendously. This specific technique falls under the category ofspatial partitioning, practically a necessary evil when drawing terrain, but thereis tons more that modern video games use, some of which include but are notlimited to:

n Next-gen graphics pipeline (e.g., high dynamic range rendering, etc.)

n The generation of data (e.g., portals, shadows, occlusion volumes, etc.)

n Content management for games that stream data

n State management (reducing graphics API state changes greatly improvesperformance)

n Deferred rendering

n Effects systems (e.g., shader generation, etc.)

n And much more

What can be included inside of a game engine seems to have no limits outside ofthe scope of what is needed for the game project it is being developed around.Game engines are a collection of many systems, data structures, algorithms, andtools that together are used to lay the foundation of a video game and providemuch needed automation. By remaining abstract and not hardcoded to anyspecific game, it is possible to reuse game engines across multiple projects. Gameengines such as Epic’s Unreal engine (www.udk.com) do this very well.

Your First Game EngineCreating a game engine, even a simple one to get started, is no trivial task. If youdon’t approach it with care, you could easily overwhelm yourself with a codingnightmare. The key to writing a game engine is to not write a video game enginealone, but instead develop a video game around it. As you develop your game,you can abstract your code into a higher-level framework as you progress indevelopment. The game provides a clear end goal to achieve as well as theroadwork for what needs to be done. Without this end goal or target game todevelop, how would you know what to add or what to focus on? How would youknow when you have completed your task?

16 Chapter 9 n Conclusions

Page 17: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters

One common mistake beginners make is to try to create a game engine withoutcreating a game, as if an engine without a game or tech to prove it is its own endgoal. It is easy to get into what is known as feature creep, where you keep addingfeatures for the sake of adding them without any direction or end goal in mind.Since the goal of a game engine is to be the foundation of a game, games shouldbe the driving force, not a bunch of generic features, wrapper classes, andrendering effects. Tech demos are great, but an actual game is a must.

Creating a “AAA” game engine, on the other hand, takes a tremendous amountof experience, talent, hard work, and expertise, but we all must start somewherein our education. It takes a lot of work and time to obtain such a skill, andprofessional game developers should get a lot of credit for the amazing workthey do. Trying to make a video game yourself is a real eyeopener to how seriousgame development is.

SummaryDirectX is an amazing tool game developers have at their disposal for developingsoftware. If you’ve reached this point of the book after working through eachchapter, you will be at a point where the next best step is to go from creatingsimple demos to creating your own games. There is much more to explore withDirectX, and you are encouraged to explore these other areas now that you havea good handle on the API and how it works.

As a beginner there will be a balancing act between learning more aboutgraphics programming and gaining experience with game programming, whichgo together but are not one and the same. In this book we’ve barely scratched thesurface of graphics programming; there is a mountain of information waiting foryou to learn and explore. There are also the topics of game physics, artificialintelligence, game engine architecture and design, advanced C++ softwaredesign (or whatever your language of choice is), game design, network gameprogramming, and so much more. Each of these topics is a huge subject area andoften includes separate job titles performed by teams of experts in their fields.

Becoming a game developer is a long journey but can be a very excitingexperience of learning and exploring. By completing this book, you’ve takenyour first few steps down this rabbit hole that will hopefully lead you to creatingthe game experiences you’ve always dreamed of.

Summary 17

Page 18: 58958 ch09 rev01 lores 1. - delmarlearning.com · discussed in this book is important for making it easier to learn more advanced topics in the future. In fact, it is essential. Chapters