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 Try the site in https mode Site News

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

  

Author Topic: Retrofitting EM machines with driverboards and Unity 3d  (Read 3766 times)

0 Members and 1 Guest are viewing this topic.

supafraud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • Last login:January 13, 2013, 12:55:11 am
  • I want to build my own arcade controls!
Retrofitting EM machines with driverboards and Unity 3d
« on: December 28, 2012, 03:04:16 pm »
Hi! I'm looking for a little help with a project I'm working on. If you've ever worked on an old EM pinball machine you know how much of an endless task that can be especially if it was ever stored outside and is really gummed up etc, but i digress.

Unity 3d + minipac + a driver board (pacdrive, or even arduino) = awesome.

More specifically using uScript. I've created a few projects using Unity's uScript visual scripting plugin, some pretty complicated including a fps style training app from scratch. I understand logic, I just don't know syntax and I find visual scripting to be easy for me to work with in uScript it's also very much like expresso in cinema4d which i use as well). It would be easy to read inputs from a minipac and then to fire off solenoids and light lamps using a driver board. The bump in this road is getting unity to talk to a driverboard.

The guys over at uScript.net say they will creat nodes for me that will allow me to plug my game logic into the board if I can get a plugin for unity that will allow me to access the hardware. Again, I'm not a coder so I don't know how hard this is but I was hoping that by using the pacdrive sdk a unity plugin could be created. Another option is to use an Arduino. People have already created a plugin for this but all the examples I have found have been for input and not output. I just ordered an Arduino off of amazon and a high load bank of relays to experiment with.

Tying unity/uscript to an old EM pin would be amazing. You could rescue machines that would otherwise not be worth fixing at add items to the playfield, create custom sound effects and music. Missing back glass? no problem just insert a monitor in the back box and design custom animations. If anyone at all is interested in helping me out with getting unity to talk to a driverboard PLEASE let me know.

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #1 on: December 28, 2012, 04:11:07 pm »
totaly interesting

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

supafraud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • Last login:January 13, 2013, 12:55:11 am
  • I want to build my own arcade controls!
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #2 on: December 28, 2012, 04:40:23 pm »
Awesome! So here's what I know so far.

pacdrive:
The pacdrive SDK includes a DLL file and examples of code that take commands from that DLL in C##. From what I understand you can copy a DLL into the Unity assets folder and create a plugin in C that makes the commands available. This is more info on writing a Unity plugin (all over my head):
http://docs.unity3d.com/Documentation/Manual/Plugins.html]
[url]http://docs.unity3d.com/Documentation/Manual/Plugins.html
[/url]

pacdrive SDK:
http://www.ultimarc.com/PacDriveSDK.zip

This would be easiest I think (just guessing) because from what I saw in the code example there are simple commands to activate the driver board.

If we go the Arduino route there is more code you have to write to get the Arduino to do what you want as well as possible lag (from what i've read on forums)

But here is some stuff I found on the Arduino:

Input from arduino to unity: http://classes.dma.ucla.edu/Spring10/152BC/?p=155

Someone claiming to be working on a plugin: http://arduino.cc/forum/index.php/topic,139272.0.html

So again, if I can find someone that can make the pacdrive SDK function within unity we are golden and I can handle the rest. I'd like to ulitmately create an executable that is easy to setup for any machine and easy to modify, maybe have presets you could save and share. I've got an EM machine that has been gutted just itching to be operated on....

....IMPORTANT NOTE: The free version of Unity does not support the use of plugins. I have a lic for the pro version but this might be a problem for you if you are trying to make a plugin you can't test.

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #3 on: December 28, 2012, 06:59:59 pm »
u have me thinking here

in the term em do u mean electro-mechical ?
if so they are 42-58vac coil's
with a hudge spike
how to walk around this problem we use a triac and opto isolator
the opto can be driven right from a pac

with that in hand we toss out a driver board
do not need it any more

will look into your request
d/l the s/w this afternoon
just cutting my teeth on it now

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #4 on: December 28, 2012, 08:24:22 pm »
ok i did some fast reading here
it is java scripting,with open scource to c/c++ and of course borland
with the engine i found on there site u can convert to xml
there support look's deep

on to my point ealier
u c if we use ac coil's
we can then use small triac  board's,much like gottileb system 80 game's that used
aux driver board's :haunted-house: is a nice example

i myself have 2 em's that i would love to try this out on
1=fast draw
1=quick draw
sister game's
but would make for a fun to learn project

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

Pinball Wizard

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 482
  • Last login:June 04, 2021, 03:47:13 pm
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #5 on: December 28, 2012, 08:27:37 pm »
Just a heads up, at least flippers should remain "pre-driven" as they say, in that while they are active in gameplay, you should be powering the coil, and the flipper button acting as a ground. This way you eliminate delay in reaction time, otherwise you can have problems with hesitation. However minor it may be, it is enough sometimes to cause issues that lead to draining balls on a skilled player flipping off the end of the flipper.
Where's my gold star :P

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #6 on: December 28, 2012, 09:27:07 pm »
agreed

never wanted the flipper's tied that way
just thumper's/drop-traget's/out hole lanch's/ball return and such

if we use pac2 it is usb 2 no lancey should show up

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #7 on: December 28, 2012, 10:17:00 pm »
from what i get out of the code set
it is as easy to code into as winexplorer
the main code is a >shell<
we just change the way we want it to work
just rember base rule's
(cmd) placed inside of these () make's a cmd for the shell
next

example here

Before we begin, it is worth mentioning some conventions in Unity.
Variables - begin with a lowercase letter. Variables are used to store information about
any aspects of a game’s state.
Functions - begin with an uppercase letter. Functions are blocks of code which are
written once and can then be reused as often as needed.
Classes - begin with an uppercase letter. These can be thought of as collections of
functions.

so we use lower case
for a variable,ok easy enough

so now we move on to function >uppercase< >first letter< >l< is a function
u write the cmd it is

now i did not get to classe's as of yet
but if i read it right we can define a class the same way as a function,expect it carry's a full new set of rule's >need's looking into<, i am sure that,the last to are tied some how

ed


Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #8 on: December 28, 2012, 10:28:05 pm »
it is called cmd line

example here

function Update () {
transform.Translate(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
}
note the cap's on the t,I,G,A >(Hcmd)< I,G,A>(Vcmd)
so what we are doing is defineing a function call

please aslo follow the scripting () {}

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #9 on: December 28, 2012, 10:56:24 pm »
this define's your speed :example here:

var speed = 5.0;
function Update () {
var x = Input.GetAxis("Horizontal") * Time.deltaTime * speed;
var z = Input.GetAxis("Vertical") * Time.deltaTime * speed;
transform.Translate(x, 0, z);
}

lacnecy should no longer be of a concern

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

supafraud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • Last login:January 13, 2013, 12:55:11 am
  • I want to build my own arcade controls!
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #10 on: December 29, 2012, 12:09:19 pm »
Hey Ed, I'm going to have to read your posts a few more times I think to get on the same page - I agree about the flippers being hardwired, I think I would just have unity cut the power to them when the game was over etc.

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #11 on: December 29, 2012, 12:23:54 pm »
supafraud

i was just as i stated cutting my teeth with the code set
so i could better understand what we are working with
and how to go about it

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

supafraud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • Last login:January 13, 2013, 12:55:11 am
  • I want to build my own arcade controls!
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #12 on: December 29, 2012, 12:46:19 pm »
Awesome :-) I may start mapping out game logic today and all the input stuff

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #13 on: December 29, 2012, 01:58:40 pm »
hi
i would start with the s/w logic first
then move to what that switch does and the score value
try to keep it simple at first,then move to more complex scoreing
if u are truly doing a :e/m: over,a hudge hint here is they worked on jacob's-ladder-theroy,ie switch a colses cause's a/b/c to happen
with that in hand u can do the full logic in about a week

now with that said,the reason i like gottileb is there
playfeild never really changed from e/m-solid-state
point in case is quick draw :e/m: to cleopharta :s/s:
both 4 player machine's,same # of drop traget's/thumber's/lanuch's

a good starting point is nuwhifi,they make a system1 replacement
but there s/w is open  and u can d/l the ladder..make's it easy to do what u want

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

Le Chuck

  • Saint, make a poll!
  • Wiki Contributor
  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5509
  • Last login:April 14, 2024, 06:01:28 pm
  • <insert personal text here>
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #14 on: December 29, 2012, 02:12:11 pm »
This project seems really interesting.  Is this primarily to breathe new life into EMs or is the goal to start designing one's own?  Either way I look forward to updates, it's way out of my depth but a lot of fun to follow.

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #15 on: December 29, 2012, 04:06:26 pm »
hi
i just went some more of there fine walk through
even though it is written for >gui< interfacing
it can easily be converted
code snip here

// Loads the level named "SomeLevel" as a response
// to the user clicking on the object
function OnMouseDown () {
Application.LoadLevel ("SomeLevel");
}

note mouse can be defined as any thing we want >switch<
reply can be defined again as anything we want >fire-coil<

which happen's right here >
// Loads the level named "SomeLevel" as a response
<

please pay attenion to the scripting
 () {} \\ //

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

supafraud

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • Last login:January 13, 2013, 12:55:11 am
  • I want to build my own arcade controls!
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #16 on: December 29, 2012, 04:57:58 pm »
This project seems really interesting.  Is this primarily to breathe new life into EMs or is the goal to start designing one's own?  Either way I look forward to updates, it's way out of my depth but a lot of fun to follow.

I think there are a lot of EMs out there that could be brought back to life using this method as well as modded out. I like keeping things original as much as possible but there are some EM machines that are missing the back glass or several parts/wiring and they probably end up in landfills as a result. I've got 2 machines that were headed for the landfill and I don't feel too bad about hacking them as they arent rare or sought after machines.

@ed I'm using uscript for all of the game logic, I actually have some of it put together already. The buttons on the playfield are wired to a minipac that send keyboard commands to unity. Really the task I need help with is getting the pacdrive SDK or the Arduino working with a unity plugin. If I can get unity to talk to hardware so that I can set off solenoids in the playfield this project is essentially ready to go.

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #17 on: December 29, 2012, 11:23:48 pm »
to make sure this stay's on track and dose not get de-railed
this is what the @ is looking for

A SDK (Software Development Kit) would be a package that comes with all the necessary components to develop software. I know of a few examples, but i don't know where they are anymore. One is the Java SDK that comes with all the libraries, help for them and the software needed to program and debug the java, along with some other things that might make things easier. There is also a C++ 3D Game SDK somewhere (i have long since forgotten where i saw it) that came with a 3D modeler, a compiler, a linker, a somewhat good IDB, the libraries it needed, documentation, examples, and a few other things that would probaly help a 3D game designer.

An SDK is helpful because there is no need to go out and hunt for components that are compatible or that fullful each other's needs, it all comes in a handy package for easy installation.

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

Dazz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1246
  • Last login:March 30, 2024, 10:34:39 am
  • HyperSpin Team
    • VPUniverse
Re: Retrofitting EM machines with driverboards and Unity 3d
« Reply #18 on: January 18, 2013, 02:23:29 pm »
Have you guys seen the Gyruss pin by Roseve?  This is a custom pin that is actually using a PC with Visual Pinball & B2S interfaced with a LEDWiz.  All game modes and scripting was done by Roseve in Visual Pinball.

http://vpuniverse.com/forums/index.php/topic/10-gyruss-pinball-machine-game-play/