Guess what guys! I'm not dead! even worse yet I haven't given up on this project!
So where we last left off the gang was trying to figure out how to incorporate some new features in the game that were suggested by designers and players at Expo. Once the CAD was complete of this new revision I needed to get it cut out via CNC, on my last revision I got a taste of cnc blood and now anything less than precision is not enough for me.
So I phoned up a friend who has a small format CNC machine and got some information on what his machine could do. To cut the whole PF I would have to do the cut in two passes. To facilitate this I designed a fixture that could mount to the machine and be parallel to the Y axis of the machine and hold the playfield in place securely but after the first cut allow it to slide so the machine could get the rest of the cuts complete. I settled on a simple fixture of a piece of coated particle board and a milled piece of lumber with some edge clamps that used inset t-nuts. I then split up the playfield into two cuts and at the end of the first cut I had the machine do a plunge near the far left edge of the playfield at the top of the cut. This geometry would then be the origin for my second cut so I could move the playfield down the machine and then center the bit in the plunge hole and set my machine x y zero point. This plan worked perfectly I think the overall offset between the two cuts was less than a millimeter.
Now I took this playfield and started to populate it with components and doing all the wiring.
I got it all set up in the machine, turned it on, and boom..... I had a configuration file wrong and it ended up damaging my output boards since they pulled too much current and or I had a bad ground.... So that kinda took the wind out of my snails, especially since it was right at the start of the pandemic so getting parts was tough. Let down and a bit dejected I let the machine sit for a few months, I didn't wanna check all my wiring and I didn't wanna just reconnect the boards and possibly cook another set.
So I started working on code for the game and improving a lot of my previously hacked code.
The first thing I did was designed the heads up display I wanted to use for the machine, figuring out where I wanted the locations to be displayed when you hit the scoop, where I wanted the game to tell you there was locations unlocked, and things like that. The layout I settled on was on each edge of the screen there is a display tray that has a "handle" which is visible at all times and then can pop out when information needs to be displayed. These different displays have various layer priorities and none are tied to a mode specifically. I did this so that I could then put whatever information I want on them. The controller modes for each of these trays then would just have methods to pop the display out or retract it depending on what the modes ask it to do.
The first tray that was designed is the center fare display. I wanted something that looked like a 90's video game level display with a "TV" screen in the center showing the location that is desired and then two side panes that could display text information like location fun facts (after all I am thinking this is a tourist game) and then the "Directions" for the location on the other side in a similar format to how your maps app lists directions. I made the top of this follow the lower score display to kind of resemble a car dashboard and the gauge cluster behind the steering wheel.
Next was the location unlocked indicator, this would be on the left side and would pop out as soon as you did something to unlock a location. Unlocking locations could be as easy as starting the game, or doing a combo of shots to get the highest level locations. As soon as the feature manager (think maiden power features) saw that enough spinners or whatever were completed for a location group the feature manager would tell the location unlocked indicator to display the number of locations and pop out the tray to be a background.
Finally (for now) was the upper tray that serves as background for the various location modes to display the current task at hand things like "shoot the orbit" or whatnot.
So now we've done a lot with the code what about the mechanics?! No progress, don't remind me....
Back to code; Now that we've got the display trays set up I had to start writing the modes to actually display stuff and make something legit. I started with the fare display and made some really painful brute force code that was hundreds of lines longer than it needed. This worked, but it wasn't pretty. I spent a while learning a bit more about python and how to implement arrays and lists to my benefit, this way I could do a for loop to check variables instead of manually checking and updating each one individually. This saved a lot of pain although getting it work at first was very painful. I kept optimizing things cause procrastination and not wanting to plug hardware back in.
I also started to write the actual location modes first making four of the same type at once and then individually debugging. This was a nighmare cause I would get one working but then have to copy and paste all the different fixes and handlers from the working one to the non working ones. I decided this was a bad plan so I came up with a new method, I would write one mode to completion, getting core working perfectly so it could start the mode, and process what it needed to and then properly finish it's self and tell the manager modes if it finished successfully or unsuccessfully. This took some time (with more procrastination than I'd like to admit).
So now we've got the mode handling it's self very well, but I know I'm going to need to consider lighting calls in the very near future. Before I can go off starting writing other modes I need to make sure I have the core for updating the lighting of the mode and clearing the lighting calls from the mode. This finally got me to the point of getting back into hardware mode. I started by first repinning all of my crimp connectors as I had used the wrong size crimper so all my heavy gauge crimps were poor. Once that was complete again I tested all my grounds and supplies to make sure everything was getting the proper voltage. All tested good so I decided to finally plug it in and see how it goes. IT WORKED! no fire, no smoke, so I was a happy man. I tried to play a game but it was ball stuck heaven since my flippers had not been tuned (foreshadowing) and I didn't have any plastics on the machine.
Now I'm writing lighting calls for the modes, first the location manager that looks at all the fares and their conditions (locked, unlocked, complete) and then created lighting calls to run through the list of locations and the associated LEDs I wired up some LEDs to my PDLED boards and put the leds on the speaker panel of the cab so I don't have to worry about inserts yet. Once that was working it was off to the location mode to get it set up with lighting for the drop targets and better understanding how to use arrays to my benefit. So now my game has lights! I wrote a few modes in the meantime that are kind of side ones, the first being the upper lanes and the lighting for completion when you roll through the switches. The second was the Detroit People Mover where completing the three targets indexed the station to the next. In both of these modes I better learned the player variables and ball start and end events that further optimized the location manager and location modes.
The next challenge was my trap door. This trap door I had battled with before trying to get stepper motors to work with skeleton game. The PDLED board can control stepper motors but it needs specific serial data packets to specific data and address registers to get them to operate. Jan with MPF has these calls figured out but even with his comments in the MPF code I didn't have enough experience with python to understand what he was doing. Fast forward a year and I was looking through the pdb.py file in skeleton game and noticed how the SG guys were sending these data packets. Then looking at Jan's code and the PDLED reference material it finally clicked what exactly I needed to do to configure the PDLED to have a stepper motor, and then subsequently control that motor. Once it all clicked I was able to get the trap door working perfectly! I still need to polish up the code a bit but for now its working. I still need to fully mount it in the machine but that will wait for the next revision since I'm cutting a new PF soon.
So now we're almost up to date, In playing the game testing the first location mode I realized my drop targets were set far too close to the flippers and needed adjustment. Luckily the pindev guys stepped in and mentioned that my flipper power may be too high, Looking at my longest shot I tuned the flippers back so they had enough to hit the far shots and that was enough to prevent the ball from airballing off the drop targets.
Now that we've got lighting, geometry tests, and most things done it's time to think inserts. So I reverse engineered all the inserts I wanted to use in my game and created a test CNC geometry to test the fitment of the different types. In my game I'm using a large triangle, 1.5 in circle, 1 in circle, and 1.5 by .75 inch rectangle inserts. I created the NC code and brought it over to the machine and the inserts fit perfectly! The triangle is a bit tight but it'll work.
The next step was to then take those geometries and lay them out over the entire playfield in the format I want for the game. Once that is complete I can generate the code for the whole playfield and cut out the next revision!
The goal is to have a solidly running demo game for Expo with most of the lighting installed, along with as many modes as I can solidly write for players to get a good idea of the game and how it will play out.
Schedule for the next few weeks is:
Finalize NC code for CNC cutting
Write radio station mode for music for each driver
Cut playfield (likely next friday)
Sand and clearcoat playfield (next sunday)
Playfield swap (who cares about clearcoat hardness)
Code like mad!
I'll post some progress photos once I get them off my phone