pinball

Pinball!

This post goes into details of how a (mini) pinball game was conceptualized, designed and prototyped. It is not the size of a regular pinball table but is rather a tabletop pinball game. One of the key differences from other such projects is that this build utilizes standard sensors and actuators for game play and does not rely on actual pinball parts at all. The game utilizes multiple sensors, motors and is interactive. Game stats are communicated via an LCD screen and speaker. The whole game is driven by a single Arduino Mega 2560 R3. I had created this for my 11 year son and luckily it became hugely popular among his friends (and also some grown-ups!).

Conceptualization:

The game idea primarily came into existence after we were thinking of building a more complex project together. I personally find pinball addictive and the gameplay is exciting. Right from the outset we decided that it will not be the normal size table due to storage space and budget constraints. We need something that could be dismantled and packed up for storage, taking minimal space. Our first concept was simply on a whiteboard mostly designed by my son with some help. Here it is:

Post this initial working idea, we immediately shifted to an A4 sized paper for further detailing and trying to build a rough blueprint towards making the 1st prototype.

Design:

After a few paper designs we felt confident we had enough cohesive elements to start a little more advanced prototyping. We decided to make it with as simple materials as we could, allowing for fast iterations but at the same time give us a decent idea of game play experience. The result was this:

The whole thing had been held together by hot glue, nails/screws (rebound rubber) and children’s clay dough. The intent was to build something that can be ‘played’ so as to get a good idea of key game mechanics like:

A quick guide to the game elements:

The primary game objective is to score as many points as possible until either time runs out or you run out if balls to play.

Coming back to the prototype board above, once we started playing with it for a couple of days, we learnt quite a few things:

2nd Prototype:

With these learning’s, we were confident that we could eventually proceed with building the 2nd prototype. The intent for this was to have everything the final board would have including live elements, live scoring and game play. It would also have the LCD and speakers. But before that, we needed to:

The vibration sensors are the 18010p which have both digital and analog outs. The sensor basically registers a hit to itself and provides an output. The digital out threshold is controlled via an on board potentiometer while the analog out feeds out raw hit data. While the circuit for this is pretty simple, we needed to figure out if the hits to the target were registered properly. The image below shows the sensor placed inside a tower target for testing.

This setup worked OK and the sensitivity was decent enough for hits to be registered on the tower from most directions. However, we figured that the tower placement on the board was problematic as it interfered with the ball flow. Also the shape of the tower made it a little difficult to register hits from acute angles. So, we decided to forgo this tower and instead keep box shaped targets flush with the top boundary wall (as can be seen in the later versions).

For the flippers, the prototype uses nails / screws and Lego parts. We could not, obviously use these in the final version so we designed a flipper with ice cream sticks glued together and used a dremel to drill anchoring holes. The anchor would be a screw while the flex mechanism would be via tension springs. The spring would be attached to the flipper via another screw. The other end of the spring would be attached to a screw driven through the game board. See image below. Apologies for the quality of the photo but I hope you can make out the arrangements. Note the rest of the board of the 2nd prototype. This is start of the prototype which would do everything that the final board would. Also note that in the final board, the flipper design was changed and only one spring was used for each as there was a change to the dimensions of the flipper.

The plunger design was made using a 25 ml syringe. The piston was anchored to the board and the player would depress the syringe and let go to launch the ball. The syringe contains a compression spring inside it.

This completes familiarizing ourselves with the unknown components and we went on to build out the full game board for the 2nd prototype. Here is the design for it:

To understand what electronic components were used, here is another image overlaying only the electronic components on top of the above image:

At this point it would be good to take a detour into the game logic. We have all the mechanical and electronic elements in place and now need to form rules for the game play. Here they are:

Also,

Before we actually delve into the game logic here is the 2nd prototype image

Here is the same image without annotations, for an uncluttered look:

Do excuse the rat’s nest of wires as it’s a prototype! While it looks rickety, it played well enough to finalize the design. Everything worked as expected, more or less, and some learning’s that were found in the 1st prototype applied here too.

Game program logic:

The full source code is available here but the logic flow is explained here via a flowchart.

The main loop (method GameLoop() in the code):

There is a lot of other code too and the Setup() method is the one calling that other code. It should be more or less easy to understand but drop me a note if you need something clarified.

Final prototype:

Based on all of the above, the final version was created and is shown here. A video of the game play follows below that.

Video - TBD

As can be seen, some placements have been changed and a clear theme is present. Based on my son’s preferences, we decided on a Batman theme. The targets (backed by vibration sensors) are Batman villains like Bane, Scarecrow and the Joker (hitting these increment points). The laser is El Diablo (decrement points as you are hit by his fire). The main ball is the Batman spray painted black. The extra ball is designated as the Batmobile and the tunnel is the Batcave. Apart from these, there are some images that have been glued to the game board to give a complete theme feel.

Here are some more pictures of the game with short descriptions to explain better:

Challenges:

I would also like to discuss some challenges that this project threw up and what I did to meet them.

Improvements:

Also, there are quite a few improvements I would like to get in someday.

I hope this was interesting to readers. We had great fun making it and watching players’ faces light up when playing! If you have any questions please drop me a message!