Jump to content

WIP: Visual Pinball in Unity (2021 Edition)


Recommended Posts

On 12/20/2021 at 2:58 AM, gear323 said:

As for wear, in my opinion, one day in the distant future it would be ideal if it was possible to have a slider where the player can adjust the amount of wear on the table.  From pristine brand new table with zero wear to a real junk box with a worn playfield and rusty legs.  ha.  I'm guessing this could be done by having a formula for wear per material?

Maybe just a secondary texture for areas that may be subject to wear, and adjust transparency of that texture as needed. It wouldnt be totally accurate simulation as to how wear occurs as it would just be fade-in rather than additive of individual scratches and dirt specks. You could probably do additive by having several texture layers whereby each layer fades in slowly over time, adding additional specks and dirt/rust/scratches. Would get a bit heavy for processing perhaps.

Link to comment
Share on other sites

Hey Freezy, great progress so far (been monitoring a couple years. :))

One of the features I liked from UnityPinball was the fact you could have actual reflective glass over the play area which could be tweaked for brightness of the backglass reflection etc.; would that be fairly straightforward to add for graphic nicety?  Thanks -

 

John IV

www.mameui.info

 

Edited by johnhardyiv
Link to comment
Share on other sites

Following up on the "Wear" slider to increase scratches and rust.... what if we also had a "Neglect" slider?  So the solenoids get weak, the flippers get misaligned, the flippers need rebuild kits, the bulbs burn out and intermittently work, the balls get rusty, swirl marks and planking appears on the playfield, random pieces of hardware fall and block the ball, etc.?  All of this would of course be randomized, so it's all different every time you restart the game.    

Link to comment
Share on other sites

  • Content Provider
12 hours ago, ScottT said:

Following up on the "Wear" slider to increase scratches and rust.... what if we also had a "Neglect" slider?  So the solenoids get weak, the flippers get misaligned, the flippers need rebuild kits, the bulbs burn out and intermittently work, the balls get rusty, swirl marks and planking appears on the playfield, random pieces of hardware fall and block the ball, etc.?  All of this would of course be randomized, so it's all different every time you restart the game.    

Honestly the "invisible" aspects of a neglect slider aren't be hard to do in VPX now.  Just have a 0 to 1 constant at the top of the script for options, then on table init you multiply the values of each object by that, a random decimal, and a factor for that particular thing.

Left flipper strength * (1 - 0.5 neglect *  random[0.6] * 0.3 limiter) = 91% strength that game.

Doesn't even have to be powered - could make table-wide materials "dirtier" or less bouncy.  You could even get fancy, have some things on the table be a bit variable or unreliable.  Anything VPX lets you modify on the fly is fair game!

Lights are easy to mess with, too.

Would probably take a few hours to prototype and write the framework, and an hour or so to implement and tune for each particular table.  Maybe someday I'll have that kind of time again...

Link to comment
Share on other sites

So @jsm174 and I have been working on a proof of concept using Unity's Visual Scripting framework. The idea is to provide something simple that non-programmers can use. The first target are EM machines, and we'll see how much it scales for more complex game logic.

 

 

The Visual Scripting part is focused on game logic, which is quite simple, as described in the first post of this thread: Read and process switch signals, and output coil and light signals (displays and score reels will follow). So the first thing you see in the video is defining the available switches and coils. I then assign the switches to key presses (no playfield switches here), and the coils to the flippers.

 

Then I implement the game logic, which has two states:

  1. In the attract state, you can do nothing but start a game (flippers don't work)
  2. In running state, you can flip the flippers.

In order to change from attract to running, the start button needs to be pressed. This is what we call a transition, and is the first logic I'm creating (using the s_start_game switch event). Then, in the running state, the two switch flipper events are linked to the respective coils, which makes them flip.

 

We're hardly using any of Visual Scripting's vast library here, so it'll be interesting to see how far we can go.

Link to comment
Share on other sites

1 hour ago, MatjioeUnity said:

Hi everyone!

Fantastic work on the Unity & HDRP port!

I work at Unity on HDRP and would be super happy to get your feedback, answer questions and discuss our roadmap. You can DM me on Twitter.

Cheers!

Mat

 

Hey, that's a nice surprise! :)

 

I think we'll have one or two things to talk about. If you're on Discord, ping me at freezy#6526. Followed you on Twitter but I think you need to follow back in order to DM.

 

Link to comment
Share on other sites

  • 2 weeks later...

I just found out about this today, and I'm pretty excited! I'm super familiar with Unity nowadays so I'm looking forward to digging into this.

 

I'm having a problem installing the latest package though. I'm using the HDRP version and have followed all the instructions on the website, but the Visual Pinball Engine (HDRP) package seems to be stuck installing, even though all the files seem to be present in the project hierarchy. I'm using Unity 2021.2.8f1. Restarting Unity doesn't seem to help, and the Visual Pinball menu button doesn't appear. I've been waiting at least 30 minutes now and nothing seems to be changing. Is there an issue with the latest package, or Unity version? Or am I missing something?

Link to comment
Share on other sites

Did you use the scoped registry? The asset lib is around 500mb, so it might takes a while depending on your internet connection. Also compiling everything the very first time is slow. I'd give it more time, otherwise I'll need a log.

Link to comment
Share on other sites

8 hours ago, freezy said:

Did you use the scoped registry? The asset lib is around 500mb, so it might takes a while depending on your internet connection. Also compiling everything the very first time is slow. I'd give it more time, otherwise I'll need a log.

Thanks for the reply. Yep, I'm using the scoped registry. My internet is pretty fast, so I'd expect it download more quickly, but I guess I'll try letting it work in the background for a few hours.

Edited by mystman12
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...