Liquid Enthusiasm

Friday, December 28, 2007

Growing up with code

Whew, I've been sick as a dog for the past couple days. In addition to spreading holiday cheer, someone has also been spreading a moderately nasty virus. But I'm almost recovered, so it's all roses from here until New Years Day. Today is Friday, I haven't been told to come into work on Jan. 1st, my wife and I have fulfilled our family obligations for the moment...ahhh, four-day weekend with nothing to do but some light home improvement.

Speaking of work, let me provide some background on myself. I started my love affair with computers back when I was around 9 years old, in 1989. My father bought a Tandy II at a garage sale and started reading the manual. He is an artist, so naturally he played around with the graphic functions in BASIC. I remember him spending months on a fullscreen animation of a spaceship flying through an asteroid field, using nothing but a series of LINE and CIRCLE commands. I tried BASIC on the Tandy only once that I can recall - the program I wrote was:

10 PRINT "I LOVE YOU"
20 GOTO 10

I remember expecting it to run slowly, maybe one line a second, and was freaked out when lines started streaming up the page. Naturally, I hid under a table until my parents came home. What? Infinite loops are scary!

My next exposure to a computer was in junior high, where I took a computer literacy class over the summer. We didn't do much more than learn to use a mouse and play Mario Teaches Typing, but one of my classmates asked the instructor how people got the computer to do cool things like this. The teacher gave a short but passionate explanation of computer programming, and I decided then that programming is what I would do when I grew up.

In high school I enrolled in "Introduction to Computer Programming", a class which taught BASIC and introduced Pascal over the course of a semester. I picked up BASIC quickly and became the unofficial teacher's aid within a couple of weeks. After a month of playing with BASIC, creating simple text-based games, I started reading our Pascal book - which was actually just the Turbo Pascal user manual. Pascal was a bit rougher than BASIC, especially learning from a reference manual, but I really appreciated the greater expressive power, and it cemented my understanding of functions. The teacher didn't really know the language yet - she was planning on learning as we went - so I was on my own. It took me about a month of playing around with the same sort of text-based games and utilities to make me decide to learn graphics programming. I spent a full week experimenting, working in the lab at lunch and staying for an hour after school, before I worked out how to import the correct modules, set the video mode to display graphics, and draw something on the screen, but it was definitely worth the time and frustration. I churned out about a dozen little games, the most popular of which was a lightcycles clone with some tweaks, including droppable color bombs, black bombs that ate away at barriers, and little sparks that moved at random and erased barriers. It eventually evolved into a 4-player game, but it could be frustrating to play since you had to share a keyboard, and holding down your movement key could prevent the other player from changing direction.

It was my second year in high school before I decided I needed to learn network programming. Unfortunately I had no idea where to start, and ended up going in the wrong direction - instead of learning sockets and TCP/IP, I used shared files over the school network. Over the course of a year, with more lab time stolen during lunch and after school, I implemented a multiplayer text-based game with all communication handled by reading and writing to text files. Crashes occasionally popped up, mostly due to one client trying to read from a file while another was writing, but overall it was a huge success - I was banned from sharing my games because everyone was playing them rather than doing their classwork. Naturally this just drove the game underground, into hidden folders on the network.

Another day I'll go through my experiences in college, work and helping to build a real multiplayer game, but for now it's time to get back to my job.