shaderbytes pinball megathread

Hi all

Let be honest this is a niche genre of gaming but that doesnt take away any of the technicalities in producing such a heavy physics related game.

So the aim of this thread is for any pinball developers and also future developers who want to make a pinball game coming and posting questions and solutions in one place so hopefully it will be the one place to look to for any mechanics related to this genre that requires building in unity.

I have extensive knowledge in this field and have built 5 fully working tables for many years and versions of unity… Im posting 4 of them here now as examples/proof of my experience, I am willing to help where i can but help does not end at me it is open to anyone to post replies should they feel fit, this is a public forum after all.

I decided to update every table to Unity 2018 and i am using Post Process v2, the data is stored and retrieved to a local database via SQLite, most all UI is using the built in Unity UI

pinball fishtales

pinball jurassicpark
https://drive.google.com/open?id=1lQviDbw-Ef-uKNTdnlaTTYztSY_pG94z

tommy pinball

pinball elvis

You need a gaming pc to run these games , windows only. I have a gtx 970 which was the most popular card 2 years back, I have not tested on lighter/older cards but i doubt it will run properly as i am using deferred rendering and many poly and post process. Run of the mill stuff for a gaming pc to run.

Cheers




6 Likes

I watched the video, it looks really good!

You’re providing the final game, not the Unity project(s), right? It would be interesting to look at the Unity project to find out how such pinball game is put together, less interesting if it’s an .exe only.

I’m not saying you have to provide the source, you most likely have good reasons not to do that, but it would definitely catch more attention from developers then. There is little to learn from just the .exe file.

i understand but as you mentioned i wont be giving away the project files but i am happy to help out anyone in this field and I will explain how i did something specific should the need arise. Recently (last year ) I built my own 2d spline,radius corner tool in unity to help create some of the geometry. I would normally export that and tweak in blender and then bring it into the relevant pinball project.

Here is an example of my flippers for example. I built some tech in my path tools to build them for me and create place the colliders.( you can set the front and back radius and it finds the common tangent in code) I used to only have one collider originally, now i use two. Both are primitive capsule colliders, so i can use continuous dynamic on them. ( you cant use this setting on non primitive colliders ) Also look at the game object set up , the colliders and the mesh have their own gameobject. This makes it possible to replace the mesh as you see fit without losing the flipper/mesh/collider setup. if you create flippers have a generic housing game object, attach your component behaviour onto that. let you mesh and your colliders be children of that housing game object

Sincerely, I think that your will to help us is awesome and I can’t never express enough gratitude.
Now lets analysing everything and trying things!
Thanks and thanks again!

1 Like

You said before that use DoTween to make interpolations. In case of the flippers, why do you use it? Maybe to slow down the flippers movement at the end in order to apply high forces and thus not breaking the joint???
There’s a lot of physics/maths to be learned in order to attain your programming level…

I do use tweens to simulate a motor force buildup and also to have two different forces at play. In real life a flipper has two solenoid forces , one for the main movement and one for the very last bit of movement and holding the flipper. This second force is much less voltage than the main movement, this allows players to also perform all sorts of flipper tricks. im not emulating this exactly but just approximating the behaviour by using tweened force values. You can even examine the interpolation graph of a solenoid , it is not linear at all, something like this… 3480934--276841--1-s2.0-S0924424716310056-gr17.jpg

So I use two different tweens, one for the up motion and one the down motion , the one i use interpolation (easing) Ease.InExpo, the other i use Ease.OutExpo which would look similar to the graph above. Again not exact , the graph above is not exact either but it is the logic that matters , the shape would be similar to that.

It is funny you mention breaking the joint because why a flipper has two forces like this in real life is also to not break the flipper solenoids.The force value used to move the flippers very fast is very strong and requires a high voltage. If the flipper reached the end of of its rotation and the player just held the flipper buttons in and this force was not changed , the solenoids would burn out. So they have a leaf switch of sorts that triggers just as the flipper is getting to the end. This then triggers a low voltage to hold the flippers so it does not burn out. This mechanical reason of survival inherently gave the flipper play its characteristics and so people learned to do all sorts of flipper tricks knowing this end of rotation voltage and force is less.

One question.
Do you increase the time scale? Doing so the feel of the table is that of more speed, but in reality things move slowly (I think) thus avoiding fast speed rigidbodies problems… just curious.

no my gravity is increased on my tables. Table slope is about 6 degrees, gravity is about 120 i think. anyway gravity is increased only because of the size of my assets which are very big, so they would seem to move slowly with the regular gravity settings.

Another Sim im busy working on, the table is named Junkyard" :

Trying out the new HDRP of unity 2018.2. Still a WIP but you can see the current build in action here :

2 Likes

Lovely pinball machine! It was really nice to even watch from the video! Well done!

The amount of photo-realism in this is mind blowing! I’ve been to quite a few arcades as a kid. And if you showed an image of this randomly with no context, I’d think it was real life.

1 Like

Thanks @Denisowator , aside from the great work from the HDRP guys, Over the years I’ve learnt that saturation is the biggest pitfall to many graphics striving for photo realism , most are simply too saturated which is not how we see things in real life for the most part. My wood fence in the background for example is still a bit too saturated but the table materials are not :wink: I still keep learning and adjusting these things everyday. Im still not happy with the flashers and am currently still adjusting things there to get a better look

Hi, i just discovered your work. It’s so great! Do you still work on?