Game Engine Architecture: a Comprehensive View
Total Page:16
File Type:pdf, Size:1020Kb
Copyright Warning & Restrictions The copyright law of the United States (Title 17, United States Code) governs the making of photocopies or other reproductions of copyrighted material. Under certain conditions specified in the law, libraries and archives are authorized to furnish a photocopy or other reproduction. One of these specified conditions is that the photocopy or reproduction is not to be “used for any purpose other than private study, scholarship, or research.” If a, user makes a request for, or later uses, a photocopy or reproduction for purposes in excess of “fair use” that user may be liable for copyright infringement, This institution reserves the right to refuse to accept a copying order if, in its judgment, fulfillment of the order would involve violation of copyright law. Please Note: The author retains the copyright while the New Jersey Institute of Technology reserves the right to distribute this thesis or dissertation Printing note: If you do not wish to print this page, then select “Pages from: first page # to: last page #” on the print dialog screen The Van Houten library has removed some of the personal information and all signatures from the approval page and biographical sketches of theses and dissertations in order to protect the identity of NJIT graduates and faculty. ABSTRACT GAME ENGINE ARCHITECTURE: A COMPREHENSIVE VIEW by Donald Kehoe Game eeome is a ee gowig ieisciiay ie A aiey o iee ski ses ee o come ogee o ceae a oessioa game ese age om a auio a esig oug ogammig a eeome I is iicu o isoae e iee isciies i game eeome sice eey asec o e game is co-eee o eeyig ese Ee i e ogammig omai ee ae a ume o su-isciies a a game ca equie suc as ysics ogammig eiomea ogammig aiicia ieigece a ogammig e coe game egie A game ca ee e eeoe i a ume o iee ways eeig o e esig o e ia ouc is auig aay o equie isciies makes i iicu o oe eecie isucio i game eeome e eecy is o iie e isciies accoig o aiioa acaemic caegoies is eas o oeig couses o game eeome a ae oo aowy ocuse o ea o ay ucioa games o o couses a ae uey eoeica is esis aems o ouie e eeome o a geeic game egie a sow ow i ca e imemee wi miima skis eyo ose i ogammig I is iee o see as a ouaio o eeoes wo wi seciaie i a aicua aea u wi oeeess ee o uesa wa a game egie is a ow ogammes i iee ies ca wok wi i GAME ENGINE ARCHITECTURE: A COMPREHENSIVE VIEW by Donald Kehoe A Thesis Submitted to the Faculty of New Jersey Institute of Technology in Partial Fulfillment of the Requirements for the Degree of Master of Science in Computer Science Department of Computer Science August 2009 AOA AGE GAME EGIE ACIECUE A COMEESIE IEW oa Keoe Dr. James McHugh, Thesis Advisor Professorof Computer Science, NJIT Dr. Andrew Sohn, Committee Member Date Associate Professor of Computer Science. NJIT Dr, Michael Baltrush, Committee Member Date' Associate Professor of Computer Science, NJIT BIOGRAPHICAL SKETCH Author: oa Keoe Degree: Mase o Sn Date: Augus 9 Education: • aceo o As i Comue Sciece ew esey Isiue o ecoogy ewak • Mase o Sciece i Comue Sciece ew esey Isiue o ecoogy ewak 9 Major: Comue Sciece eicae o my oig wie Saa Keoe ii ACKNOWLEDGMENT This thesis would not have been possible without the support of Dr. James McHugh, whose guidance pushed me to gain a better understanding on the subject. I would like to show my gratitude to Dr. Andrew Sohn and Dr. Michael Baltrush for their support and input in the development of this work. Lastly, I offer my regards to all of those who supported me in any respect during the completion of the project. viii TABLE OF CONTENTS Chapter Page 1 IOUCIO A GAME EGIE OEIEW 1 ESIG CAEGES 3 1 age awae Cosieaios 3 Gaica Cosieaios 5 1 Game Egies 5 3 Game Egies 6 3 3 i yi Game Egies 6 3 Coss aom Caeges 7 3 GAME EGIE SUCUE 31 Eiome Sucue 1 311 ayee ackgous 13 31 ie Mas 1 313 3 eig Mas 1 31 Moe Oecs / Wak Masks 19 315 iay Sace aiios 20 3 eiiio ie asig 1 ESOUCE MAAGEME SYSEMS 24 1 Sies 26 Moes 3 iages 9 eices 3 i TABLE OF CONTENTS Chapter Page 1 INTRODUCTION AND GAME ENGINE OVERVIEW 1 2 DESIGN CHALLENGES 3 2.1 age awae Cosieaios 3 Gaica Cosieaios 5 1 Game Egies 5 3 Game Egies 6 3 3 i yi Game Egies 6 3 Coss aom Caeges 7 3 GAME EGIE SUCUE 31 Eiome Sucue 1 311 ayee ackgous 13 31 ie Mas 1 313 3 eig Mas 1 31 Moe Oecs / Wak Masks 19 315 iay Sace aiios 20 3 eiiio ie asig 1 ESOUCE MAAGEME SYSEMS 1 Sies 26 Moes 3 iages 9 eices 3 ix TABLE OF CONTENTS (Continued) Chapter Page 5 Amaues 3 Acios 35 7 Eiies 3 aices emoay Eiies 5 3 MOE EEIG EIY SYSEM UCIOAIY 7 1 oucig ackig 9 7 COISIO EECIO 5 71 isace Coisio 5 7 Ais Aige ouig oes 53 73 Come Eiy Coisios 5 7 a iig 55 75 ay acig 5 AIICIA IEIGECE 5 1 ues ase AI 5 Sci ase AI 66 3 Aaie AI 7 9 COSIG 9 AEI A SAME SIE ESOUCE MAAGE 71 LIST OF FIGURES Figure Page 1 e cyce o e game egie 8 31 ackgou image a coesoig wak mask 15 3 a gi o quas a cage eig ma 1 1 Same sie see ii CAE 1 IOUCIO A GAME EGIE OEIEW Game eeome is a ee gowig ieisciiay ie A aiey o iee ski ses ee o come ogee o ceae a oessioa game is seces om a auio a esig oug ogammig a eeome I is iicu o isoae e iee isciies i game eeome sice eey asec o e game is coeee o eeyig ese Ee wii e see o ogammig ee ae a ume o su isciies a a game ca equie suc as ysics ogammig eiomea ogammig aiicia ieigece a ogammig e coe game egie A game ca ee e eeoe i a ume o iee ways eeig o e esig o e ia ouc is auig aay o iee isciies makes i ey iicu o oe useu isucio i game eeome e eecy is o iie e isciies accoig o aiioa acaemic eameaiaio is as e o couse oeigs o game eeome a ae oo aowy ocuse o ouce ay ucioa games o couses a ae uey eoeica is ae wi aem o ouie a geeic game egie a ow i ca e imemee om scac wi miima skis eyo ogammig is wi see as e ouaio o eeoes a wi seciaie i a aea u wi aways ee o ae e uesaig o wa a game egie is a ow ogammes i iee ies ca wok wi i [] 1 2 A game engine is the core set of data structures and functions that provide the foundation for developing a full game, The engine is responsible for managing all of the resources available to the system and providing the capability to utilize any given resource. This includes loading and drawing graphics as well as handling the input of the player. The engine does not deal with the final upper-level assets (graphics & sounds that are used in the game) or the specific configuration of the game logic, The game logic level is the part of the game that uses the capabilities provided by the game engine in order to give the final game its form and function. In most engines that are developed from scratch for a single game, the two components (engine & logic) will be intertwined, In engines that are developed for long term use (beyond a single game) the components will deliberately be broken into separate parts of the project. In the Id Software series of game engines (referred to by the game they were developed for or simple Id-Tech 1 through Id-Tech 5 { in development}) this breakdown is accomplished by an executable and library separation, The game engine compiles as a separate project into the executable, while the game logic project compiles into a run time linked library (Dynamic Linked Library or DLL for windows based architecture software object or SO for unix based architectures).[7] CHAPTER 2 DESIGN CHALLENGES I oe o oey esig a game egie e esie caaiiies ee o e ieiie e sye o game esie age make a aom wi icae esig coices o e game egie Games a ae mae o seciaie awae suc as ce oes a game cosoes wi aso ee secia aig o accou o imie sysem esouces 2.1 Target Hardware Considerations Oce e age awae as ee ieiie e game egie ca e ae o accou o ay imiaios a uiie ay eaues ee is a oeiew o e awae commoy use i game eeome eeoig games o e esoa comue is commo sice mos eoe ae esoa comues agig om ig e cusom eskos o oae aos Cs e o ae a auace o memoy a ey as ocessos as we as e eei o a- isks o saig a soig age amous o iomaio a iee access (ow use as e eice o eieig coe as we as oie esise wos Uouaey C eoyme as o ake io cosieaio e muie oeaig sysems a a ee cusom uis o e game o imi wo ca ay e game y coosig o suo oy oe Sice Cs aso sue om aiae seciicaios ee is o ase ie caaiiy a ca e assume o a sysems so miimum seciicaios mus e ae o 3 4 igoig ayig wi ess a e esie caaiiies is esis wi ocus o C eeome Wi we ase games ee is a gea aaage i a e seciic oeaig sysems ae geeay o a cosieaio e mao awack o we ase games is imie caaiiies ese games geeay ui o e Aoe as o Micoso Sieig eeome eiomes ese aoms ae imie i ei access o e awae o e comue ayig e game a geeay eom ey sowy comae o games eoye iecy o e C A sog make ow is e ce oe game make Ce oes ae eace a oi o eay oa sauaio o mos as o e wo wic makes em a iea aom o eeoig games e awack o ce oes is a ey ae ey imie i ei caaiiies ey ae imie memoy a ocesso sees a o oa soage (i e om o a soi sae memoy ca is o guaaee (a e ime o is wiig e sie o a ogam a ca u o a ce oe is a imiig aco as we e coe a coe mus a e eow a gie amou o memoy i oe o u a a o eame ey ew ce oes ae suo o 3 acceeaio A ey oua make is e a e cosoe ese cosoes ae awae esige o ayig games a ae mae o e comac a oae ese ae e aaage o eig uey eicae o uig e game Oe aoms sae sysem esouces wi oe ocesses u o so wi cosoes Aoug a o e sysem esouces ae aaiae o e eeoes e sysem as ey imie esouces a may o em ae ie o o suo o 3 acceeaio 5 e mos comeiie make a e ime o is wiig is e ome cosoe ome cosoes ae e isic aaages o oa access o sysem esouces as we as ey goo sysem esouces ey ae o a wi e caaiiies o e esoa Comues wie aig saa sysem caaiiies e amou o memoy ocesso sees a-ie sies a 3 caaiiies aaiae o e eeoes ae kow o ay gie cosoe e oy ea awack is e ee o e oicia eeome kis i oe o ake u aaage o e sysem esouces a o isiue a game o a sysem 2.2 Grphl Cndrtn Oce a age aom as ee cose e gaica caaiiies may e icae y a coice o moe caae aoms is coice may si e imoa is secio coes e caaiiies o e iee gaica egie yes 2.2.