Comp Game Design
Comp Game Design EECS 494
Popular in Course
Popular in Engineering Computer Science
This 202 page Class Notes was uploaded by Ophelia Ritchie on Thursday October 29, 2015. The Class Notes belongs to EECS 494 at University of Michigan taught by Staff in Fall. Since its upload, it has received 17 views. For similar materials see /class/231549/eecs-494-university-of-michigan in Engineering Computer Science at University of Michigan.
Reviews for Comp Game Design
Report this Material
What is Karma?
Karma is the currency of StudySoup.
Date Created: 10/29/15
Networking for Computer Games EECS 494 101106 by Sugih J amin Ingame networking topics i onor rrosnrwor p 6fct Toquot 9 uripg mam mm Machine I Muthincl VDl b d Dun ib Pd ingrmx J5 a u more in EECS S91f491 Systems Systems conSIStency 1 Cheat prOO ng Networking Networking in libraryfkcmcl EECS 489 socket programming v Problem statement p ayerz ave How do you differentiate the two cases at both playerl and player2 Synchronization Synchronization order moves by their times of occurrence Assume globally synchronized clocks Outof synch worlds are inconsistent Small inconsistencies not corrected can lead to large compounded errors later on deer not speared means one less Villager means slower barrack build etc How long do you have to wait for the other players39 moves before rendering your world Playe playerz time I movel lwq fr n r l I l k1l 1 39 J L Algorithm Each player receives all other players moves before rendering next frame Problems long Internet latency variable latencies game speed determined by the slowest player synchronize moves and render scene Algorithm bu er both local and remote moves play them in the future each bucket is a turn say for about 200 ms bucket size can be adapted to measured rtt Problems We game speed bucket size determined by slowest player Wm quotM and render scene What if a move is lost or late Pessimistic Consistency Every player must see the EXACT same world AoEAoKAoM each player simulates its own copy of the world all the worlds must be in sync uses bucket synchronization each player sends moves to all other players dropped packets retransmitted a designated host collect measured rtts from all players and set future bucket sizes Problems variable latencies speed determined by the slowest player Dead Reckoning Dead reckoning aka clientside prediction extrapolate next move based on prior moves compute the velocity and acceleration of objects to dead reckon players can help by sending this info along obviously only works if velocity and acceleration haven t changed 0 move lost m lale dead reckoned Rollback In case of inconsistency server always have authoritative View when clients correct inconsistent Views players may experience warping can players39 decisions be dead reckoned see httpspectrumieeeor2sepO64424 Observation dead reckoning doesn39t have to be limited to lost packets HalfLife each client plays back its own moves immediately and send the moves to server each client also dead reckons the other players moves server computes world and sends its authoritative version to all clients clients reconcile dead reckoned world with server39s version can result in some jerkiness and perception of shooting around corner only need to synchronize important events but must be careful that dead reckoning error doesn39t get compounded over time Shooting around Corner For consistency ALL user input MUST pass through the synchronization module Be careful with random number generators Isolate the one used for gamestate updating from other uses ambient noise etc Design for multiplayer from the start Singleplayer becomes a special case of singleclient multiplayer game I39ulmluuhsn Renews Homequot Pluycnjs Input v qFfl arm 23 tul39cr 39 139 tullcr lo mucky V Send 39 7 Local Input 39 39slrltl thy 39 COHQSICHC Consistency Smoothness For smoother playback decouple bucket size from frame rate even AoE does this Immediately render local moves Modify game design to allow for latency and loss e g make players wait for elevator teleportation takes time require multiple hits per kill let bulletmissile have ying time build in inertia don39t allow sudden change in facing Reducing Consistency Check Do areaofz nterest management aka relevance ltering aura how far you can be sensed cloaked ships have 8 aura nimbus how far you can sense use quantumsensor to detect cloaked ships Aura and nimbus are de ned for a given set of technology e g cloaking device quantum sensor etc Perform consistency check only when B is within A39s nimbus and A is within B39s aura Cheating AoE doesn39t need cheatproo ng because each player simulates each move in lock step all moves are simulated not just collisions HalfLife synchronizes only collisions higher probability for cheating Cheats more at megagamescom superhuman cheat autoaim autoposition gamestate editing boost player39s pro le rule bending seewalk through walls sixthsense cheat lookahead cheat claim to be behind slow link suppresscorrect cheat exploit deadreckoning claim moves were lost then reconstruct advantageous moves based on others39 moves HTI Il ili Player C Piayer H a C IS an honest player 150mg from H Player C Player tau b C 5 a cheater 501115 from H clanmmg to be 150mg trom H At time 15 O C sends out a move consistent with fake moves at time 0 50 100 that were actually computed upon receiving packets from H Player C Player H 0 Distributed Computing Model Two common models Distributed Objects Message Passing Both implemented as abstractions over the socket APIs Distributed Objects object update library sendsreceives object states using socket APIs Message Passing player inputs sentreceived using sockets Socket Programming socket a data structure containing connection information Connection identifying information 0 client IP Internet Protocol address cient port number source IP address 0 source port number Clientserver connection 0 server creates a socket and listens for connections on a wellknown port number 0 client creates a socket and connects to the server address at the wellknown port number Sugih Jamin Gamineecsumich edu TCP Con nection WinSock API TCP Server WSAStartupO WSAEnumProtocolsO WinSock API TCP Client WSAStartupO WSAEnumProtocolsO blocki until connection establishment client connects data request cv l process reqilest data reply l closesocketO WSACleanupO l WSACleanupO Sugih Jamin Gamineecsumich edu buf strlenbuf O closetd Sugih Jamin Gamineecsumich edu clientc int mainint argc char argv struct sockaddrin server struct hostent sp int sd int n char bufBLEN Sd SOCketPFINET SOCKSTREAM IPPROTOTCP memsetchar ampserver 0 sizeofstruct sockaddrin serversinfamily AFINET serversinport htonsushort PORT Sp gethostbynameSERVER memcpyampserversinaddr sp gthaddr sp gthlength connectsd struct sockaddr ampserver sizeofstruct sockaddrin n recvsd buf sizeofbuf 0 while n gt O writel buf n n recvsd buf sizeofbuf O closesd exitO Sugih Jamin Gamineecsumich edu includes and defines To be prepended to both server c and client c include include include include include include include include include define define define define ltstdiohgt ltStdlibhgt ltstringhgt ltunistdhgt ltsystypeshgt ltsyssockethgt ltnetinetinhgt ltarpainethgt ltnetdbhgt SERVER quotlocalhostquot PORT 4897 BLEN 256 QLEN 200 Sugih Jamin Gamineecsumich edu Socket APIs Highlights WinSock APIs socket creates a socket data structure Then we need to populate the structure with the connection identifying information 0 client IP Internet Protocol address 0 client port number 0 source IP address 0 source port number Sugih Jamin Gamineecsumich edu TCP Socket Addresses In the socket structure bind connect IP address Port match incoming pkts destination copy to outgoing pkts destination bind used by server only gives the server socket an IP address andor port connect a TCP initiates connection a udp remembers remote address Sugih Jamin Gamineecsumich edu TCP Socket Addresses TCP Server IP address Port INADDR ANY Wellquot known client s address ephem eral TCP Client IP address Port client s address ephem eral server s address well known Sugih Jamin Gamineecsumich edu NAT and Firewalls What are NAT Network Address Translation and firewalls Sugih Jamin lamineecsumich edu NAT and Firewalls NAT boxes remap port numbers Why Ethernet LAN Firewalls may filter out all unknown ports and all UDP packets Sugih Jamin lamineecsumich edu Socket APls Hightlights cont listen 0 specifies max of pending TCP connections 0 only useful for connection oriented services 0 TOP SYN denial of service attack accept o waits for client connection a returns a connected socket different from the listening socket Sugih Jamin Gamineecsumich edu Socket APls Hightlights cont send 0 returns how many bytes are actually sent 0 must loop to make sure that all is sent except for blocking lO see UNP Section 62 What is blocking and nonblocking lO Why do you want to use nonblocking lO Sugih Jamin lamineecsumich edu Different Types of HO Synchronous blocks puts process to sleep until lO is ready By default operations on sockets are blocking Waiting for HO 1 wait for device availability 2 wait for lO completion Sugih Jamin lamineecsumich edu Nonblocking lO Nonblocking IIO keeps on checking polling until device is available 0 set socket nonblocking int on l ioctlsocketsocket FIONBIO ampon 0 call select on nonblocking socket Signaldriven IIO process gets a signal when device is available 0 use WSAAsynCSeleCt for signals tied to a window 0 or WSAEventSeleCt for signals not tied to a window Asynchronous IIO process notified when lO completed 0 Not widely supported yet See UNP Section 62 for more info Sugih Jamin lamineecsumich edu Socket APIs Hightlights cont IGCV o returns how many bytes are received 0 0 if connection is closed 1 on error a if nonblocking 1 if no data with errno set to EWOULDBLOCK a must loop to make sure that all is received in TCP case 0 How do you know you have received everything sent fixed size part of protocol definition prior handshake Sugih Jamin Gamineecsumich edu Select selectmaxfd readset writeset acceptset timeout synchronous blocking lO multiplexing maxfd is the maximum file descriptor number 1 so if you have only one descriptor number 5 maxfd is 6 descriptor sets provided as bit mask Use FDZERO FDSET FDISSET and FDCLR to work with the descriptor sets the fourth parameter is usually called the exceptset Sugih Jamin lamineecsumich edu Select cont selectmaxfd readset writeset acceptset timeout o returns as soon as one of the specified socket is ready for O o returns of ready sockets 1 on error 0 if timed out and no device is ready what for Sugih Jamin Gamineecsumich edu rechW lselectVSPOmng Which of the following would you use Why loop select timeout recv till done or loop sleepseconds recv till done Sugih Jamin Gamineecs umich edu Socket APIs Hightlights cont closesocket o marks socket unusable 0 actual tear down depends on TCP ifbind bCh dltWSAGetLastErrorforWSEADDRINUSE Sugih Jamin Gamineecsumich edu Socket Options getsockopt and setsockopt UNP Ch 7 o SOREUSEADDR allows server to restart or multiple servers to bind to the same port with different IP addresses 0 SOLINGER whether close should return immediately or abort connection or wait for termination o SORCVBUF and SOSNDBUFI set buffers sizes 0 SOKEEPALIVE server pings client periodically Sugih Jamin Gamineecsumich edu UDP Socket Programming Server must always call bind but not listen nor accept Client doesn t need to call connect Use sendto instead of send However connect can still be used to tell the system to rememberthe remote address Then send instead of sendto can be used Call either recv or recvfrom to recv recvfrom also returns the address of the client UDP packets have boundary not a bytestream as in TCP so recv retrieves one message at a time ie no need to call recv in a loop Sugih Jamin lamineecsumich edu UDP Datagram WinSock API UDP Server WSAStartupO WSAEnumProtocolsO socket blocks until datagram received WinSock API UDP Client WSAStartupO WSAEnumProtocolsO socket data request process request data re 1 W closesocketO l closesocketO WSACleanupO 1 WSACleanupO recvfromo Sugih Jamin Gamineecsumich edu UDP Socket Addresses UDP Server bind UDP Client connect IP address 239489 IP address Port 9489 match incoming pkts destination To be filled in with sender s addr by kernel Port 239489 9489 To be filled in with host s IP addr and ephemeral port by kernel copied to outgoing pkts destination Sugih Jamin Gamineecsumich edu UDP With connect WinSock API UDP Server WSAStartupO WSAEnumProtocolsO socket WinSock API UDP Client WSAStartupO WSAEnumProtocolsO blocks until datagram received data request process request 1 data reply closesocketO closesocketO WSACleanupO WSACleanupO Sugih Jamin Gamineecsumich edu Byte Ordering Bigendian Most Significant Byte MSB in low address sentarrives first Sun Sparc HPPA Littleendian MSB in high address sentarrives later Intel x86 P82 PowerPC and Alpha can be set to either mode MMORG servers and backend servers may live on bigendian machines Sugih Jamin lamineecsumich edu Byte Ordering cont Actual Value 1 MSB LSB 00000000 00000001 Al 00000000 MSB A 00000001 LSB little endian sent without 00000000 htons and ntohs 00000001 Al 00000000 LSB big endian A 00000001 MSB Value 2 8 Sugih Jamin Gamineecsumich edu Byte Ordering cont To ensure interoperability ALWAYS translate short long int to from network byte order before after transmission by using these macros htons htonl ntohl host to network short host to network long ntohsk network to host long network to host short Sugih Jamin lamineecsumich edu Protocol Layers sug an mew quotmun Naming and Addressing DNS Domain Name System name in ASCII string irleecsumichedu IP address written out in dotteddecimal dd ASCII string l4l2138l93 IP address in 32bit binary representation 10001101 11010101 00001000 11000001 Use names instead of addresses symbolic easierto remember variable length string But fixedlength address provides more efficient handling and faster comparison uses less memory and less bandwidth bw Sugih Jamin lamineecsumich edu Name and Adress Manipulation Syscalls to map name tofrom address 0 dns to b gethostbyname o b to dns gethostbyaddress and to change representation 0 dd to b inetaddr inetaton o bto dd inetmtoa dns to dd gethostbyname plus inetntoa Sugih Jamin Gamineecsumich edu Other useful functions o gethostname returns DNS name of current host a getsockname returns IP address bound to socket in binary Used when addr andor port is not specified INADDRANY to find out the actual addr andor port used c getpeername returns IP address of peer in binary Debugging Tools use tcpdump to look at packets on the network httpwindumppolitoitinsta Sugih Jamin Gamineecsumich edu tcpdump Output tcpdump 913485 913766 913820 965499 965857 966126 966392 966842 995417 995842 996143 053504 146672 182531 183112 566220 656695 755094 755369 755452 755683 756357 756654 6 sudo tcpdump i fxpO host tail listening on fxpO irleecsumichedu3465 taileecsumichedussh irleecsumichedu3465 taileecsumichedussh irleecsumichedu3465 taileecsumichedussh irleecsumichedu3465 taileecsumichedussh taileecsumichedussh irleecsumichedu3465 taileecsumichedussh taileecsumichedussh irleecsumichedu3465 irleecsumichedu3465 taileecsumichedussh taileecsumichedussh irleecsumichedu3465 irleecsumichedu3465 taileecsumichedussh irleecsumichedu3465 taileecsumichedussh taileecsumichedussh irleecsumichedu3465 taileecsumichedussh irleecsumichedu3465 taileecsumichedussh irleecsumichedu3465 taileecsumichedussh irleecsumichedu3465 taileecsumichedussh irleecsumichedu3465 irleecsumichedu3465 taileecsumichedussh irleecsumichedu3465 irleecsumichedu3465 taileecsumichedussh taileecsumichedussh irleecsumichedu3465 irleecsumichedu3465 taileecsumichedussh taileecsumichedussh irleecsumichedu3465 taileecsumichedussh irleecsumichedu3465 irleecsumichedu3465 taileecsumichedussh DU quotU39U39 quotU39 quotU39U39 quotU39U39 quotU39 quotU39 quotU39 1334090569zl334090569 l73838966ll73838966l ack 1 win 57920 ltnopn 14140 ack 1 win 579 14039 ack 41 win 57 ack 40 win 57881 ltnop 40584544 ack 41 win ack 584 win 57376 ltnop 41577536 ack 584 wi 58460824 ack 577 wi ack 608 win 57896 ltnop 5771001424 ack 608 ack 1001 win 57920 ltnc 60810244l6 ack lOOl ack 1024 win 57504 ltnc lOOll929928 ack 102 ack 1929 win 57920 ltnc 10241040l6 ack 1929 ack 1040 win 57904 ltnc 1040108848 ack 1929 ack 1088 win 57872 ltnc l929l97748 ack 1088 1088115264 ack 1977 Sugih Jamin Gamineecsumich edu Sources Stevens R Unix Network Programming 2nd or 3rd ed PrenticeHall 2004 All you ever want to know about socket programming even if you re using WinSock Mulholland amp Hakala Programming Multiplayer Games Wordware Publishing 2004 Useful mainly forthe WinSock coverage Bettner P and Terrano M 1500 Archers on a 288 Network Programming in Age of Empires and Beyond GDC 2001 Bernier YW Latency Compensating Methods in ClientServer lngame Protocol Design and Optimization GDC 2001 Rothschild J Mpath Technical Considerations Mpath Interactive 1997 Sugih Jamin lamineecsumich edu Sources cont Spohn D Internet Game Timeline 2003 httpinternetgamesaboutcomlibraryweeklyaatimelineahtm httpinternetgamesaboutcomcsgamingnewsagoty2003htm Bartle R Early MUD History 1990 httpwwwmudcoukrichardmudhisthtm Ng Y S Internet Game Design Gamasutra Aug 1 1997 Ng Y S Designing Fast Action Games for the Internet Gamasutra Sept 5 1997 Rosedale and Ondrejka Enabling PlayerCreated Online Worlds with Grid Computing and Streaming Gamasutra Sep 18 2003 Sugih Jamin Gamineecsumich edu 101306 The Industry About 45 or 30 years old now Employs 144000 people in North America 32006 Annual salary 86K for experienced programmer 64K for artistsanimators 64K for game designers Shape of the Industry Hardware Sony Nintendo Intel IBM Microsoft Software Publishers Electronic Arts Activision Sony Microsoft UbiSoft THQ Vivendi Atari Warner Bros Developers 0 Electronic Arts Sony Microsoft Bungie F iraXis Creative Assembly Blizzard Lucas Arts id Namco Square Valve Raven Relic Red Storm High Voltage Breakaway Games Internet Sales updates multiplayer versions of games massively multiplayer games A HitDriven Entertainment Business The interactive entertainment business is ENTERTAINMENT It is NOT a packaged goods business 70 of teenage boys have played Grand Theft Auto Consumers say I have to have the next WarCraft game from Blizzard No one says I have to have that next razor blade from Gillette Games generate emotional responses and are designed to ful ll fantasies provide escape from reality and stimulate the senses 94 Industry Statistics Topl U Fetch httpvmetheesacomFactstomeFactsphp Sales Dililozripluc Usage data httpvmetheesacomarchivesFilesEssential9620Facts96202006de Dubious Claims About Video Games Games don t in uence behavior Certainly study after study has shown that playing Video games will not incite the player to Violent acts This is generally true of all media effects research The causal link between media consumption and predicted outcome is dif cult if not impossible to make Those looking for a direct connection between game violence and real Violence will come up short But we need to be very careful not to argue that games have no in uence If games cannot move us to tears or get us out of our seats in anger if they cannot push us to think differently or to reconsider the choices we have made in our lives then truly they are the diet soda of media all taste no calories Books movies theater even television may not make people kill each other But they do deeply affect us The reason not to single out video games for censorship is because they are like other media they can affect us deeply and profoundly not because they are harmless Games are bigger than the movies I like the way David Kushner puts it in his book Masters of Doom when he writes Americans spend more money on video games than on movie tickets It s a provocative statistic and clearly indicates something is going on But as Seamus Blackley so eloquently put it The reality is that for all this bravado if you actually go and look at the numbers games really still are the ugly stepchild of the popular media As it turns out Hollywood makes boatloads of money on VHS and DVD sales and rentals and such Endtoend movies are still a much bigger business Which leads to Games are big business It s not just comparisons to Hollywood that put the video game industry into its place Look at Microsoft for exam le Bill and company generated 32 billion last year in revenue compared to the 10 billion or so in revenue generated by the domestic video game industry To be fair Microsoft s revenue is for the whole globe But they would have actually made more money if not for the signi cant losses on their home entertainment Xbox anyone division If you looked down the Fortune 500 you d nd scads of individual companies that make more on their own than the entire video game industry combined Even Starbucks made 32 billion slinging latte Compared to almost any other industry video games are still pretty small potatoes Video games are big entertainment business And a cultural force But we should look rationally at the industry instead of trying to boost the image through cockeyed comparisons Games are a social activity Everyone that takes games seriously laughed when m spent money to tell us that video game players prefer to play with people around Still it would be a gross mischaracterization to say that video games are a social activity The fact is most of us spend most of our time playing games looking at our own screen with our own eyes by ourselves If we refer to play games with friends this is an artifact of our social natures I d say that if we prefgr games in social situations it is because we are social creatures rather than anything games are doing in particular to pull us out of our shells Then again watching movies is not a social activity They routinely show reels before lms reminding people to sit still and be quiet ie don t be social during the ick Sit down and shut up This is a part of the experience of the medium The fact that video games allow any social interaction is a great advance in modern media But it is still a stretch to try and characterize video games as a great social activity Video games can be social But so can knitting and reading That doesn t mean they are deeply or purposefully social Video games is a young medium If we pick 1961 as the starting point for the video game erathe date that Steve Russell and company created Spacewar at MIT then we ve had the medium in development for 42odd years If we pick 1927 as the birth of television when Milo Farnsworth transmitted the rst TV signals then we can look at what that medium did in its rst four decades of life Some of the highlights include the Love Lucy Show the KennedyNixon debates the creation of PBS and the widespread use of color TV By 1969 they were watching a man walk on the moon The video game medium is past the point where it can excuse any behavior due to its adolescence Critics should not be held at bay while the medium matures While video games have much room to grow and improve it s an exaggeration to call the medium new or emerging Video games are art Video games are not art These claims go together because both confuse artistic expression with the medium Are movies art The question is Is the Godfather art or Is Ace Ventura Pet Detective art It s like asking whether painting is art If you are painting the Mona Lisa sure it s art If you are painting your house maybe not There are some good reasons to blur the line between media and art It helps raise the credibility of the entire medium But in more precise terms media convey expression and emotion ideas and information What is communicated may or may not be artistic Old people play video games Well no the don t I su pose one day the will But assuming the fact that older women playing Bria e online Gillie my motherinlyaw can be generalized into broad statements about the general appeal of games lack a sense of perspective Yes Bridge Bookworm and Bejeweled belong in the nation of video games And both Solitaire and Star Wars Knights of the Old Republic serve a similar purpose by entertaining people sitting in front of their computers So it s natural to want to circumscribe the full range of people touching the electronic entertainment medium and label them the tribe of video game players Still it seems worth considering that my motherinlaw wants to see the same Academy Award nominated lms that I do And whether or not she plays online Bridge does not seem to affect her lack of desire to join me in a round of Halo That s because something about the broader video game medium is simply not appealing to all age groups The eddies of interest by demographics above age 30 are the exception that proves the rule old people don t play Video games Current State of Industry Good games sometimes don t sell Bad games sometimes sell Still no magic formula except Two reasons that games sell 0 Marketing Brands Licensed Incredibles vs internal Warcraft Similar to Film Industry l in 10 titles breaks even or makes money Sequels and franchises are popular EA Sports Sims Star Trek Few selfpublished titles Fewer small developers as development costs go up Money and Games Individual games 1060 for PC 2070 for consoles Game rentals 800M in 1999 Consoles 299 New console introduction 99 Final years Controllers 2040 Graphics cards 80400 PCs Internet subscriptions 1 0 month Business Models Shareholders Stock price Publishers s om game sales Software developers Owned by publisher Bungie Raven Maxis Independent Advance for development charged against future royalties Console developers Proprietary media delivery Lose money on consoles Internet games Initial game amp monthly fee Tool developers Create engines and middleware and sell to game developers Contract services Motion capture art cutscenes audio For the Month of August 2000 Title Units Dollars Share ASP Diablo 2 129300 6677917 The Sims 101405 4303712 MP Roller Coaster Tycoon 67510 1822861 Who Wants To Be A Millionaire 2nd Edition 62110 1137948 MS Age Of Empires II Age of Kings 38446 1649013 MP Roller Coaster Tycoon Corkscrew Follies Expc 34101 658252 Source PC Data Sim City 3000 Unlimited 32518 1202015 Unreal Tournament 28358 682650 Sample 1600 games at 559 Deus Ex 27259 1046490 selling 100 copies in August StarcraftBattlechest Bundle 27215 809757 Who Wants To Be A Millionaire 26274 244894 Sim Mania Pack 25345 447834 revenue MS Age Of Empires II Conquerors Expansion Ac 24196 722817 Return to Krondor 23613 431570 Icewind Dale 21923 1052433 Sim Theme Park 20941 608690 Hoyle Casino 2000 19778 524591 Crystal Key 19079 358984 Scooby Doo Mystery Of The Fun Park Phantom 18979 309879 EverQuest Ruins Of Kunark 18004 704264 There s a lot of money to be had but few seem to get it Therefore the business is ruthless With executives and producers desperately trying to replicate hits and determine the secret formula for Succe SS Like movies there are massive expensive bombs that Were expected to succeed Messiah and surprise hits that cost very little to make and have very little marketing support WarCrafz 70 n 3 r ooo oxolpra 1 game represents 8 of total Top 20 games represent 30 of total revenue Business Model Factors Units forecast vs actual with returns considered Costs of Goods Packaging CDs 0 PC 45 PlayStation 2 34 Advances amp Royalties lSt party hardware manufacturers Sony Sega etc get 700 per unit Developers typically get anywhere from 10 to 40 depending upon track record Licensors Marvel Star Trek etc typically get anywhere from 5 to 15 Product Development 0 PD can run anywhere from 103 OM Programming artwork cut scenes engines sound etc Massive lSt party games like Final Fantasy can be way over 20M Costs of AAA next generation titles expected to double Marketing Marketing budgets can run from 25M TV advertising can cost an additional 2M GampA 0 General and administrative ie management legal HR nance etc Sample Pro t amp Loss Gross Units 583 800 Re turn t0 Net Units 505420 Avg WSP 28 C GROSS REVENUE 21756900 as e NET REVENUE 18731210 COGs Manufacture amp Distribution 1459500 Royalties Gray Matter Studios 2620149 Gray Matter Studios Not Earned Out 614851 d Software 4342005 Total COGs amp Royalties 9036505 48 GROSS PROFIT 9694705 52 OPEX Variable Product Development 125000 Fixed Product Development 927000 Studio Central 236000 Localization 43200 Variable Sales and Marketing 2540429 14 GROSS CONTRIBUTION 5823076 31 Fixed Sales and Marketing 936561 5 G amp A 842904 5 NET PROFIT 4043611 22 Key Issues in Console Success Overall Software Portfolio Number of quality games Number of quality exclusive games Size of installed base Overall Game System Cost 299 is a critical price point for consoles Game Cost Delivery media expected market development costs Game development cost Was a problem with Nintendo 64 PlayStation2 Xbox Gamecube Delivery media Capacity speed cost Cartridge CD DVD Internet Key Issues Technical Hardware Stability Consoles are xed PCs are extremely variable 0 Goal of DirectX is to provide stability Display quality TV vs Monitor vs HDTV Input devices Keyboard game controllers joy sticks steering Wheels revolution Memory systems ROM RAM and hard drives Networking capabilities Local modem cable modem Changing Markets Platform shifts will change the balance of power among developers and publishers The con ict between hardcore gamers and the mass market will continue to increase Addition of completely new markets Cell phonegamepad hybrids The Studio System Vertical Structure Publishers Producer Designer Developers Managers Programmers Artists Testers Distributors Retailers Much like a miniHollywood Publishers Funding Development Manufacturing Marketing PR Distribution Customer Support Publishers assume all the risk they also take most of the pro ts Star developers can often bully publishers because publishers are desperate for content Most developers are at the mercy of the almighty Publisher Publishers Originally grew out of developers Massive consolidation in recent years Most also develop games Greenlighting Most Publishers have a Greenlight Process that they use to determine which projects go forward Because development cycles are so long ll23 years games have to submit to the greenlight committee at five independent stages Concept Assessment Prototype First Playable Alpha At each stage the committee reviews progress decides whether or not to continue funding the project and evaluates the market potential of the product and adjusts unit forecasts and marketing spends accordingly The Producer Projects are assigned by studio management to an Executive Producer Who Will have any number of Producers and Associate Producers working for him or her Producers oversee the production aspects manage Developers toward their milestones and often provide additional resources creative input management advice etc The Developer delivers milestones each month and don t get paid unless the milestones meet strict de nitions Most developers are unlikely to receive any royalties because the funding they receive is an advance against future royalties if their game is not a hit then the Developer may not even be able to pay back the advance Producer External Producer works for publisher Internal Producer project manager project lead director Game s champion to the rest of the company Management s champion to the development team Gets the team What they need In charge of risk management What if derits are late What if engine developer is late with key feature What if key hire cannot be found in time What if AI programming takes longer than scheduled External Producer Have multiple projects Select external developer Contribute to game design based on publishers goals Track milestones Approve payments Handle hardware request Pull the plug Internal Producer Manages development team Work with art and tech lead to staff project Manage project plan Check milestones Make tradeoffs Work with external producer Manage buglist Assistant Producers Manage Assets Data Wrangler make sure latest files are used Supervise the daily build Maintaining the design web site Generate screenshots for PR Review milestones With a group Everything else The music The videos The Game Designer Usually the vision guy Writes the design document with help from level designers tech lead and art lead Must continue to make design decisions during development Sometimes involved in development Mostly at scripting level Keep up on current games I am a designer I think about the game and how it plays I think up the key elements of the game I think of how the gamer Will play the game I am crucial to the success of the game The Developers Design and implement the game including programing art sound effects and music Historically small groups Analogous to book authors Typically work for royalties amp funded by advances 0 Do not have the capital distribution channels or marketing resources to publish their games Very unstable Level Designers I am a manager I help the artists and programmers get their job done I track their tasks I know What they are doing I am crucial to the success of the game Programmers Technical Lead create and manage technical spec de ne interfaces Programmer tasks Rendering Engine AI Physics Tools Database Networking Sound effects Scripting language Special graphic effects Asset management and integration Must have lots of communication I am a programmer I program the game I make the characters interact I write tools for the artists I manage the data in the game I am crucial to the success of the game Distinctive Features of Game Development Must be Willing to rip out features that don t work Designers will create things that you never thought of Game development can require a lot more research and experimentation than some other software development More ideas than time will allow Art Art Lead 0 De ne the style and codify it in a style guide the Bible 0 Hire coordinate manage art assets Concept Artists 0 Early sketches of characters backgrounds storyboards Character Modeling Animation Background Modeling Textures Writer 0 Writes dialog expositions I am an artist I make the art The worlds the textures I use commercial software I talk to programmers about the game I set the mood for the game I am crucial to the success of the game I am an artist I studied classic art I learned about animation I then learned the 3D stuff I am part ofa team Testing Test lead Create testing methodology Provide fast useful feedback to development team Testers Is it fun Game play Is it easy to use Does it make sense Does it work Bugs Cabal Approach Popularized at Valve during HalfLife Organize work by game parts with representatives from every area Interface design art design programming Distributors Originally modeled on book distribution Becoming less important as the retail market changes Retailers Started with mailorder and computer specialty stores Shift in 80 s to game specialty stores especially chains Shift in 90 s to mass market retailers Internet sales big but still not huge Retailers 70 big stores Target Best Buy WalMart 25 specialty game stores 5 Internetmail order Retailers Shift to mass market distribution has resulted in a more hitdriven market Recent years have shown a broadening of the market mostly Via genre shifts Independent Development Stages Develop original design Shop to publishers 1224 month schedule Work by milestones After game published hope people like it The Future of Game Development Development teams will be larger As the technology gets better it can run more code per second so you need more code 0 This is why middleware helps Higher polygon count and higher res textures require more artists to create More memory means more animations Larger teams need more management All these people mean development costs will continue to increase Development Team Size As late as the mid80 s teams as small as one person Teams today ranging from 20100 people Programming now a proportionally smaller part of any project Development Team 1988 Sublogic JET 0 Three Programmers One PartTime Artist One Tester Development Team 1995 Descent SiX Programmers One Artist TWO Level Designers One Sound Designer Offsite Musicians Development Team 2002 AlterEcho Character Modelers amp Animators 3 Executive Producer Producer Programmers 4 2D amp Texture Artist Game Designers 2 Audio D e S i gner Writer i I LevelWorld Designers 3 39 Cmematlc AlVllmatOf QA Lead amp Testers Online Development Teams Star Wars Online Development team 44 people 50 Artists 25 Designers 25 Programmers 3 Producers L lVC Team starting at Beta 6 months before done 8 Developers 5060 Customer support for 200K users 1000 Volunteer staff for 200K users Changing Economics The increasing size and cost of projects Will make it hard for small developers to survive Further consolidation of publishers Will change the types of games produced Globalization affects products Next Trend Episodic Games Traditional monolithic games Modern games take several years and up to 10m to create with 50 hours of gameplay 20 of Halo 2 players haven39t nished the game gt 80 are paying for content they39ll never consume Twice as much content takes 4 times as much resources to develop Enter episodic games Sequel to HalfLife 2 released as a trilogy of shorter episodes each costing 20 instead of the usual 4060 and provides 5 hours of gameplay The Elder Scrolls IV Oblivion has several addons Which can be downloaded online AI for Animation and Combat Based in part on material developed by John McCloskey Jeffrey Miller Amish Prasad Lars Linden Van der Sterren W Reed C and Geisler B and Orkin J AI Game Programming Wisdom vols 1 amp 2 AI Components Animation NPC models built by artists Use tools such as 3D Studio Maxquot or Maya 0 Models are are constructed from bones Bones are connected by articulated joints 0 The skeletal system is covered by a mesh of textured polygons l AI Components Animation 0 Example 3 AI Components Animation 0 Animation sequences are generated by defining how joints should articulate through time 0 Walking sequence AI Components Animation Animation sequences for a model are either 0 Hand generated by a computer animator Recorded from real human or animal movements and applied to a skeletal system motion capture g AI Components Animation 0 Motion Capture Tom Molet EGCAS 96 AI Components Animation Animation sequences tend to be Motion primitives Run Walk Jump Sidestep Climb Transitions StartWak RunToJump JumpLand AI Components Animation Some animation sequences only take control of part of the body waveheo handsignastop swingiceaxe AI Components Animation 0 First step in AI is to select which animation sequence or sequences should be applied to a model Many influences Desired behavior chosen by decision system c What animation is currently playing 0 The current velocity and direction of the NPC The terrain the NPC is standing on AI Components Animation 0 Second step is to parameterize animations Speed up or slow down animation 0 Slow walk fast walk 0 Accelerate decelerate stop and start of run 0 Slow run as approach sharp turn Blend between animations o walktorun o 70 normal walk 30 limp Layer animations 0 Mix handwave on top of walk animation AI Components Animation Next might add selected Joint Control 0 Take control of particular joints Either Ignore joint motion in pregenerated animation Blend with pregenerated joint motion 0 Used for 0 Head Turning Looking at a particular object or location Arm aiming Point gun at a location AI Components Animation 0 And finally add inverse kinematics Algorithmically determine the joint configuration required for an endeffecter hand or foot to reach a particular location 0 Used for 0 Keeping the feet on the ground on uneven terrain or when walking up stairs Reaching hand out to open a door pick up and object Combat Most Challenging Assessing the situation intelligently Spatial reasoning Selecting and executing appropriate tactics Camp Joust Circle of Death Ambush Flee ancl Ambush Perceptual modeling 0 Weapons Combat Combat Spatial Reasoning 3D map geometry is difficult to parse Solution Custom databases Place hints throughout the world 0 Can be errorprone and inefficient Do not handle dynamic obstacles Perceptual Modeling Visual subsystem seeing target 0 Distance to visual stimulus Angle of stimulus relative to field of view Line of sight calculations Auditory subsystem Ensure that the AI can hear objects in the world 0 AI must interpret and prioritize sounds Tactile subsystem o Handles anything the AI can feel 0 Damage notifications and collision notifications Weapon Combat Successful Attack Probability Calculate value to represent the chance to hit generate random number If number is above tohit value try to miss target Factors AI skill Range Size Relative Target Velocity Visibility and Coverage 0 Shoot and Miss Pick a target coordinate outside the body 0 Place shot inside target s field of view i Tactical Analysis Level designers place waypoints in the environment for navigation 0 Node graph contains information of connectivity between nodes for a map Waypoints can also be evaluated for their visibility Information can be used to make tactical decisions I Waypoint Analysis a 6963 00 Enemy Waypoint Analysis 0 Limited CPU time 0 Decisions must be made quickly as few CPU cycles as possible 0 Data must stored efficiently Store visibility data in a bitstring class visibility from node a b V V V V V a V 9 S V E Z I 5 1 0 0 I 1 I 0 1 0 1 1 I 0 0 0 1 I I 011000 Node 1 2 3 4 5 6 1 0 0 1 0 0 0 I 1 0 I 0 00 Enemy a gt GD 6 6b Waypoint Analysis Waypoint Analysis 0 Danger Nodes Determined by OR ing the visibility of all enemy s k nearest nodes j k 0 Safe Nodes V JLJO o Is its inverse Waypoint Analysis DANGER NODES VVaUVb1 0 0 1 I I Nodes 1 4 5 and 6 are dangerous SAFE NODES V011000 Nodes 2 and 3 are safe quot oo Enemy Node 1 2 3 4 5 6 a V1 1 0 0 I 0 0 V2 0 1 1 0 I 0 V3 0 1 I 0 0 0 V4 1 0 0 1 1 1 V5 0 1 0 I I 1 0 V6 0 0 0 I 1 1 Finding aSafe Attack Position 0 While attacking a selected enemy an NPC shouldn t expose itself to its other enemies A good attack position will 0 Provide lineof site LOS to the selected enemy Provide cover from all other enemies Finding a Safe Attack Position 0 To find such locations first find all nodes which have LOS to the selected enemy Call selected enemy a Finding a Safe Attack Position 0 O O O Q 0 8 O NPC 0 0 O Q Selected Enemy 0 O O O 00 Other enemies OOepO Finding a Safe Attack Position Next determine the set of nodes that are visible to all other enemies jk V5 UVjj at a jO g Finding a Safe Attack Position 0 0 0 0 O o 8 O NPC 0 O O Q Selected Enemy 0 O O o 00 Other enemies 0090 Finding aSafe Attack Position The set of good attack positions is the set of nodes with LOS to the enemy intersected with the inverse of the set of nodes with LOS to all other enemies V39a Va I7E g Finding a Safe Attack Position 0 0 0 0 Q 0 8 O NPC O O 0 Selected Enemy 0 T O 0 0 00 Other enemies 0090 Ambush Points 0 Unless cheating is employed NPCs don t have full knowledge of the world 0 May not know where all their enemies are located So 0 Find a good location to wait in for attack 0 Not all positions are created equal Static Waypoint Evaluation To find a good set up position 0 Establish the exposure of all waypoints in a map 0 Process can be done off line before game is even started Static Waypoint Evaluation Static Waypoint Evaluation A good location is one which 0 Has high exposure visibility Easy to locate enemies Easy to establish LOS to attack an enemy Has areas of low exposure nearby Can hide easily a Can run for cover easily g Static Waypoint Evaluation OO O O moooo o 00 O O 00 0 0 DO oooloTa m Pinch Points Observation of human players reveals that experienced players anticipate the actions of their opponents For example if an enemy enters a room with only a single exit an experienced player will wait just outside the exit setting up an ambush Such pinch points can be precalculated by analyzing the node graph Pinch Points To find pinch points For each node N in the node graph with only two neighbors o xe lngorarily eliminate node N from the graph call its neighbors as o If both A amp B are connected to large regions N is not a pinch point try another N Else attempt to find a path between Aamp B If path exists N is not a pinch point try another N Else call the node connected to the larger region 0 for outside And the node connected to the smaller region I for inside Let s do that again stepbystep l Pinch Points o For each node N in the node graph with only two neighbors l Pinch Points o Temporarily eliminate node N from the graph call its neighbors A amp B l Pinch Points o If both A amp B are connected to large regions N is not a pinch point try another N l Pinch Points Else attempt to find a path between Aamp B if exists try another N l Pinch Points o Else call the node connected to the larger region 0 for outside 0 And the node connected to the smaller region I for inside Pinch Points Once a pinch point has been located a good ambush location is one which Has a line of sight to the waypoint outside the pinch location 0 0 Can t be seen from the pinch location N Pinch Points Nodes that have a line of sight to pinch location 0 Can t be seen fro the pinch location N Good ambush ocans is their intersection VP Vo VN Pinch Points Pinch Points Another Example Pinch Points Result Pinch Points Slightly altered version to find pinch points at the end of hallways For each node N in the node graph with only two neighbors o Temporarily eliminate node N from the graph call its neighbors as A amp B o If both A amp B are connected to large regions N is not a pinch point try another N Attempt to find a path between Aamp B o If path exists N is not a pinch point try another N Call the node connected to the larger region 0 for outside Call the node connected to the smaller region I for inside o If 0 has only one other neighbor in addition to N Move N to O Move 0 to the other neighbor of the old 0 Repeat until 0 has more than one neighbors Pinch Points o If 0 only has one other neighbor in addition to N l Pinch Points Move N to 0 Move 0 to other neighbor of old 0 0 Repeat till 0 has more than one neighbors l Pinch Points Move N to 0 move 0 to other neighbor of old 0 0 Repeat till 0 has only one neighbors a Pinch Points 0 Calculate good ambush locations VP Vo VN Pinch Points Pinch Points Final Example l Pinch Points o For each node N in the node graph with only two neighbors l Pinch Points Attempt to find a path between Aamp B o If path exists N is not a pinch point try another N Pinch Points If NPCs organize into squads regions with multiple pinch points can be employed For each node N1 in the node graph with only two neighbors Temporarily eliminate node N1 from the graph call its neighbors as A amp B If A amp B are connected to large regions N1 is not a pinch point try another N Attempt to find a path between AampB While generating the path if a node with only two neighbors is found Temporarily eliminate it and call it N2 Attempt to find a path between AampB If path exists not a pinch point try another N1 Call the nodes connected to the smaller regions I1 and 12 for inside Call the nodes connected to the larger regions 01 and 02 for outside l Pinch Points While generating the path if a node with only two neighbors isfound o Temporarily eliminate it and call it N2 l Pinch Points Attempt to find a path between A amp B o If path exists N1 is not a pinch point try another N1 l Pinch Points Call the nodes connected to the smaller regions 11 and 12 for inside 0 Call the nodes connected to the larger regions 01 and 02 for outside Pinch Points 0 Calculate good ambush locations VPI VOl fzvl VJVZ VPZ V02 I7N1 I7N2 Pinch Points Tactical Analysis Review 0 Using the node graph to evaluate map locations 0 Finding safe and dangerous locations Fining places from which to attack 0 Finding location to set up sniper positions 0 Finding pinch points Embedded Environment 7 Information o The world looks boring when NPCs are just standing around doing nothing until engaged by the player 0 No One Lives Forever 2 uses embedded environment information to keep the NPCs busy pioneered by The Sims 0 Embedded environment information objects tell NPCs how to interact with them NPCs react to objects as they get close 0 Problem unconstraint behavior resulted in unfavorable ones eg an NPC wandering all over the level looking for something to do tasks are done out of order etc Constraining NPC Behavior Added constraints ownership an NPC owns a set of objects NPCs do not try to acquire and interact with objects own by others dependency between objects cannon must be loaded before they can be fired responsibility objects tagged with class of NPC NPCs tethered to regions prioritization aggressive behavior over investigative behavior over relaxed behavior specific over general behavior Embedded Info Animation Sound Embedded info can be used in path finding Node graph is an example embedded environment information 0 embed in path how to jump over crevices or how to open door Soldiers of Fortune 2 illusion of coordination by reserving a path v P 39 Fv iv 113 391 1 5 39 Embedded Info Animation Sound i Team AI behavior can be used with animation and sound to add realism request for cover or order split up choose a different posture or animation from team members a jumping vaulting rapelling based on embedded info Embedding Animation PointA rimming stage mum tags to F a IntC F PomtD Pomt aromas Emergent Behavior and Squad AI Emergent behavior behavior not hardcoded as FSM or decision tree global behavior emerges from interaction of elements with simple local behavior 0 more than the sum of individual behavior 0 Pros more scalable less predictable not scripted Cons unintended behavior local rules hard to de ne Example flocking SquadTeam AI Centralized 0 leader receives info issues order 0 complex maneuvers can be planned and coordinated 0 cannot easily accommodate the strengths and needs of individual members Distributed o squad maneuvers as emergent behavior 0 simple extensions to individual AI 0 robust against members being taken outquot 0 weak at maneuvers requiring tight coordination o examples HalfLife No One Lives Forever 2 Distributed Squad AI Each member publishes state conscious unconscious intention I39m moving to position X y z observation hostile at X y z II Action selection by situation of team mates threats to team own states FireampMove Solo vs Squad SOIOAI wm m mm 005mm I no main I quot EngageHostnle Moveup nvne nu 39 moves to an tar and b I aquot a mam m we on I I V v v39 weem new I huslile a mf manning comma new hssme cwmm 03 below reading new postle SquadAl armed at new pasnom39umom In position x 3939 l no homh munco moving to x EngageHostule lime nuln39nmounm moving no 1 MoveUp tooiw squad matters my an 39039 and announce ln position x mg m rquot K fmu 1 mm 2 1 01quot I9 939 m m quot9 WW I 39 summon moving to x quotx Included new I quot051m arm rlUJU llth comm om J dulmd new huslik Dictate matting new mum mam engaging hogan ExampleSquad Assault Local behavior fireampmove FSM considering Avoidance prevent blocking other team member39s lineof fire Cohesion maintain team cohesion stay within audible range maintain lineof sight to other members Separation spreadout prevent becoming a bunchedup target stay close to cover stay away from enemy39s lineof fire take weapon capabilities into account fireampmove FSM Squad Assault Each member knows its own 0 state 0 position 0 claimed destination position 0 lineof fire and enemy39s 0 last known position and state predicted position and state 0 lineof fire o weapon damage radius 0 squad members engaging this hostile squad members able to observe this hostile Squad Assault Individualizing behavior riflemen move quick and often to close in on the hostile machine gunners are slowed by load deliver support fire from a rather static position and need cover snipers engage enemy from a distance need clear line of fire and good cover wounded or reloading members need cover Problems with Emergent 7 Behavior Conflicts in path and position selections members bumping into each other Solution prioritize member based on time to destination shorter first urgency need for cover strength of weapon blast away No good position within range of search Solution randomly increase range of search added benefits flanking behavior more varied behavior Problems with Emergent Behavior It39s not always obvious what local behavior is needed to achieve certain global behavior eg how to design squad ambush or covering pullback Corollary there could be some unfavorable unintended behavior Centralized Squad Attack Different styles 0 authoritarian orders must be obeyed pro allows for individual suicide mission for the greater goodquot con local details could be overlooked by squad leader coaching each member assigned tasks that they execute to their best ability or not squad member may not have the larger picture to know what39s best for the squad 0 mixed authoritarian with early negative feedback annotate coaching tasks with value ruleof engagement switches between the two based on situation AI in FirstPerson Shooter i Games Quake III Arena Released in 1999 by id Software 0 Designed to be a multiplayer only game 0 The player battles computercontrolled opponents or bots Bots developed by Jan Paul van Waveren Quake III Bot AI FSM based Uses a stack for shortterm goals 0 Use Fuzzy Logic for some decision making 0 Collecting weapons and armor Choosing a weapon for combat Fuzzy Relations were selected using Genetic Algorithms Each bot has a data file containing weapon preferences and behaviorcontrolling variables 1L Bot Network Ball eF gm BamaChase BameRetreat Em ezg em ff f f f Figure 151 AI network g Quake III Bot Navigation 0 AAS Area Awareness System 0 Level is subdivided into convex hulls that contain no obstacles 0 Connections between areas are formed In it i 32quot 39 4 7 LL E Figure 182Jump reachabiiity Figure 18 Emump pad reachabimy i Bot Chatting Deathmatch Not much more than a fun extra TeamPlay Bots can follow orders to defend attack escort Bots will take Team Leader position if player doesnt Team Leader delegates tasks to bots and players Bot Input Bots simulate human input 0 90 degree FOV fog and the invisibility powerup impact vision Bots use sound to detect enemies HalfLife 0 Released by Valve Software in 1998 o Built using the QuakeQuake 2 engines 0 AI uses a schedule driven state machine StoryBased Game HalfLife is a plotdriven game so the AI must further the story NPC s aid player throughout game but are rarely essential Scripted sequences immerse the player in the story and create sense of importance Scripting 0 Scenes are built inside levels using triggers and movement nodes 0 Examples 0 Security guards or scientists give player information about his goals Battles between aliens and Marines Scientist panics and runs into tripmines l Thief 0 Developer Looking Glass 0 Publisher Eidos interactive o Revolutionary Dark Enginequot 0 Based on stealth 0 Released November 11th 1998 iil Dark E nginequot k Lightly scripted game Specifically singleplayer Multistate sense system Decision state machines Centers around the system39s output 39l mn 1 I 439 quotHr I Published Ubi Soft Entertainment Greg Stelmack lead engineer Development Red Storm Entertainment Realistic combat battlefield game Released November 13th 2001 Ghost Recon AI Technique 0 A lot of scripting for individual missions Enemy and team units use FSM s Modifiable hierarchical commands Local navigation and pathfinding causes some hangups sma environmental details