{"id":47906,"date":"2019-09-05T06:00:16","date_gmt":"2019-09-05T10:00:16","guid":{"rendered":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=47906"},"modified":"2019-09-05T07:41:29","modified_gmt":"2019-09-05T11:41:29","slug":"jai-part-2-the-four-challenges-of-game-development","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=47906","title":{"rendered":"Game Programming Vexations Part 2: The Four Challenges of Game Development"},"content":{"rendered":"<p>So why do we need a new language for games? Isn&#8217;t the world full of languages at this point? Is it really true that in all the dozens of active languages out there, none of them is suitable for making video games?<\/p>\n<p>A year ago <a href=\"https:\/\/www.youtube.com\/watch?v=De0Am_QcZiQ&amp;t=55s\">Blow gave a talk<\/a> where he said he didn&#8217;t want to use any of the extant languages because they contribute to an ongoing &#8220;general insanity&#8221; going on in software development. It&#8217;s a long and multi-faceted argument, but if I had to boil it down to a soundbite I&#8217;d say that there&#8217;s a general desire to hide the hardware away behind abstractions and this is making our software slow.<\/p>\n<p>I&#8217;m not qualified to support or refute that argument, so if you think Blow is wrong then you&#8217;ll have to take it up with him. I&#8217;m going to come at the argument from a different angle&#8230;<\/p>\n<p><!--more--><\/p>\n<h3>Invading Another Language<\/h3>\n<p><div class='imagefull'><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/stock_space_invaders.jpg' width=100% alt='Nice language you&apos;ve got here. We&apos;ve just got ten thousand teeny tiny little requests before we switch to it.' title='Nice language you&apos;ve got here. We&apos;ve just got ten thousand teeny tiny little requests before we switch to it.'\/><\/div><div class='mouseover-alt'>Nice language you&apos;ve got here. We&apos;ve just got ten thousand teeny tiny little requests before we switch to it.<\/div><\/p>\n<p>Personally, it seems like it would be a bad idea to co-opt the likes of Go, Rust, or D for game development. If you look, you can see these languages are &#8220;<a href=\"http:\/\/arewegameyet.com\/\">nearly<\/a>&#8221; ready for game development. To date, nobody has shipped a serious<span class='snote' title='1'>Reminder: By &#8220;serious&#8221; I mean a proper 3D simulation and not something programmatically trivial like a side-scroller.<\/span> game in any of these languages<span class='snote' title='2'>We do have commercial 3D games made with Unity, and thus C#. But for the most part I think everyone gets why C# isn&#8217;t a viable alternative for AAA game development.<\/span>. Which means the tools aren&#8217;t there. Which means the main adherents of these languages are not game developers. At the same time, there must be a reason that game developers haven&#8217;t already embraced these languages. We have to allow for the possibility that these alternate languages are missing some features that game developers are likely to need.<\/p>\n<p>Switching over to an extant language and changing it to suit the needs of game development would be significantly more controversial than just starting your own language. Maybe the C++ refugees would be welcomed with open arms at first, but as soon as they began demanding changes or complaining about limitations it would cause rifts. Maybe the language would be forked, or maybe a bunch of features would be added that existing users don&#8217;t like or need. Or maybe the incoming game developers would need to cajole and plead for every feature. If the only C++ refugee was Jon Blow all by his lonesome, the community would probably tell him to go make his own damn language if this one doesn&#8217;t suit him.<\/p>\n<p><strong>Shamus, what are you talking about? What are these special features game developers supposedly need? A general programming language is suitable for general tasks, and that includes games! What is it you think you&#8217;ll need?<\/strong><\/p>\n<p>I&#8217;ll come back to this question later in the series. For now just humor me.<\/p>\n<p>I realize I have to be really careful here, because suggesting that language X isn&#8217;t suitable to a given task will quickly rally all the supporters of X against you. Everyone will feel the need to defend the honor of their favorite language. They will gather to inform you that actually, X is FANTASTIC and you&#8217;re just bad at using it and maybe you should do some research before running your mouth. If you claim that NO extant language is suitable, then you&#8217;ll find yourself at war with the adherents of every language simultaneously.<\/p>\n<p>This really does put the game developer in a &#8220;damned if you do, damned if you don&#8217;t, and damned if you compromise&#8221; type situation. If you ask for language features to suit the problem you&#8217;re trying to solve, then people will just accuse you of being ignorant or entitled. If you go off to make your own language, people will accuse you of being a naive fool. If you stick with what you&#8217;ve got, then people will accuse you of being stuck in the past. Your only escape is to pick a language, pay the high cost of transitioning, and then fall in line behind the faithful.<\/p>\n<div class=\"script\">INT &#8211; Video Game Industry &#8211; Day<\/p>\n<p>Game Developer: Man, this job is a drag. I wish there was an alternative to C++.<\/p>\n<p>Foo Evangelist: You should try the Foo language! It&#8217;s amazing.<\/p>\n<p>Game Developer: I don&#8217;t think this new Foo language will do what I need.<\/p>\n<p>Foo Apologist: You can&#8217;t criticize Foo! You don&#8217;t know anything about it.<\/p>\n<p>Game Developer: Okay, I&#8217;ve just spent half a year learning the language, adapting libraries, and attempting to build a game. Foo really doesn&#8217;t have feature X, and I need it.<\/p>\n<p>Foo Grognard: X is a stupid feature. I&#8217;ve been making web and mobile apps for a decade and I&#8217;ve never needed <b>anything<\/b> like that. We don&#8217;t need to clutter up the language with obscure features for lazy game developers. Go use C++ if you want those kinds of weird-ass features.<\/div>\n<p>Rather than try to convince you that alternative languages are insufficient, I&#8217;m going to try to sell you on the more general idea that &#8211; all other things being equal &#8211; a language devised specifically for games would be better than any of those other choices.<\/p>\n<p>With that in mind, I want to talk about what I think are the four main challenges of games programming:<\/p>\n<h3>1. State Transformation<\/h3>\n<p><div class='imagefull'><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/splash_transformers.jpg' width=100% alt='' title=''\/><\/div><div class='mouseover-alt'><\/div><\/p>\n<p>All programs change the state of the machine. As a result of running the program and entering input, internal variables change, new data is written to disk, the contents of the screen are changed, and data is broadcast over the network where it will cause further state changes on other machines. If there was a program that didn&#8217;t cause state changes, then there would be no point in running it because it would, by definition, do nothing. However, I think games really do face some unique problems with regard to the frequency, intensity, and variety of the state changes. Not only do games change a lot of state very quickly, but the types of transformations and the causes of those transformations are incredibly complex.<\/p>\n<p>In a game you can have situations where the player shoots a gun that fires a bullet that hits a barrel that triggers an explosion that generates a physics event that knocks over a physics object that lands on a mook and kills them, which results in spawning loot that lands within the player&#8217;s pickup radius and is added to their inventory. A single input action caused a state change for seven different objects spanning multiple gameplay systems.<\/p>\n<p>Even worse, it&#8217;s not a linear chain reaction like the previous paragraph suggested. The state changes actually branch outward as they cascade through the system. The explosion also spawned a particle emitter, which will in turn spawn particles. The death of the mook will lead to a new mook being spawned sometime in the next few seconds, somewhere nearby. Shooting the gun creates sound effects, creates more particles, and updates the state of the gun itself to deal with the reduced ammo count and kick. Information on the player&#8217;s HUD is changed. Damage floaties will spawn at the location of the mook&#8217;s former head. Other AI actors in the area will change behavior. The player earns experience. The physics event shoves a bunch of small objects around, which creates even more particles as the debris kick up dust. That single pull of the trigger expands outward, touching countless gameplay systems and eventually altering many megabytes of memory.<\/p>\n<p>Not only are the changes myriad and complex, the causes for those changes are also complex. State changes in response to player input, AI behavior, the rules of the simulation, and information coming over the network. This is one of the reasons AAA game devs shy away from<span class='snote' title='3'>Or openly despise and denounce.<\/span> strict Object Oriented Programming. OOP encourages you to wall off all of your different objects. A bank transaction should not be able to change the name of the customer, and so on.<\/p>\n<p><div class='imagefull'><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/stock_explosion.jpg' width=100% alt='Pictured: Some state transformation.' title='Pictured: Some state transformation.'\/><\/div><div class='mouseover-alt'>Pictured: Some state transformation.<\/div><\/p>\n<p>But in a game where all of the different systems are tightly connected and interact in complex ways, you can&#8217;t treat each system like a black box and consider it in isolation.<\/p>\n<p>In strict OOP, systems that interfere with the ideal of encapsulation<span class='snote' title='4'>Sealing one chunk of code off from other systems.<\/span> are referred to as <a href=\"https:\/\/en.wikipedia.org\/wiki\/Cross-cutting_concern\">cross-cutting concerns<\/a>. The problem is that modern game design pushes us towards situations where nearly <b>everything<\/b> is a cross-cutting concern.<\/p>\n<p>In a game, that dumpster is actually 3 different conceptual systems: There&#8217;s the model that needs to be rendered, there&#8217;s the collision hull that makes it run into things, and there&#8217;s the physics object that gets knocked around (and knocks other things around) once the shooting starts. All three of these things are very different, they&#8217;re used at different times and in different places by different systems, and they need to be packed in memory with similar objects for efficient processing. If your collision hulls are mixed in with other types of game objects in a big generic list of random crap, then doing batch operations on those objects will be expensive.<\/p>\n<p>Somewhere in the chaos, you look at the data and notice that the mook&#8217;s body is a million meters outside of the bounds of the gameworld and you have no idea where to look to find the cause of the problem. Literally any of these systems might have caused a change or a side-effect that altered the position of the mook in ways you can&#8217;t think of just now. Debugging becomes very difficult. Bugs are hard to reproduce and harder still to track down.<\/p>\n<p><div class='imagefull'><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/borderlands2_combat1.jpg' width=100% alt='Here&apos;s another picture of state transformation in action.' title='Here&apos;s another picture of state transformation in action.'\/><\/div><div class='mouseover-alt'>Here&apos;s another picture of state transformation in action.<\/div><\/p>\n<p>Yes, other programming domains have lots of state change. In accounting a single transaction will take some money from one account, add it to another account, and record the transactions in many different places. I&#8217;ll bet the error-checking and handshaking between financial computing systems is monstrously fussy and it always has to contend with the <a href=\"https:\/\/www.youtube.com\/watch?v=IP-rGJKSZ3s\">Two Generals Problem<\/a>. There&#8217;s a lot of state change, but it follows fairly predictable lines. Every state change is an explicit part of the spec. You&#8217;re not going to have a weird edge-case deposit that changes the customer&#8217;s first name, issues a new credit card to everyone over 18, and modifies the street address of the bank.<\/p>\n<p>In gaming, having emergent state change is considered a bonus. &#8220;Oh look. I broke this wall which released water which put out a fire, even though that wasn&#8217;t a specifically coded or scripted event. Cool!&#8221; In just about any other domain, non-spec interactions are a serious bug!<\/p>\n<p>Mass state change is almost a design imperative in the world of games. Designers are always pushing for more complexity, more interactivity between systems, and more reaction to player input. We want fires to burn things, flowing water to displace things, light to illuminate things, wind to shove things, and explosions to destroy things. Characters should push foliage out of the way, leave footprints, trigger sound effects, make sounds, stir up dust, interact with objects in the environment like chairs and doors, and exert force on physics objects. As we work toward making our simulations more interesting, we make them increasingly interconnected and unwieldy. This makes it challenging to keep the program running fast. It also makes bugs more likely, and makes them harder to find when they show up.<\/p>\n<h3>2. Performance Always Matters<\/h3>\n<p><div class='imagefull'><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/stock_performance.jpg' width=100% alt='*nonsensical engine-revving noises*' title='*nonsensical engine-revving noises*'\/><\/div><div class='mouseover-alt'>*nonsensical engine-revving noises*<\/div><\/p>\n<p>Video games are not the only domain where performance matters, but games are rather unique in the sheer complexity of their performance needs.<\/p>\n<p>Sure, every programmer wants their code to run fast, but in games the user will experience performance fluctuations in realtime. They can both see and feel dropped frames. That 16ms stutter will be infuriating and uncomfortable to a gamer trying to line up a headshot, while (say) a video editor will just accept the occasional stutter as part of the job. A Pixar-style render farm needs speed, but if there&#8217;s an optimization that occasionally stalls all rendering for half a second in order to speed up the overall job, then that&#8217;s totally acceptable in the world of offline<span class='snote' title='5'>In this context, &#8220;offline rendering&#8221; just means &#8220;not realtime&#8221;. Like, you start the render process and then go have lunch.<\/span> rendering. Photoshop needs to run its filters as fast as possible, but the vast majority of the time has the program sitting idle and waiting for user input. It&#8217;s completely acceptable for the interface to momentarily stutter<span class='snote' title='6'>Or even go unresponsive for multiple consecutive seconds!<\/span> when the user applies a complex filter to a large image. But games don&#8217;t just need to be fast, they need to be <b>consistently<\/b> fast. They need to be fast across multiple types of processors running vastly different simulations. Productivity software can get away with exhibiting mildly annoying interface hiccups that would be called egregious and unplayable in a video game.<\/p>\n<p>Remember that I&#8217;m not saying that games programming is harder or that game programmers have it tougher. Other fields have their challenges, but not many of them have this <b>particular<\/b> challenge where performance needs to be both high <strong>and<\/strong> uniform. I&#8217;m not saying mountain climbing is harder than cross-country skiing, I&#8217;m saying mountain climbers will have problems that skiers don&#8217;t. Skiers probably have their own unique problems. If so, they&#8217;re free to come up with their own programming language to deal with them.<\/p>\n<p>I think I lost the plot on that last analogy. Whatever. You get the idea.<\/p>\n<p><div class='imagefull'><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/marvel_thanos.jpg' width=100% alt='There aren&apos;t enough rendering resources to go around, so I decided to MAKE MORE RESOURCES.' title='There aren&apos;t enough rendering resources to go around, so I decided to MAKE MORE RESOURCES.'\/><\/div><div class='mouseover-alt'>There aren&apos;t enough rendering resources to go around, so I decided to MAKE MORE RESOURCES.<\/div><\/p>\n<p>This problem isn&#8217;t going to go away. If you put on the infinity gauntlet and snapped your fingers to make every processor ten times faster, game designers would instantly find a use for all of that power and we&#8217;d once again be up against performance limits. We already have technologies sitting around, waiting until we have enough spare power to support them:<\/p>\n<ul>\n<li>Raytracing.<\/li>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=ureGelZPi3o\">Real-time fluid dynamics<\/a> that integrates with physics so a designer can dump a megaliter of water into a space and let the deluge push stuff around and create structural failures without needing to cheat with pre-scripted behavior.<\/li>\n<li>More particles, bodies, and debris so the game doesn&#8217;t need to constantly tidy up loose bits and clear up smoke.<\/li>\n<li>Turn more of the environment over to physics objects that can be broken and destroyed.<\/li>\n<li>More ambient NPCs moving around to make the world feel more alive<span class='snote' title='7'>Hitman does REALLY well with this, but I imagine the team has to put in a lot of work to make the huge crowds possible. If we had more power, it would be easier to pull this off and more game designers would want to use it.<\/span>.<\/li>\n<\/ul>\n<p>Performance always matters, so therefore we&#8217;re always going to need a language that allows us to do low-level optimizations that would be seen as unreasonable in most other domains.<\/p>\n<h3>3. CPU + GPU<\/h3>\n<p><div class='imagefull'><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/tdi_opengl.jpg' width=100% alt='Yes, this is recycled from my most recent video. Look, just don&apos;t say anything and nobody will notice.' title='Yes, this is recycled from my most recent video. Look, just don&apos;t say anything and nobody will notice.'\/><\/div><div class='mouseover-alt'>Yes, this is recycled from my most recent video. Look, just don&apos;t say anything and nobody will notice.<\/div><\/p>\n<p>It&#8217;s been a while since I did a Terrible Car Analogy\u2122, so let&#8217;s do one of those.<\/p>\n<p>Imagine you&#8217;re driving a box truck. In the back you&#8217;ve got a load of sound effects, physics events, and gameplay updates. These need to be delivered to a warehouse on the other side of the country. You&#8217;re navigating a complex interchange between three different roads and trying to make sure you&#8217;re always in the proper lane. You&#8217;re trundling along with your load of data and everything is going good.<\/p>\n<p>However, you&#8217;ve only got half the shipment. The other half is the graphics rendering. That&#8217;s being delivered by a different vehicle. This vehicle is monumentally faster than your humble box truck. It drives at hypersonic speeds. Maybe it&#8217;s bright green and says NVIDIA on the side. It&#8217;s so fast that if this was a real car and not a terrible metaphor, the front end of the car would create a compression zone that would surround the car in plasma, like a spaceship going through re-entry. It would also probably kill everyone it passed, which would be basically everything on or near the road.<\/p>\n<p>You can&#8217;t control this other car directly, and instead you have to use the driver helpfully provided by Nvidia. You have a one-way radio that you can use to give directions. The driver doesn&#8217;t understand your native language, but Nvidia has a phrasebook of stuff the driver understands.<\/p>\n<p><div class='imagefull'><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/stock_driving.jpg' width=100% alt='Supposedly you should use the newest drivers to avoid crashes, but frankly I don&apos;t feel safe with them until they&apos;re over 20.' title='Supposedly you should use the newest drivers to avoid crashes, but frankly I don&apos;t feel safe with them until they&apos;re over 20.'\/><\/div><div class='mouseover-alt'>Supposedly you should use the newest drivers to avoid crashes, but frankly I don&apos;t feel safe with them until they&apos;re over 20.<\/div><\/p>\n<p>The rocket car is insanely fast, but it&#8217;s also limited. It can&#8217;t use toll roads, it can&#8217;t handle making left-hand turns, and it doesn&#8217;t understand stop signs. The designers never intended it to go through roundabouts. You can do it, but you&#8217;ll lose all your speed advantage because the car will loop through the roundabout 200 times before proceeding with the route. Likewise, it can&#8217;t really handle stop signs properly so it always stops for 5 full minutes before proceeding through the intersection. You can&#8217;t really see where the rocket car is or track it directly, so you have to shout your directions over the radio and hope for the best. If it doesn&#8217;t show up on time, it&#8217;s very hard to figure out what went wrong or where it wound up.<\/p>\n<p>Your goal is to get your box truck and the rocket car to the same location using different routes, and the delivery isn&#8217;t complete until you both get there. When you do, you&#8217;re done rendering the frame and you can get started delivering the next one.<\/p>\n<p>The routes are always changing, and just when you feel like you&#8217;ve got a handle on things you get a new rocket-car driver with a slightly different skill set and new ways of misinterpreting your directions.<\/p>\n<p>There&#8217;s a lot wrong with this analogy. In fact, it&#8217;s mostly random horseshit. This isn&#8217;t what graphics programming is like at all. However, the two scenarios are similar in levels of intensity and insanity. This isn&#8217;t what it&#8217;s like to write a rendering engine, but this is what it <b>feels like<\/b>.<\/p>\n<p>The graphics hardware is ridiculously fast, but also sort of limited and difficult to use. It&#8217;s very easy to slip up and waste a lot of the available power.<\/p>\n<p><strong>Shamus, the vast majority of programmers don&#8217;t need to interface with the hardware like this. Most of us use graphics engines or game engines provided by someone else, and those other programmers have solved a lot of problems for us.<\/strong> <\/p>\n<p>It&#8217;s true! A lot of problems are indeed solved. Mostly. But I&#8217;ve never heard of a AAA game that was able to use a general game engine right out of the box. Every time I listen to a GDC talk from a programmer, at some point they&#8217;ll allude to all the work they had to do customizing the engine to suit their game. Maybe the engine doesn&#8217;t support open-world gameplay, or streaming content, or procgen environments, or realtime modifications to level geometry, or some other thing. if you&#8217;re doing anything <strong>remotely<\/strong> unconventional with your rendering then you&#8217;ll probably need to crawl down into the guts of the rendering pipeline and make changes. That puts you on that crazy road trip with the NVIDIA rocket car, so you&#8217;d better know what you&#8217;re doing beforehand. <\/p>\n<p><table class='nomargin' cellspacing='0' width='100%' cellpadding='0' align='center' border='0'><tr><td><iframe loading=\"lazy\" width=\"1024\" height=\"576\" src=\"https:\/\/www.youtube.com\/embed\/VcWRc1wK3gM\" frameborder=\"0\" allowfullscreen class=\"embed\"><\/iframe><br\/><small><a href='http:\/\/www.youtube.com\/watch?v=VcWRc1wK3gM'>Link (YouTube)<\/a><\/small><\/td><\/tr><\/table><\/p>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=VcWRc1wK3gM\">John Carmack once claimed<\/a> that rocket science was &#8220;simple&#8221; compared to graphics programming. He even had the audacity to say this to a bunch of NASA engineers. And to be clear: He might be the only living person to have done both of these things professionally.<\/p>\n<p>Because of this dance between the various bits of hardware, even a small bottleneck can lead to serious performance costs. Despite the massive gains we&#8217;ve made in raw processing power over the years, we still haven&#8217;t reached the point where we can afford to sacrifice a few extra cycles in exchange for making life easier for our poor programmers.<\/p>\n<p>You could argue that maybe we should stop pushing the hardware and just settle for the graphics of yesteryear, which would give us 90% of the visuals for a fraction of the computing cost. That&#8217;s a worthwhile idea to explore, but now we&#8217;re talking less about a technology problem and more about a business \/ cultural problem: <i>How do we convince the suits to stop wasting so much time and money chasing graphical fidelity?<\/i> I mean, if we can&#8217;t even disabuse them of <a href=\"?p=38251\">obviously stupid ideas<\/a>, then what are the odds we can change their minds on less obvious ones like this? The people signing paychecks want <a href=\"https:\/\/www.youtube.com\/watch?v=2AemwglmJxw\">MOAR GRAFIX<\/a>, and that&#8217;s the reality engineers are living in.<\/p>\n<p>Even if the industry did somehow lose interest in chasing the shiniest pixels, I&#8217;m not sure it would help. VR is forever hungry for framerate and consumers really do want 60FPS. Moreover, console makers are always trying to limit the cost of their machines. If we started asking less from our hardware, then Sony and Microsoft would probably be less aggressive about stuffing their gaming machines full of power in order to cut costs<span class='snote' title='8'>Either to lose less money on each unit sold, or so they could lower the retail price to undercut their rival.<\/span>. In that case, we&#8217;d be right up against the wall again &#8211; we&#8217;d have just barely enough power to do what we need and CPU cycles would still be precious.<\/p>\n<h3>4. Design Through Programming<\/h3>\n<p><div class='imagefull'><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/witness1.jpg' width=100% alt='The Witness. There are a lot of features in this game that wouldn&apos;t be supported by standard AAA engines. By necessity, idiosyncratic games will require some custom engine work to bring them to market. Which means you can&apos;t just treat a game engine like a black box and the leave &apos;engine work&apos; to experts.' title='The Witness. There are a lot of features in this game that wouldn&apos;t be supported by standard AAA engines. By necessity, idiosyncratic games will require some custom engine work to bring them to market. Which means you can&apos;t just treat a game engine like a black box and the leave &apos;engine work&apos; to experts.'\/><\/div><div class='mouseover-alt'>The Witness. There are a lot of features in this game that wouldn&apos;t be supported by standard AAA engines. By necessity, idiosyncratic games will require some custom engine work to bring them to market. Which means you can&apos;t just treat a game engine like a black box and the leave &apos;engine work&apos; to experts.<\/div><\/p>\n<p>A bank is going to start with an incredibly detailed and rigorous specification, and the project involves turning that inflexible spec into code. No financial system is going to set their engineers loose with a directive like, &#8220;Just play around a bit and see what design gives the most correct results.&#8221; In many fields, you know <b>exactly<\/b> what you want before you write your first line of code.<\/p>\n<p>In video games the spec is more fluid and open to changes in response to playtesting. Jon Blow refers to this as &#8220;Design through programming&#8221;, which is a common approach when your lead designer and lead programmer are the same person.<\/p>\n<p>Obviously this varies by genre and studio. If a game is following a well-understood design pattern like &#8220;Cinematic first person shooter&#8221; then the spec will probably be fairly stable. On the other hand if you&#8217;re doing something weird and unconventional like <a href=\"https:\/\/www.youtube.com\/watch?v=TluRVBhmf8w\">Portal<\/a>, <a href=\"https:\/\/www.youtube.com\/watch?v=9EfiilXN6S8\">Miegakure<\/a>, <a href=\"https:\/\/www.youtube.com\/watch?v=Z5II-uyYmHQ\">Manifold Garden<\/a>, <a href=\"https:\/\/www.youtube.com\/watch?v=wMGaMOyr0GI\">Gravity Rush<\/a>, and <a href=\"https:\/\/www.youtube.com\/watch?v=aGsnm2nOnso\">Antichamber<\/a>, then there is no firm spec. You have to experiment to see what&#8217;s possible and what&#8217;s fun. Likewise if you&#8217;re making something full of complex interacting systems like <a href=\"https:\/\/en.wikipedia.org\/wiki\/Dishonored\">Dishonored<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Prey_(2017_video_game)\">Prey 2017<\/a> or <a href=\"https:\/\/en.wikipedia.org\/wiki\/Deus_Ex\">Deus Ex<\/a>, then you&#8217;re probably going to have to iterate a lot to get all the systems working in harmony.<\/p>\n<p>In either case, if you&#8217;re trying to design a game during the process of building it, then refactoring code becomes a major concern. You thought you&#8217;d only have a couple of bad guys in the scene at a time when you started, but now that the gameplay is taking shape you realize you need dozens. The animators really made a lot of fantastic animations and blending those all together is expensive, so now you have performance problems you couldn&#8217;t have foreseen at the start.<\/p>\n<h3>5. Extra Bonus Challenge<\/h3>\n<p><div class='imagefull'><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/stock_computers.jpg' width=100% alt='You wanted the hardware specs? Here. These are the hardware specs.' title='You wanted the hardware specs? Here. These are the hardware specs.'\/><\/div><div class='mouseover-alt'>You wanted the hardware specs? Here. These are the hardware specs.<\/div><\/p>\n<p>I know I only said there were four challenges but I wanted to sneak this one in. It&#8217;s a sort of extra layer of challenge on top of all the others that you need to do all that crap using whatever random, cobbled-together heaps of parts people have sitting on their desks. There are hundreds of oh-so-slightly different variants of graphics cards, several generations of chipsets with different features, many different processors with different numbers of cores, different memory pools and different versions of Windows devouring some portion of all those resources. Some people overclock, other people don&#8217;t have all the latest updates, and everyone has different usability needs.<\/p>\n<p>Also, did I mention the consoles? They&#8217;re more like PCs than they&#8217;ve ever been before, but they&#8217;ve still got a lot of unique quirks you&#8217;ll need to account for.<\/p>\n<p>It&#8217;s true that this particular challenge faces <strong>anyone<\/strong> making desktop apps, but it all becomes that much more complex when you combine it with the other four challenges above.<\/p>\n<h3>Good Luck!<\/h3>\n<p><table class='nomargin' cellspacing='0' width='100%' cellpadding='0' align='center' border='0'><tr><td><iframe loading=\"lazy\" width=\"1024\" height=\"576\" src=\"https:\/\/www.youtube.com\/embed\/HluANRwPyNo\" frameborder=\"0\" allowfullscreen class=\"embed\"><\/iframe><br\/><small><a href='http:\/\/www.youtube.com\/watch?v=HluANRwPyNo'>Link (YouTube)<\/a><\/small><\/td><\/tr><\/table><\/p>\n<p>So this is the challenge of game development: We need to make programs that handle tons of complicated state change, we need them to run consistently fast, we need to do so using the complex and tightly constrained framework that exists between the CPU and the graphics hardware, we need to do it in a situation where the spec is fluid and refactoring is common, and we need to get it running on most of the endless permutations of consumer-grade hardware. These aren&#8217;t the only challenges of game programming, but I think these are the big ones. These four-ish challenges are interconnected and they tend to exacerbate each other. These things are so important and so universal that I think it could make sense to devise a language specifically to help with these problems.<\/p>\n<p>Again, I&#8217;m not promising that Jai is going to magically make everything better. I&#8217;m just saying that I find it plausible that this particular collection of problems could be better solved using a language specifically designed for the job.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So why do we need a new language for games? Isn&#8217;t the world full of languages at this point? Is it really true that in all the dozens of active languages out there, none of them is suitable for making video games? A year ago Blow gave a talk where he said he didn&#8217;t want [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66],"tags":[],"class_list":["post-47906","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/47906","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=47906"}],"version-history":[{"count":31,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/47906\/revisions"}],"predecessor-version":[{"id":47952,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/47906\/revisions\/47952"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=47906"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=47906"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=47906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}