
.jpg)
“There are always going to be parts that are unplanned, and stepping back to coherently organize code means time spent not writing new code, building new features, or doing art,” Gage says.īut for all the eyebrow-raising that VVVVVV has sparked on social media, Cavanagh still seems to have a good sense of humor about all of it. Obviously, developers should care about game-breaking bugs, or anything that gets in the way of a player’s enjoyment of the experience, but as they say, perfect is the enemy of good. Gage is intimately familiar with this sort of thinking - he tells Polygon that looking back on hit game Ridiculous Fishing, he “literally no idea how that code works because it’s so poorly written.” Even other members on the team don’t fully understand how their game works.Īnd you know what? Ridiculous Fishing still won awards and made nearly a million dollars in a few months. “Instead of ever stepping back to organize it, Terry just decided something like, ‘Hey, I’m going to just keep adding on states into this gigantic switch statement as I encounter the need to have them.’ Which is totally 100% normal, and basically crucial for shipping a game.” But instead, he opted to go forward and do what he could, making one monstrous portion of the code handle hundreds of disparate possibilities. If Cavanagh was trying to code something immaculate, he might have stopped to change how he was putting it together so that it was organized better. Zach Gage, who has worked on mobile games such as Pocket-Run Pool and Really Bad Chess, broke the infamous switch statement down for Polygon by stating that it is “the perfect example of something Terry probably didn’t know about when he started writing the game: how many cutscenes there would be, how the main menu would work, and how many weird potential end states of strange modes there might be.” Source: /jLznUpyBE7- Randy Olson January 11, 2020 The video game "VVVVVV" went #OpenSource today and someone discovered a several-hundred-case switch statement in the code.

As a random example, Cavanagh appears to have dozens of game states referring to cutscenes sprinkled among parts of the code that are also about things like gameplay modes and the main menu. Normally, many of these states might be grouped separately - the mini-game portions written in a different area than say, a jump mechanic - but not in this case. Basically, it’s something that helps decide what state a game is in, whether that’s a cutscene or a piece of dialogue.

In this case, there’s a particular portion of the VVVVVV source code that is sparking discussion due to its sheer messiness. Open source code like this makes it clear that you can successfully ship without that level of perfection.” “I know many developers get bent out of shape trying to make their code perfect. “Games aren’t just an ordinary piece of software, they are a complex beast that require many different disciplines to successfully ship, and often on timelines that require sacrifices to be made,” said game developer James Simpson in an email. Nearly every game developer I’ve ever spoken to says the same thing. “Almost every single game I’ve worked on has shipped at the exact moment that the bits of spit and prayer holding the whole edifice together are on the *brink* of collapse,” wrote game developer James Patton, in a Twitter discussion about game code. There’s a word for games where the code is barely hanging together, with stupid layout, utterly unscaleable fixes and workarounds on top of workarounds. Time and time again, development stories of video games reveal that, because video games have so many different moving parts, from game design to sound, that things often don’t come together until the last possible second - if they come together at all. There’s this misconception that coding is by nature elegant and sophisticated, because after all, it’s kind of like writing logic, isn’t it? Don’t they call it computer SCIENCE for a reason? But the reality is much more complicated than that. Cavanagh maybe foresaw this - in his blog post announcing the release, he admits, “ VVVVVV is not a technically sophisticated game! Even by the standards of self taught indie devs, it’s kind of a mess.” Some of the response to VVVVVV’s source code has been horror, as onlookers pick apart things that could have been written better. This isn’t the sort of thing that happens often, and by that metric alone, the value of releasing this information is immense. In layman’s terms, this means that the average person can now look at how the game is built, because every line of code can be perused. Last week, Dicey Dungeons creator Terry Cavanagh celebrated the 10th anniversary of an earlier game, VVVVVV, by releasing its source code to the public.
