In this post, we contemplate the important issue of brains. Certainly a great many of us believe in our hearts that we have brains (isn't that odd?). Of course, for some there is a question. When we say "he has no brains at all," the statement is most likely untrue. He breathes, he exhibits coordinated muscular control, he responds to stimuli. In point of fact, there is fairly good empirical evidence that he does have a brain, regardless of the imbecilic quality of his mutterings.
The arcade game we are building will require a "brain" of sorts also. This brain will keep track of and move the player through the various "states" of game play: not started, coin deposited, number of players selected, game started / timer started, [challenge presented (pop up target, return ball, etc.), event occurred (ball in hole, target hit, etc.), score incremented], time ended, game ended, tickets dispensed. The states between the [ ] are usually done many times in a loop until some trigger occurs: the time is up or a score is reached or a predetermined number of "shots" has been taken.
There has been quite an evolution over the past 50 years in arcade game brains. We have a few early (1940-ish) games that are purely mechanical. These rely on analog clock-like mechanisms that advance over time through the states of game play. These are usually absolutely immutable. One cannot add or change anything about how they work without physically grinding new gears or mechanical cams. Later games (1960s-70s) used simple electronic elements: switches pushed by circular motorized cams and connected to dozens of relays to implement game state. Just like the mechanical games, the game play of these "switch logic" games was built into the game at manufacture, determined by what wires were connected to what relays and is nearly impossible to alter. Later games (1980s on) were made with primitive computer brains. These were usually implemented by custom, special-purpose electronic Printed Circuit Boards (PCBs). They often had an early microprocessor, programmed by game companies via the Read Only Memory (ROM) chips present on the board. The advantage here is that by changing the programming in the ROM, a company could change easily the rules of the game (how one moves from state to state). Many of these games were built on a standard wiring harness so that simply by changing the main PCB, one could even have an entirely different game. Arcade games are still made this way. Game companies have their own proprietary board sets, so repairs and upgrades need to be done through the manufacturer. Unfortunately, their products still do me no good in the present endeavor as they are made for their own specific games and they do not allow users like me to re-program them.
Instead, I am taking what might be termed as a Maker approach to this game brain. The do-it-yourself (DIY) community over the past decade has been kind enough to make modern, powerful, general-purpose, computing accessible to anybody with a modicum of curiosity and a hundred spare dollars. This began with the advent of the Arduino microprocessor board, which has been a gigantic boon to the simple gadget builder. More recently however, an even more powerful class of full-up, network-capable, single-board computers such as the Raspberry PI and BeagleBone has made it possible to build highly sophisticated, even web-connected devices. I have used a few of these now in some of my inventions and have settled on the R-Pi (shown in the photo) as my present favorite for its ease of set-up and programming. If you are looking to dabble in any of these, I highly recommend getting one of the starter kits from the nice people at Adafruit. The units by themselves are typically under $50 but for double that, the kits gives you everything you need to build up your first gadget (power supplies, cables, starter components, etc.).
For our application, the most important consideration is input/output or I/O. Our game will need inputs to its brain from the coin mechanism to tell it the patron has paid for example. It will need outputs from the brain to run the motors that make the two men climb their rods. Scores must be displayed, bells must be rung and light must flash. All of these things will require the brain computer to interface to the outside world by one or more of its I/O pins. The latest model (B+) of the R-Pi has 40 pin General Purpose I/O pins which I believe will be enough to do everything I need for this particular game. I also purchased a nice extender cable (called a cobbler, lower part of the photo) that will let me connect the R-Pi GPIO pins to a board of my own design where I will have more room to put various connectors and other necessary interface electronics.
Now then, if I can only recall where I left my soldering iron....
-Otto
No comments:
Post a Comment