Growing up I always dreamed of making a computer game.. My brother and I coded from scratch a DOS version of Nintendo’s Metroid back in the late 80’s … (This is back when you had to create your own sprite handling algorithms!) Once BBS’s became popular we found some graphics libraries, and we ported it to use them. Then we ported it to Linux (Slackware, anyone?), then to BeOS.. Eventually we went off to different colleges and never had much more to show for it than a scrolling Samus in a single room (but on at least three different OS platforms!).. Unfortunately all of that hard work was lost several hard drive crashes ago. Recently I was able to find an early Pascal version, and using the brilliance of DOSBox I was able to play it enough to make the following video.. Enjoy!
The Next Generation
Now, when my time is consumed by work and family, my own game time is quite limited (playing or making). But I have this “next generation” growing up right under my nose! What do I do with this opportunity? I don’t want to push my dreams onto them; but would they be interested in making a game? If so, where do I start? Games today are so much more complicated (and unnecessarily 3D, but that’s a whole different conversation).. Would an old text adventure be “good enough?”
The Plan: Keep it Simple
So here’s the plan. Teach and learn with my kids how to make a game. I have several nefarious plans brewing in the back of my mind to use this as an opportunity to teach them programming, engineering methods, and state machines. We’ll see what happens. First and foremost is the basis of any good game — creative writing.
Creative Writing as Engineering Skills?
Creative Writing is a actually a really neat way to introduce and develop engineering skills.. Don’t believe me? Try this on for size:
- Write a (very) short story. Keep it simple and short.. maybe going to get the mail from your mailbox.
- Break the story into pieces; leaving the garage, turning down the driveway, hopping over the broken concrete due to the tree roots in the yard, getting to the mailbox, opening the mailbox.
- Using some extremely simple tools referenced on this site and elsewhere, turn your story into Interactive Fiction (IF). Each piece of your story becomes a block of IF.
- Connect each block of IF (each piece of your story) together in the right order; leaving the garage comes first, followed by turning down the driveway, and so forth.
- Play your new game a couple times and marvel in your brilliance!
Interactive Fiction and Engineering
There are several things we take away from the above exercise; first, Interactive Fiction can be a HUGE stepping stone to programming, and even engineering. How? Let’s think about it:
- You took a concept, in this case a story, and created something from nothing.
- You extended the concept with additional details to make the story complete.
- You broke up the story into smaller, manageable pieces.
- You implemented each smaller piece until the whole story was created.
- You connected the pieces together in a specific way so the story made sense.
Now let’s compare this creative writing process to the both software programming and the larger engineering process:
- You take a concept, maybe a new cell phone idea, maybe a new lawnmower idea.
- You extend your concept with additional details to make the concept more complete (maybe some details about what’s new in your cell phone or how your new lawnmower makes mowing lawns easier or better or faster or cheaper or more enjoyable).
- You break up the story of your cell phone or your lawnmower into smaller, manageable pieces (for a lawnmower, maybe the engine, the wheels, the gas tank, the seat, the frame, etc).
- You implement each of the small pieces so they work; they do their part.
- You connect all the small pieces together so that the new product is made.
Interactive Fiction and State Machines
The second thing we can take from the above exercise is that each block of Interactive Fiction serves to fulfill a very specific task- just like a state machine within many fields of engineering. A state machine is simply a way to break up a complete task or job into smaller more manageable pieces. Some state machines have only two states, some have dozens, some have hundreds. Each state does some very specific function based on input information.
Within Interactive Fiction, each IF block serves to describe a particular place (the garage, the driveway, next to the tree roots, the mailbox, etc), and what happens within that IF block, or that piece of the story, determines what happens next. Maybe at the tree roots, you give the reader a choice, and turn your simple story into a more complex Choose Your Own Adventure story! Now the user gets to provide some input into the story, and the tree roots IF block, or state, makes a decision based on where the user wants to go next. This is just like a state machine too! Information comes into the current state and that information influences what happens next — where the story goes, what state comes next.
Wow! Interactive Fiction teaches not only the concepts of engineering but also programming and state machines!
I’ll be documenting this journey, blog-style. I hope you enjoy reading, and if you embark on such a journey, please, above all else — keep it fun!
Signup below for email notifications of updates to my teaching-stem blog!