How Pitfall Builds its World
December 23, 2022 12:31 AM   Subscribe

Jack Evoniuk reverse-engineers and explains, "I'm surprised that, as far as I can tell, I'm the first to detail how exactly Pitfall! rendered its world, but I'm also kind of disappointed. If you haven't seen this GDC talk about preserving the history of games you absolutely should. Unlike many other disciplines the history of software is not being well preserved, even though it should be the easiest to preserve. We have the original source code for basically zero games for the Atari, NES, SNES, ColecoVision, you name it. Disassemblies are invaluable, don't get me wrong, but they're not the original. And they show nothing about the original comments."
posted by cgc373 (16 comments total) 25 users marked this as a favorite
 
I know next to nothing about programming computers, but I spent many an afternoon playing Pitfall as well as many other Atari / Activision / Apple II+ games in the early 1980s, and even I know how amazing it was for these programmers to overcome the now unthinkably small amounts of memory available. The constraint sparked some incredible work, and even though I have no real notion of what it all means, this breakdown is clearly a paean to extreme elegance.
posted by chavenet at 1:46 AM on December 23, 2022 [2 favorites]


as far as I can tell, I'm the first to detail how exactly Pitfall! rendered its world

It's described in Racing The Beam, a great technological dive into how the Atari VCS 2600 was programmed and the techniques used in its code. This was a primitive device designed in 1976 to put Pong and Combat on your TV and absolutely nothing else, yet somehow a cult of dedicated lunatics managed to coax it into running full-fledged computer games for years.
posted by Harvey Kilobit at 3:25 AM on December 23, 2022 [12 favorites]


You may also enjoy James Hague’s Halcyon Days, a series of interviews with other classic video game programmers (which I just realized is now 25 years old!)
posted by mubba at 5:34 AM on December 23, 2022


My family had a 2600 when I was a kid, and when I was little games like Pong and Combat (tanks, barriers, bouncing bullets, please) seemed amazing--just being able to control what was on the tv was enough to blow my mind.

We still had it when the NES came out, and seeing the thing that played Pong play Space Shuttle and Pitfall II was a whole other thing.

(Also, the best first-party 2600 game is Warlords, and the best 2600 game ever is Megamania. I will not be taking questions.)
posted by box at 6:54 AM on December 23, 2022 [5 favorites]


The history of computing is of special interest to me so thank you for this. Tight limitations have always induced creativity in programmers and reading about elegant code has always spurred me on to work harder on my own, although in the modern age with essentially unlimited RAM, storage, and CPU cycles, I don't have to get quite as creative as any of the old masters.

For anyone that wants to delve deeper into this realm of study, I recommend the following:

Game Engine Black Book: Wolfenstein 3D by Fabien Sanglard: a very well researched and explained look into how the Wolfenstein 3D engine works. It goes to some lengths to try and explain things in ways non-programmers will understand so even if you're not a programmer, if you have enough interest in the subject this is an interesting read. John Carmack (the guy that created the game engines for Wolfenstein 3D, Doom, Quake, etc) managed to get computers to do things they really weren't designed to on multiple occasions, so I consider his work to be of particular interest.

ZZT by Anna Anthropy not so much about programming as it is about a community of people inspired to make games by the freeware game ZZT, which included an editor for players to make their own maps. With a quite limited set of tools, a community of largely teenage bedroom programmers and game developers created a wealth of interesting games and software toys. Anna Anthropy was part of this community and in this book documents the lives and creations of some of its most interesting players.

GameHut this YouTuber was a game developer for Traveler's Tales, a studio that made many well-known 90s console games. The author of these videos was behind many interesting programming feats on consoles like the Super Nintendo, Sega Genesis, and Sega Saturn. In his videos he explains, step by step, how he wrote the code to accomplish many things thought impossible for these consoles at the time.

Behind the Code by Displaced Gamers a YouTube series in which "DG" disassembles the code of various console games and explains in exhaustive detail what the code is doing. It's a more technical series, so this one might be more for folks that have coded before, but one of the things I like about it is he will show you how to use the debugging and memory editing features of emulators to hack things into games as they run. Sometimes to illustrate concepts, sometimes just for the sheer fun of it.

Lastly, if any of these sound interesting, I urge you to check out Preserving Worlds. This is a web series that is mostly available on YouTube (if you want to see everything you'll have to subscribe to Means.tv) and is about the player communities that have made efforts to preserve games and to continue enjoying them even after the companies that made and supported them have left them behind. This is a little off-theme since it isn't really about code, but I think there's enough thematic overlap that it's worth linking.
posted by signsofrain at 7:00 AM on December 23, 2022 [7 favorites]


This was a primitive device designed in 1976 to put Pong and Combat on your TV and absolutely nothing else, yet somehow a cult of dedicated lunatics managed to coax it into running full-fledged computer games for years.

I was watching a video awhile back that pointed out that the 2600 was intended to last 2-3 years on the market and support 25-30 games, because that's what consoles were like then, and it ended up dominating the market until 1984 and supporting, depending on how you do the count, somewhere between 500-900 games, and somehow didn't actually end production until 19 fucking 92. They were just completely unprepared.
posted by Pope Guilty at 7:20 AM on December 23, 2022 [5 favorites]


the best 2600 game ever is Megamania

Do you want to know how I can tell you never played Escape from the Mindmaster?
posted by GCU Sweet and Full of Grace at 7:27 AM on December 23, 2022


Is there a resource somewhere about how the different versions of the 6502 relate to each other? I gather that the 6507 in the 2600 is cut-down in some ways from the 6502 in the Apple 2 / C64, but it always seemed wild that they had kinda the same chip. Unless they're different enough to be not kinda the same chip.
posted by GCU Sweet and Full of Grace at 7:29 AM on December 23, 2022


The Wikipedia page on the 6502 has a nice summary of the variants without going into unnecessary detail.

The main difference of the 6507 is a slight cost reduction. Smaller package and pins, which meant less inputs and a smaller range of addressable RAM.
posted by JoeZydeco at 8:54 AM on December 23, 2022


Fascinating, thanks! I’be been a game developer for 20 odd years and while memory management and performance and storage size are still pressing concerns, and always will be, most likely, it doesn’t require quite the same bananas level of attention to squishing everything in. It is still terrifyingly easy to bring a computer to its knees with thousands of objects interacting, though, so the old tricks still come in handy surprisingly often.
posted by Jon Mitchell at 9:38 AM on December 23, 2022


I am reminded always of the way NES Metroid designed its levels. You know that avant-garde musical track that just sort of beeps and bloops and provides echoey ambiance like the sounds of the Nostromo idling? Yeah, that's the data they use for the placement of stuff in the various corridors. And you know how there's always those doors that make the screen pause and then you go through? That's flipping between whether the music defines a vertical or horizontal room, and what kind of enemies are triggered by which beeps.

It was a FAR more elaborate and comfortable platform than the ones Pitfall was built for, and the game could have packed big ROMs on the card and bank-switched if they were willing to spend the money, but they re-used the same bytestream three times each and it worked!
posted by rum-soaked space hobo at 9:52 AM on December 23, 2022 [8 favorites]


I think John Aycock's Retrogame Archeology may have explained the Pitfall! encoding scheme in some detail, maybe not as much as this blog post though.
posted by credulous at 10:10 AM on December 23, 2022


LFSRs and polynomial counters are all over the place in the 2600. The TIA (graphics) chip uses them to count just about everything that has a horizontal position, which is kind of weird. Wouldn't you just use a binary counter and compare the binary number to the sprite's X coordinate? Apparently not, and to understand why you'd have to dig deep into NMOS and how things were done in 1975, and perhaps to fully understand you would have to have touched a sheet of Rubylith.
posted by credulous at 10:30 AM on December 23, 2022


Some years ago, I got into playing the VCS/2600 games of my youth emulated on Stella, which led me to make my own simple game as a fun side project. When I realized how wonderful Stella was as a development and debugging environment, I started going through the old ROM library to "reverse engineer" how the classic games achieved the effects they did. As others have noted, the hardware is very much tailored to running games like Pong and Combat, so pretty much every other game is doing some amount of dark magic, but Pitfall is truly on another level. I got nowhere near understanding how the rooms themselves were encoded, because the screen painting routine by itself blew my mind so thoroughly. How David Crane was able to design this game, much less implement and test it without a proper debugger, is truly beyond me. There are implementation gems hidden away in these old games that I hope the curious will continue discover for years to come.
posted by angrynerd at 2:06 PM on December 23, 2022 [3 favorites]


Rubylith, a talismanic neologism to be sure. To touch and know. Sheets and planes. Sorry, the early days of PCs and video games are so weirdly romantic and magical to me. But then I’m a weird dude. The Wikipedia picture of the Intel guys over a sheet of worked Rubylith is, like, powerfully dorky. Dorky but powerful. Almost ominous, somehow.
posted by Don.Kinsayder at 7:43 PM on December 23, 2022 [1 favorite]


I wonder if there even IS any original programming to decompile?

Even programs written in assembly usually have a version that is more illuminating that the assembled machine code. Like, there will be comments, and you can make and name subroutines etc. It's not uncommon to have comments that describe:
* the name and purpose of each subroutine
* the arguments of the subroutine - name and purpose
* descriptions of all the data sections
* and heavy commenting on the lines of code themselves

As a 30 year programming veteran assembly is one of the few languages that I think really requires comments
posted by RustyBrooks at 1:48 PM on December 24, 2022


« Older Stop Talking to Each Other and Start Buying Things...   |   Now Shady, now Sasha, now Riley and Toby ... Newer »


This thread has been archived and is closed to new comments