Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: SKEEBALL IS LIFE - My 5 year journey to build custom skeeball cabinets  (Read 769 times)

0 Members and 1 Guest are viewing this topic.

netlohcs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17
  • Last login:November 12, 2020, 11:59:21 am
  • Skeeball is life
Hello, my name is Nate.  And I am an addict.

My drug of choice? Well that would be skeeball.

My journey down this road started like any other addiction: small at first.  But it has grown.  Fueled by the creation of my own highly customized skeeball tables and the writing of my own computer code to run them, it is now a full blown addiction, and I don’t plan to slow down any time soon.  This is my story.

First, a picture of my tables as they currently are:



Now, lets start from the beginning.  I own an automotive business and about 6 years ago I purchased a 2nd building for it.  It had lots of extra space, including a room that my wife and I eventually decided to turn into a game room.  We bought a couple pinball machines, and were discussing other games that we would potentially enjoy having.  My wife mentioned skeeball, and immediately thought “well I bet I could build that!”.  If only I knew the journey it would take me down. 
I set out to build myself a skeeball table.  Never being one to be satisfied with “normal”, I asked myself how I could maybe spice up the game of skeeball a bit, and my immediate first thought was to put lights in the playfield.  And not just lights for flavor, but lights integral to the playfield that would give feedback to the status of the game. 
Two disclaimers before I go any further:
1)   I own a CNC machine. 
2)   I have access to large amounts of polycarbonate scraps at incredibly cheap prices.
I know this is not normal. Because of this, I understand that this post is not going to be a roadmap for others to easily follow.  I apologize for that.
Anyways, I wanted to try embedding lights into the playfield.  My first plan was to use a 22.5 degree V bit to cut nearly all the way through a piece of polycarbonate, then fold it into a ‘circle’.  This is a picture of my very first prototype:



I added in a slot for LED strip lighting, just to see what it would look like lit up.



 I was absolutely hooked.  As soon as I saw this, I knew that having lights in the playfield would be absolutely mandatory.  But there were a few problems.  Most obviously, my holes weren’t actually round.  Having hexagon shaped holes would’nt have been a huge deal for the 100 or the 50 hole, but on larger holes like the 20 or 10, this wasn’t going to work.  The balls wouldn’t roll smoothly. I even bought a smaller angle V bit and tried a 12 sided circle.  Remnants of that prototype can be seen here:



This was the first piece that I actually rolled some balls at.  The other big problem became immediately obvious.  The skeeball balls bounced off of the polycarbonate like crazy.  Well duh.  Anybody could have told me that.  But sometimes you just have to actually SEE something not work in order to get your train of thought heading in another direction.  So I needed to go back to the drawing board with my hole design.

netlohcs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17
  • Last login:November 12, 2020, 11:59:21 am
  • Skeeball is life
Re: SKEEBALL IS LIFE - My 5 year journey to build custom skeeball cabinets
« Reply #1 on: October 30, 2020, 10:46:23 am »
Despite the fact that it would require significantly more machining time, I settled on a stacked ring design. It ended up looking something like this:



I spent a long time machining polycarbonate.  A lot of it had slots in to embed the LEDs.  This also gave me the opportunity to use more than one color per hole.  In the end I decided on two colors per hole, red and blue.  I felt that having two colors would give me a ton of flexibility in game design, but trying to go to 3 colors per hole would meet some diminishing returns.  More importantly, a raspberry Pi doesn’t have enough GPIO pins to run all of the hole and button sensors and still have enough left over to do 3 colors per hole, so 2 it was.



netlohcs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17
  • Last login:November 12, 2020, 11:59:21 am
  • Skeeball is life
Re: SKEEBALL IS LIFE - My 5 year journey to build custom skeeball cabinets
« Reply #2 on: October 30, 2020, 10:47:49 am »
Either imagur or this website is being insufferable when it comes to posting pictures.  I was hoping I could get this all posted before I went to work, but for now I guess it will have to wait.  More later!

javeryh

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6821
  • Last login:Yesterday at 04:55:42 pm
    • Bella's Arcade
Re: SKEEBALL IS LIFE - My 5 year journey to build custom skeeball cabinets
« Reply #3 on: October 30, 2020, 11:56:47 am »
Either imagur or this website is being insufferable when it comes to posting pictures.  I was hoping I could get this all posted before I went to work, but for now I guess it will have to wait.  More later!

There is a thread for posting pictures to your project - it is a sticky.  You can upload the pics there without a description or anything and then use the URL in this thread and they should appear. 

This project looks bonkers - can't wait to see more!

netlohcs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17
  • Last login:November 12, 2020, 11:59:21 am
  • Skeeball is life
Re: SKEEBALL IS LIFE - My 5 year journey to build custom skeeball cabinets
« Reply #4 on: October 30, 2020, 02:07:02 pm »
some of the machined rings with LEDs in them:




The top of the holes were a challenge.  I knew they needed to be soft. I ended up designing a sort of beveled ring clamp design that relied on the compression force of the top bolts to squeeze the rubber into place.  If I’m honest this is (software aside) the part of my machines design that I’m most proud of, at least from a mechanical standpoint. 




On the top of the playfield, I used a rubber product sourced locally.  I’m not even sure the exact name for it but was told it is used as a floor lining in horse trailers.  Its been super durable for me.



For the playfield itself I used 2” thick MDF.  In hindsight, this is obviously overkill, but I was concerned that if the playfield itself had any flex to it, the balls would rebound with significantly more energy.  I used my CNC to machine the wire passageways in the back side of the playfield.  I went with optical sensors of the reflective type.  More on that later. 





The LEDs are driven directly off of the GPIOs of the Pi using MOSFETs.  This was a bit of monkeying around because the MOSFETS that I used weren’t actually the right ones for my application, but I figured out a (admittedly hackey) way to make it work.



The rest of the physical construction of the ramps was fairly straightforward and I wont go into too much more detail on it unless someone wants to know more specifics.  The ramp and kicker were all machined out of MDF.  I had plans to paint/decorate them, but.... whats that saying about once something is playable.... yadda yadda....  Anyways, I know that my first two machines definitely lack polish on the cabinet and the ramp.  I am in the middle of constructing machines 3 and 4, which will DEFINITELY look nicer.  More on machines 3 and 4 later.





This pretty much completed the physical construction of my machines.  Chapter 1 complete.  Little did I know just how early in my journey I actually was.  I knew that I wanted to use a Raspberry pi to run them.  After a bit of deliberating I decided that the language I would use to write my code would be python, using Tkinter as the front facing GUI.  I had never coded anything in python before, and other than a bit in highschool and college, hadn't really done any coding at all. 

In my next post I will start talking about that in more detail, along with all of the issues and fixes  that I came up with.  More posts to come soon!

meyer980

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 270
  • Last login:Yesterday at 11:33:08 am
  • Building fun things for fun
    • sergiostuff.com/2020/04/15/felix-son-arcade-game/
    • Sergio Stuff
Re: SKEEBALL IS LIFE - My 5 year journey to build custom skeeball cabinets
« Reply #5 on: October 30, 2020, 03:10:26 pm »
Very cool, nice work! Looking forward to hearing how you do/did the software side.

netlohcs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17
  • Last login:November 12, 2020, 11:59:21 am
  • Skeeball is life
Re: SKEEBALL IS LIFE - My 5 year journey to build custom skeeball cabinets
« Reply #6 on: October 30, 2020, 05:23:17 pm »
Chapter 2.

So I had my cabinets built, and started on the coding side of things.  As I stated, I decided (for reasons I don't even fully remember any more) to use python.  I think it may have been because python seemed to integrate easily with the GPIO pins for the Pi. There were stock, simple to use functions that you could implement, along the lines of "if this GPIO pin goes high, run this function".  The GUI that I used was Tkinter.  There have been moments that I have somewhat regretted using Tkinter, but by that point I was so deep into it that I wasn't going to change it at that point.  One of the things I did very early on was to build two little test boxes that would allow me to write and run my code while I was at home.  They were essentially identical to my actual skeeball tables, except that instead of optical switches, it had small momentary push buttons for each hole sensor, and had just a single LED of each color per hole.  They work great, and I would never have been able to write and debug my software without them.  Here is what they look like:




definitely nothing fancy, but very functional.  As I noted before, I had never really coded anything seriously.  But I have a pretty analytical mind and a very can-do attitude, so with lots of patience and loads of help for stack overflow (thank god for stack overflow, right?) I started coding.  My first version of software looked something kind of like this.



Ten single player games on the left side, ten multiplayer games on the right side.  Because who would EVER write more than ten games? Well, me.  I soon realized that my screen format was not going to cut it.  For starters it looked dumb to just have "multiplayer 6" on the screen as a placeholder.  But also I very quickly realized that I'd be writing a lot more than 10 games.  So I went to a scrolling format where only 3 games are listed on the screen at any given time, but the number of games you can scroll through is unlimited.

Of course, the first game I coded was "classic".  Throw 9 balls, get your score.  But then my creative juices started flowing a bit, here are examples of a few of the first games that I wrote for my machines:

This game is called THREES:



and this game is called WINDUP:


Arroyo

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1418
  • Last login:Today at 10:19:06 am
  • Budgets are boring
    • newforum.arcadecontrols.com/index.php/topic,156267.0.html
Re: SKEEBALL IS LIFE - My 5 year journey to build custom skeeball cabinets
« Reply #7 on: October 31, 2020, 08:01:25 am »
That looks like a ton of fun.  Well done, I can only imagine how many hours in you are, but looks like it’s paid off.  Love the integrated camera and the selfies that get displayed.  Keep posting!

Laythe

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 675
  • Last login:December 01, 2020, 01:43:06 pm
  • "-smurfing- delivers." - Yots
    • forum.arcadecontrols.com/index.php/topic,149109.0.html
Re: SKEEBALL IS LIFE - My 5 year journey to build custom skeeball cabinets
« Reply #8 on: October 31, 2020, 11:01:18 pm »
That is slick!  Props for writing your own software. 

I like your lighting solution - those rings look great.   :applaud:

netlohcs

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17
  • Last login:November 12, 2020, 11:59:21 am
  • Skeeball is life
Re: SKEEBALL IS LIFE - My 5 year journey to build custom skeeball cabinets
« Reply #9 on: November 01, 2020, 02:59:41 pm »
Chapter 3
After I got the basics of a few games programmed, I wanted to move on to making multiplayer games.  In order to do that, the two tables needed to communicate with each other on a low latency basis.  This is when I ran into one of my first major hurdles.  The cleanest option would have been to use TCP/IP to communicate from one raspberry Pi to the other.  I soon found out though that my choice of using Tkinter might make this problematic.  In order to implement TCP/IP in python, you need to have a loop that listens for input.  But Tkinter itself runs a blocking loop that inhibits easily implementing a second listening loop for TCP/IP.  I had some options here, including multithreading, but pretty much all of this was already above my pay grade when it came to programming.  Because of this I decided to explore a few (in my opinion) simpler options.  What I ended up settling on in the end was actually two lanes of one way communication via saving and reading simple text files. 

I discovered these things:

-Using pickle, you can save small text files in python very fast.
-If you have one Pi that is trying to read a file that the other pi is currently saving, it gives you an error, but its not anything game breaking.
-If you have both pis trying to save the same file at the same time, it gives you an error, which DOES break the game. 

With this information, I started doing a little bit of testing.  Machine 1 (I call it the “server” machine) has a very small text file that it is continuously saving.  Machine 2 (I call “client”) is continuously trying to open and read this file.  There is a separate file that machine 2 is continuously saving, and which machine 1 is reading.  The reads were successful about ¾ of the time, with the other ¼ giving errors because the file was in the middle of being saved.  If there is a read error, the software just keeps rolling on the most recent information it has, and tries reading again the next loop.

I really didn’t think this was going to work.  It sounded SO hacky.  But I wrote some test code, and was able to achieve an average of 20 to 25 successful reads per second.  This equates to about 40 ms of lag (one way), and a total of about 80 ms of lag on round trip communications.   In other words, if you’re specifically watching for it, the lag is barely perceivable, but it is not a hindrance to game play.  Its worth noting that the files I’m using for communication are VERY small.  I think one is about 100 bytes, and the other one is maybe 67 bytes.
 
I also had to figure out how to implement multiplayer games from a front end user interface standpoint.  To explain how I did it, I probably need to back up for a second and describe my software a bit more.  When the game first loads, there is a Main Menu that lists all of the games, with a short description of each game.  It looks like this:



After your game is selected, pressing the start button one time enters what I call the “shell” screen.  It looks like this:



 This screen has a more in depth description of how to play the selected game.  From this screen, you can press the start button to begin the game, or you can press either the up or down arrow to go back to the main menu.  Oh I should mention the buttons I put on each table, they look like this:



As soon as the game is finished, the machine determines if you got a high score (It saves the 4 highest scores).  If you did get a high score, it tells you that youre about to have your picture taken, then it takes your picture and adds it to the high score table.  It then kicks you back to the game shell screen.  If you didn’t get a high score, it sends you to the shell screen right away.

So that was the flow of my machines, and I wanted to implement multiplayer in a simple fashion.  The way I ended up doing it was that any multiplayer game needs to be initiated from the “server” machine.  On that machine, you press both the up and down arrows simultaneously to toggle between the single player main menu and the multiplayer main menu.  Once you are in the multiplayer menu, a multiplayer game request can be sent to the client machine, assuming it is not in the middle of a single player game.  If it is, then the server machine gets an error message saying the client is busy.  Once a successful multiplayer request is sent, the client machine has the option to either accept or decline the game.  If the request is accepted then both machines go to a multiplayer shell screen with a description of the game.  From this screen, if either player hits their start button, the multiplayer game will start. 

With this system implemented, I started designing some multiplayer games.  I knew I wanted to make 1v1 vs games, but I also wanted to make Co-op games where both players were working together.  The first few multiplayer games I made were fairly straightforward, the first of them being called “whack-a-hole”.  This is a 60 second timed game where 2 holes are lit up on both boards at any given time.  Whoever hit the hole first gets the point.  Pretty straightforward.  Here is a demo video:



From a processing standpoint, EVERYTHING occurs on the server machine.  The client machine is merely reporting what holes on it have been hit.  The server machine is doing all the logic and scoring, and then reports back to the client machine telling it what holes to have lit up and how bright to have them, and also what information it should be displaying on each of its on screen labels (time remaining, score, balls thrown, etc).  This means that in the youtube link above, when the player on the right table (the client table) hits a hole, that machine saves the text file saying what hole was hit.  This text file is then opened by the server machine, the data is read and processed, and the server machine then saves its own text file telling the client machine to turn off the lights for that hole.  The client machine then opens this text file, reads it, and turns the lights for that hole off.  Watching carefully, i'm not sure if there is any perceivable difference between how quickly the lights turn off on the client table vs how quick they turn off on the server machine.  Thankfully computers are fast enough to make up for my hacky programming skills :) 

At this point, I had a functioning communication protocol for my multiplayer games.  Everything seemed great.  But in chapter 4 I will start talking about a major problem that I encountered that almost derailed my entire project.

bperkins01

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 815
  • Last login:Today at 09:54:42 am
  • Plenty of skills.. gaining experience..
Re: SKEEBALL IS LIFE - My 5 year journey to build custom skeeball cabinets
« Reply #10 on: November 02, 2020, 06:17:21 am »
Nice work on these  :applaud:  Love the dedication and follow through.
My wife is never to see this thread.. or I will end up having to make at least one ;)
Looking forward to the next installment.

Its been years since I've coded at that level..  but I'm sure there are some options to make the communication less troublesome?
maybe a shared file and they both read/write to different parts?
or a lock file to (we call them quorum files/devices in clusters)?

I'm sure you have been all through it..  Nice work.


My Arcade Cabinet Build and other projects here:
Centipede, Joust, Joust Cocktail, Asteroids, Galaga, Ms. Pacman Cabaret, Defender, Space Invaders Cocktail
https://bperkins.wordpress.com/