Layout Image
  • Writing
    • Andy Gavin: Author
    • About my Novels & Writing
    • All Writing Posts
    • The Darkening Dream
      • Buy the Book Online
      • Sample Chapters
      • Reviews
      • Info for Reviewers
      • Press Coverage
      • Awards
      • Cast of Characters
    • Untimed
      • Buy Untimed Online
      • Book Trailer
      • Sample Chapters
      • Reviews
      • Info for Reviewers
      • Press Coverage
      • Awards
      • Cast of Characters
    • Scrivener – Writer’s Word Processor
    • iPad for Writers
    • Naughty Dark Contest
  • Books
    • Book Review Index
    • Favorite Fantasy Novels
    • Andy Gavin: Author
    • The Darkening Dream
      • Buy the Book Online
      • Sample Chapters
      • Short Story: Harvard Divinity
      • Reviews
      • Info for Reviewers
      • Press Coverage
      • Awards
      • Cast of Characters
    • Untimed
      • About the Book
      • Buy Untimed Online
      • Book Trailer
      • Sample Chapters
      • Reviews
      • Info for Reviewers
      • Press Coverage
      • Awards
      • Cast of Characters
    • Naughty Dark Contest
  • Games
    • My Video Game Career
    • Post Archive by Series
    • All Games Posts Inline
    • Making Crash Bandicoot
    • Crash 15th Anniversary Memories
    • World of Warcraft Endgames
    • Getting a Job Designing Video Games
    • Getting a Job Programming Video Games
    • Naughty Dark Contest
  • Movies
    • Movie Review Index
  • Television
    • TV Review Index
    • Buffy the Vampire Slayer
    • A Game of Thrones
  • Food
    • Food Review Index
    • Foodie Club
    • Hedonists
    • LA Sushi Index
    • Eating Italy
    • Eating Croatia
    • Ultimate Pizza
    • ThanksGavin
    • Margarita Mix
    • Foodie Photography
  • Other
    • All Posts, Magazine Style
    • Archive of all Posts
    • Fiction
    • Technology
    • History
    • Anything Else
  • Gallery
  • Bio
  • About
    • About me
    • About my Writing
    • About my Video Games
    • Ask Me Anything
  • Contact

So you want to be a video game programmer? – part 3 – Getting Started

Aug30

…CONTINUED from PART 2. Or start at Part 1.

Some kid is always asking me, “I love video games, how do I learn to program them?”

First of all, a warning. Reaching the skill level to be a professional video games programmer takes years. There are no shortcuts. You can not possibly go from nothing to professional grade skills in less than perhaps 2-3 years — and for that you’d have to be an uber-genius — usually it takes 5-10.

The good news is that you can start very young (8-10 — I started at 10) and you can do it on your own with common equipment and readily available information.

There are two basic approaches: home training and school. And while I personally recommend both, I’m going to use this post to give my own “origin story.” In followups we can apply these lessons to the present (programming itself hasn’t changed all that much in 30 years — there are just more libraries).

[ BTW, if you're new to the blog and wondering who the hell I am in this context, click ]

Rewind to 1979. Some of my favorite things in the world were Dungeons and Dragons and arcade games. I was really too young to actually play D&D accurately, but I loved reading the books and modules (besides my regular diet of fantasy novels). I went to the Apple Store (not actually owned by Apple or nearly as glamourous as they are today — in fact, the owner resembled Gandalf) and saw the game Akalabeth running on an Apple II (not a + or an e, but an old school II). Boy did that set me to dreaming!

Then in 1980 my science teacher brought into class a Heathkit H8 her husband built (yes built). This early computer ran a lousy version of BASIC and possesed the world’s worst storage device: the audio tape drive. Actually punch cards were worse, but with the tape drive, saving your program bordered on impossible (at least for the sharing audio tapes with the rest of the class) and so you had to type it in repeatedly. We were given a single mimeographed sheet of paper with the BASIC commands. I read this a couple times and then wrote out longhand the first draft of a text-based RPG where you wandered around and fought orcs and trolls for gold and tretchure (this is how I spelled treasure at 10). During lunch I typed in and debugged the game, editing my paper copy as needed. I used my friends as beta-testers. It may seem overly ambitious to try and recreate D&D as one’s first program, but it illustrates the programmer principle of: program what you love.

Then my best friend got himself a brand new Apple II+ (just released). This was a slick update of the Apple II. It had a whole 48k, came with BASIC, and was often (but not always) accompanied by a 143k floppy disk drive! Low low price of $900 just for the floppy drive! In any case, the II+ was so much more awesome than the Heathkit. It even had graphics!

So I began pestering my father for an Apple. This took 9-10 months of continuous harassment — the machine was expensive — and all sorts of creative techniques to convince him. I offered to mow the lawn for free. I explained how various accounting software would make balancing his checkbook a breeze, etc. Once I was victorious (Jan 1981) we got the accounting software, but he never used it, leaving me to my own devices on the machine. And I think I kept getting paid for the lawn. Still, this episode illustrates another important programmer principle: persistence.

After the Apple arrived, I spent nearly all of my free time (perhaps 6-8 hours a day) on the thing for years. This is essential. You must offer up blood onto the alter of the programming gods. Principle: sacrifice. I used this time in many ways. I played a lot of games. I used every piece of software. I taught myself to program. I hacked. Principle: market research. But I couldn’t afford as many games as I wanted and in those early years the available library was small, so I was always trying to make my own.

I wrote totally lame versions of nearly every arcade game ever made. In BASIC at first (we’ll get to the issue of environment later). I would generally spend a day or three banging these out until they were marginally playable and then move on to new projects. Lesson here: practice. I chose more and more ambitious games and would use each one to teach me something new. I did this in incremental steps, mostly 1-2 day projects. By way of example, I might upgrade something or I might add a load/save system (requiring learning about I/O). My early games didn’t have much in the way of collision, later ones did. I started with text, then moved up to lores graphics, then highres, then shape tables, then bits of assembly language subroutines for blitting. Principle here: baby steps.

Baby steps are incredibly important. You can’t learn everything there is to know in computers in one shot. Each little area takes multiple projects and days — at least — to learn and master. Take file I/O. I’m sure I got something up and going the first day or two back in the early 80s when I decided to add a load/save system, but I was still learning about file I/O 25 years later on Jak 3 (of course then I was inventing new ways of doing stream I/O, but it was learning nonetheless). Your first pass might work, but often you barely understand any of the principles involved.

You have to start simple, build up blocks, and go from there. That’s why interpreted languages and text programs are a good way to begin. You need to learn about variables, scope, and flow of control before you can jump into 3D graphics. And forget about complex unforgiving environments like C/C++ or assembly to begin with. Those come later and are just one more thing to spend a series of baby steps on. Just learning about makefiles or projects and compile options could stop a novice dead. So don’t — yet. Each task (and thing to learn) should be broken into some chunk that only takes a couple days at most to digest — or at least make some headway on. This leads to a virtuous feedback loop of progress and learning.

I kept writing those lame little games for about 3 years (100s of them). Of all my friends with computers (we all programmed in that era because computers didn’t do much if you didn’t program) my games were the coolest. I used them to invent all sorts of excuses to develop new skills. I wanted to learn about interpreters so I made an engine to allow the creation of text adventure games using a custom scripting language. Once I got this going I upgraded it to graphic adventures, which proved to be a perfect excuse to implement an idea I had seen in the Sierra games where line drawing and fill commands were used to compress images to a fraction of their raw size. On the Apple II a raw graphics screen was 8k. So a floppy only fit 17. A normal compressor (ancestor of zip) might squeeze this to 3-4k but that is still only 30-35 images. This “save the drawing commands” style made them a fraction of that. But for it to work I not only had to create the “renderer” (including an assembly fill routine) but I also a whole “paint program” to allow the recording/creation of these proprietary images.

However, each of these sub-steps resulted in satisfying progress on its own. Principle: chunking. For example that fill routine. It took several days, and my mastery of recursion in assembly wasn’t the best so it left little corners unfilled, but it was cool in of itself. My first fill routine (in BASIC) took 5 minutes to do a fill, and the assembly one only a second or two. Plus, I was to keep using it in all sorts of programs for years (with improvements). Principle: reuse. Building on the tools you make is essential to programming.

In 1982, I met Jason Rubin. He also programmed. He was an amazing (by the standards of the time and our age) artist and his games LOOKED REALLY COOL. But they crashed a lot. Mine rarely did. From the beginning I hated crashing. Still can’t tolerate it. I have trouble leaving the keyboard if a crash bug is still outstanding. Principle: perfectionism. My programs also did much cooler “programming” stuff. They just didn’t look cool. When we combined our talents, things really took off! Our games now looked cool AND ran decently. Impressive stuff. Lesson: partnership. Not everyone can be good at every aspect of computers. Nor even of programming itself.

CONTINUED with Part 4 – School!

_

Parts of this series are: [Why, The Specs, Getting Started, School, Method]

If you liked this post, follow me at:

My novels: The Darkening Dream and Untimed
or the
video game post depot
or win Crash & Jak giveaways!

Latest hot post: WOW Endgame Analysis!

Related posts:

  1. So you want to be a video game programmer? – part 2 – Specs
  2. So you want to be a video game programmer? – part 1 – Why
  3. How do I get a job designing video games?
  4. Matsuhisa – Where it all started
  5. Making Crash Bandicoot – GOOL – part 9
By: agavin
Comments (20)
Posted in: Games, Technology
Tagged as: Andy Gavin, Apple, Apple II, Apple II series, Apple Store, BASIC, Computer Programming, Dungeons & Dragons, Floppy disk, Game programming, Heathkit, Origins, Programming, pt_career_advice, Steve Jobs
  • Pingback: So you want to be a video game programmer? – part 2 – Specs « All Things Andy Gavin

  • Pingback: So you want to be a video game programmer? – part 1 – Why « All Things Andy Gavin

  • http://twitter.com/GabrielIslas4 Gabriel Islas (@GabrielIslas4)

    Assembly? That’s hardcore. I haven’t even fully retained the concept of binary code, and with all these other languages out there, it’s really hard to try at times.

    And if hacking falls under market research, then I guess it’s not as malicious as most people would think. :D

    Thanks again. :)

    • http://mascherato.wordpress.com agavin

      There was no network. I got a modem early (in 1984!). Before then hacking was modifying other peoples software (often to remove the copy protection). But I no longer condone that (except as a learning exercise). I’ve bought 100% of the (commercial) software I’ve used since around 1989.

    • http://mascherato.wordpress.com agavin

      Also assembly wasn’t as hardcore back then (it still was). The Apple II had a microassembler and dissembler built into the ROM. The manual for the 6502 and for assembly programming came in the box with the computer. The machine only had about 230 instructions when you include all the addressing mode combinations. Without that it might have been 30-40. There were only a handful of registers and no caches, no pipelines. It was much easier to learn.

      • http://twitter.com/GabrielIslas4 Gabriel Islas (@GabrielIslas4)

        That’s interesting. I had no idea that assembly went through any change at all. I learn something new every day. So did it actually change as the functionality of computers progressed?

      • http://mascherato.wordpress.com agavin

        Assembly is processor specific. So, given that new processors have been coming out steadily for 40 years, it does keep changing. Now, there are architecture families, in that modern Intel assembly is descended from 8088 assembly, but there are vast new features. Each family: ARM, PowerPC, Intel, MIPS, etc has it’s own architecture. Each variant chip it’s own specifics. That being said, they are all fairly similar in principle. Mostly instructions move data from one register to another, or apply ALU/FPU operations. For example (add r1,r2,r3) might add the contents of r2 to r3 and put it in r1. The semantics of this vary a lot, but the basic concept of arithmetic operations is pretty consistent. Other things like branching, memory management, etc are a little more varied, and there are the complexities of advanced floating point and vector units.

  • http://www.facebook.com/profile.php?id=100000326384070 Troy Adam

    I love hearing about the Heathkit H8. It has a kind of “In MY day…” to it that makes me smile. My father worked for RCA and in 1978 he taught me to program a really simple Lunar Lander game into his RCA Cosmac VIP. This picture spells it out pretty well: http://elblogdemanu.com/wordpress/wp-content/uploads/2008/02/CosmacVip.jpg

    • http://mascherato.wordpress.com agavin

      Lunar lander was one of my many “arcade ripoff” self programming jobs. In fact, I remember I used it to learn about shape tables (an obscure pseudo-sprite functionality in Applesoft BASIC). STs were so slow that the frame rate might have been 1 frame a second. Maybe 2-3. LOL.

  • http://twitter.com/Bunkerbewohner1 Mathias Kahl (@Bunkerbewohner1)

    Great article series, can’t wait for the next part! :D

  • Pingback: So you want to be a video game programmer? – part 4 – School « All Things Andy Gavin

  • Pingback: So you want to be a video game programmer? – part 5 – The Method « All Things Andy Gavin

  • Pingback: Ready Player One « All Things Andy Gavin

  • Pingback: Lispings ala John McCarthy « All Things Andy Gavin

  • http://usb3gvn.com USB 3G

    Oh thanks, i appriciate that!

  • Pingback: So you want to be a video game programmer? – part 5 – The Method :: All Things Andy Gavin

  • Pingback: Book Review: Steve Jobs :: All Things Andy Gavin

  • Pingback: Andy Gavin Talks Crash Bandicoot, Naughty Dog, and The Darkening Dream

  • Havok

    “We all programmed in that era because computers didn’t
    do much if you didn’t program”

    I am of the opinion that your generation is very fortunate
    in this regard.

    My generation (not excluding my younger, less jaded self),
    ironically deemed, “The entitlement generation (Gen Y),” really didn’t have
    this opportunity to learn. It seems counterintuitive, because we had a
    developed internet, and a wealth of information. However, we were handed the
    products of your generation. Unlike your circumstance in which you needed to
    create things you wanted, many people from my generation did not think twice
    about programming – Why bother when there’s something better right here, at the
    store, or at a friend’s house? This would
    be similar to you, in your beginning programming days, wanting a punch card
    computer T_T.

    I think it’s a shame, because as a kid, I played the best
    games possible, or so I thought. The depth of development didn’t allow me to
    make the connection that I could take this game and make it even more awesome. I
    think if I had the open interaction with programming that you did, it would be
    different. However, as capitalism requires it to be, we (Gen Y) were forced upon
    finished, unyielding products.

    I am aware that many young go-getters did make the effort ~14
    years ago (when I was young – Shit I’m getting old) to seek how to program (the
    infamous script-kiddie lol), but I cannot help but wonder how many of them, and
    non-programmers like myself, envy your generation for fundamental, maddeningly pure
    knowledge. In your case, you were given a box. This box takes words, and
    creates magic. My generation, you were given a box. You input an expensive disk
    into said box. Then it creates magic until better magic comes along.

    Commenting a bit on the next section—I entered college with
    the intention of becoming an astrophysicist. A freshman class, computer science
    102, pretty much set that dream on fire. It was C++. I found it interesting
    that you said that was a bad place to start learning. Makes me feel a little
    better :P

    • http://all-things-andy-gavin.com Andy Gavin

      Although just because C++ isn’t the easiest place to learn programming doesn’t mean that it isn’t perfectly possible. Lots of people learned to program with C. It just doesn’t encourage rapid experimentation.

Andy Gavin

1

Co-creator of Crash Bandicoot and author of The Darkening Dream and Untimed

Watch the Trailer or

Buy it Online!

Buy it Online!

24 of 100 tickets!

Find Andy at:

Follow Me on Pinterest

Facebook Subscribe:

Follow on Twitter:

Follow @asgavin

More on games:

  • All Game Posts
  • Making Crash Bandicoot
  • Crash 15th Anniversary
  • WOW Endgames
  • Designing Video Games
  • Programming Video Games

Categories

  • Contests (7)
  • Fiction (308)
    • Books (97)
    • Movies (57)
    • Television (71)
    • Writing (105)
      • Darkening Dream (59)
      • Untimed (32)
  • Food (369)
  • Games (72)
  • History (10)
  • Technology (21)
  • Uncategorized (14)

Recent Posts

  • More Crash for Charity
  • PS2 Memory Lane
  • The Last of Us - Red Band
  • Crash Valentines
  • The Last of Us - Zombie Time
  • WOW Endgames - Mists of Pandaria
  • Crash Live Action Tribute
  • Game Shop Crash
  • WOW Endgames - Cataclysm
  • World of Warcraft 8th Anniversary

Popular Posts

  • The Hobbit Trailer
  • Making Crash Bandicoot - part 1
  • Home
  • Game of Thrones - Season 2 - First Look
  • Diablo 3 - Beta Preview
  • Crash goes to Japan - part 1
  • WOW Endgames - Vanilla
  • WOW Endgames - Mists of Pandaria
  • Sons of Anarchy

Recent Comments

Archives

  • May 2013 (12)
  • April 2013 (14)
  • March 2013 (15)
  • February 2013 (14)
  • January 2013 (13)
  • December 2012 (14)
  • November 2012 (16)
  • October 2012 (13)
  • September 2012 (14)
  • August 2012 (16)
  • July 2012 (12)
  • June 2012 (16)
  • May 2012 (21)
  • April 2012 (18)
  • March 2012 (20)
  • February 2012 (23)
  • January 2012 (31)
  • December 2011 (35)
  • November 2011 (33)
  • October 2011 (32)
  • September 2011 (29)
  • August 2011 (35)
  • July 2011 (33)
  • June 2011 (25)
  • May 2011 (31)
  • April 2011 (30)
  • March 2011 (34)
  • February 2011 (31)
  • January 2011 (33)
  • December 2010 (33)
  • November 2010 (39)
  • October 2010 (26)
All Things Andy Gavin
Copyright © 2013 All Rights Reserved
Programmed by Andy Gavin