Game Development Journal Part II: Thinking Like a Computer

One of the first challenges I had to overcome during the process of game design was learning to think like a computer does.  A game designer’s job is to write the instructions that generate and govern the world of their game. However, these instructions must be written in a form that the computer understands.

Note that this description is over-simplified in order to make this process accessible to non-gamers and non-programmers.

The computer monitors the state of the game world by constantly running checks on every object within that world.  So long as an item remains undisturbed (the player does not interact with the object), it will continue to behave according to default instructions.  On the other hand, interacting with an object will trip a “switch” which, when detected by the ongoing scans run by the computer, will trigger a new behavior.  For example, let’s say I’ve programmed a door that will remain shut until the player walks up to it and presses the action button to interact with it.  I want the door to play a creaky sound effect and then open, allowing the player to pass through into a new room.

In order to create this basic structure, I will begin by crafting a door object that is closed and un-passable when its switch is set to “OFF.”  The computer will continually check the door and, so long as the switch remains OFF, the door will remain unchanged.

At this point, the door cannot be anything BUT OFF, so the door will remain closed forever.

To enable the player to interact with the door, I will need to write a short program that will tell the computer what to do when the player walks up to it and pushes the action button.  The first thing I need to do is make it so this interaction turns the door’s switch from OFF to ON.  Next I need to tell the computer what to do when it detects this change.  I program the door to make the sound effect and replace the closed door graphic with an open door graphic (which the player may walk through to gain access to the next area).

As is, this is a one-time event.  There is nothing to tell the computer what to do if I were to press the action button a second time.  The door will open once and then remain open forever.  If I want the player to be able to close the door behind them, I need to write a second program that only runs when the switch is set to ON.  This program tells the computer that, when the door switch is in the ON position AND a player presses the action button next to the door, a second sound effect will play (that of a door clicking shut) and the open door icon will be replaced with the original closed door icon once again.  I then tell the computer that, on this second button press, the switch should return to the OFF position.  Now the door will open and close as many times as I like, switching back and forth between two possible states: closed and open or ON and OFF.

As a practitioner of the digital humanities, I think it is very important to not only use digital technologies to further our inquiries in humanities fields but also to critique those same technologies and the ideologies that birthed them (and that they help to further).  As I learn to think like a computer, I am struck by the themes of surveillance and quantification/categorization that Foucault identified as central to governance in modern society.  Computers are disciplinary tools, even when they are creating worlds of play.  It will be difficult, I think, to develop a digital game that revels in the spaces in between categories, that thinks outside of binaries and resists easy definitions.


One thought on “Game Development Journal Part II: Thinking Like a Computer

  1. Pingback: Game Development Journal Part VI: The Troll’s Nest | Megan Condis

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s