Jump to content

WIP: Visual Pinball in Unity (2021 Edition)


Recommended Posts

Apologies for the lack of updates. I've written up a new post already, but I wanted to provide a video that I still need to produce. And there are a few other things I need to take care of at the moment, so please bear with me.

Link to comment
Share on other sites

  • 2 weeks later...
  • Content Provider
On 7/20/2022 at 3:55 PM, PastorLUL said:

Very curious too, especially when i realised its already been in development for 2.5 years 😮

 

There's a larger difference between fulltime software devs dedicating a fulltime job to create a new game / app over multiple years.... compared to hobbyists who only have their free time to work on it (while working a fulltime job and raising a family,etc).

 

We are all excited... but it will get there eventually. A completely new editor / player of this scale takes a very long time to evolve.

 

 

 

Link to comment
Share on other sites

So, finally! Let's dive right into it.

 

Visual Scripting

 

We've completed the foundation of Visual Scripting. The proof of concept was Gottlieb's Volley, which is now our first fully playable game. This validated our idea of providing a new system for implementing game logic. For EMs it works pretty well, and we also got positive feedback from the creator community. You can find the documentation here.

 

 

However, for more complex games with graphical displays and light shows, there is more work to be done on tooling before we can provide guidance on how to integrate these features with Visual Scripting. That means that EMs are currently the only viable projects at the moment.

 

That's fine though, and @scottacus started working on another EM in VPE, providing us with all kinds of valuable feedback. This also resulted in a new component that easily allows a gate to be toggled with a coil.

 

Physics

 

@cupid spent a crazy amount of time fixing the ball rotation issues. So now, the ball rotates and reacts like it should, but even more importantly, we now have someone who understands how the physics code works! :)

 

He also implemented nFozzy's rubber dampeners. What's very cool about this feature is that it's now natively in VPE, thus easy to add, but you can also apply it to each collider independently.

 

Additionally, while implementing the nFozzy (elasticity-) dampening of objects, he also added friction dampening/enhancement to simulate objects more accurately. Metal wires for example seem to have more „friction effect“ on slower balls.

 

Asset Library

 

The third big feature is what we call the asset library. Today, when building a table in VPX, authors need to either re-model all the geometry, or scrape existing tables and copy them over. This can be time-consuming and quite laborious.

 

The idea of the asset lib is to provide a curated, searchable library of common assets that you can easily drag into your scene. The assets are fully textured, properly scaled (in real-world units), and optimized for real-time rendering.

 

image.thumb.png.e36a68b97e45b83dca6b374e27a91db5.png

 

Additionally, the library contains meta data for each asset. There's a category, attributes, tags, a description, as well as web links. Right now, the library is quite small, but will grow as we continue to build tables. If anybody with modeling skills wants to help improving the library, let me know.

 

As a note, @vbousquet is doing the same thing for Blender assets,  so if you'd rather start curating pinball models in Blender, drop him a message.

 

Tutorials

 

After my first tutorial about how to create realistic looking plastics, I've written another one about how to model and texture a playfield. Since Unity uses the PBR workflow, texturing becomes more important, and I believe that properly texturing models with a bit of wear will immensely improve the realism of the visuals.

 

Then, @scottacus provided a tutorial about how to create a translite. It's awesome to see the number of high quality tutorials grow, and I'm looking forward to seeing more topics covered in the future.

 

VR/AR

 

I finally managed to test Volley on my headset, and it looks spectacular. Real-time reflections add such a more genuine feeling. There's still a lot to be done in terms of noise and frame rate, but VR is definitely something I want to support.

 

Then I recently came across a very cool AR project by a start-up called Tilt Five. Their product are lightweight AR glasses that shoot light at some kind of reflective pad, resulting in a hologram in front of you. Putting this pad into a cab instead/on top of a TV might be a nice way of getting 3D out of your cab without all the caveats of VR.

 

Anyway, the CEO and founder of Tilt Five, Jeri Ellsworth, is a pinball nerd, owning over 80 machines. I had a video call with Jeri, Peter and Hans from Tilt Five a few weeks ago, and she was very enthusiastic about VPE. :)

 

 

I recommend watching this interview, it's an amazing story about how she brought the project from its inception at Valve to the first production batch. So, stay tuned about Tilt Five news. :)

 

The Future

 

Folks have been asking when VPE will be ready. Let's define "ready", or "version 1.0" first. For me, VPE 1.0 is a player application, able to load tables at runtime, with working physics, graphics and sound.

 

In order for this to happen, we need to work on three big pieces that are still missing:

  1. The player. Probably the biggest thing, it's a new project to create.
  2. A way to package tables. As a table creator, you should be able to import and export a binary, and as a player, you should be able to load it into the player app, and play it, at runtime.
  3. Mechanical sounds. A system that allows you to link audio clips to events, with a processing unit and spatial location.

There are other topics that might or might not make it into v1.0, but are definitely on the feature list. In no particular order:

  • SSF support
  • DOF support
  • Real DMD support
  • Multi monitor support
  • Dynamic collisions
  • New sling shot physics
  • New drop target physics
  • Nudge support (with and without gyroscope)
  • Light sequencer tooling for originals
  • DMD/Display tooling for originals
  • A public example project that is maintained
  • Unification of render pipelines
  • VR/AR support
  • Shooting component for debugging
  • Tooling for quick ROM mode access
  • A plan and implementation how to get ROM definition data

So, given that we're also working on creating tables and not just the engine, it's gonna be rather months than weeks for v1.0. Also, we have a real life obligations and summer is typically not the most productive time.

 

In any case, we'll keep you posted, hopefully more frequently.

 

Cheers!

 

 

Link to comment
Share on other sites

It was a lot of fun to work with @freezy and @jsm174 on making an EM in vpe!  I have to say that the graphical coding interface was easy to work with and intuitive to use.   

 

VPX is wonderful software but in vpx we EM authors have write code to do all of the following:

-keep track of players

-keep track of balls in play

-make a score motor to handle multiple scores

-add physics mods

-add special graphics to improve vpx rendering

-block scoring at appropriate times

 

All of this is native to vpe so the amount of time that it takes to get a machine up and running is cut down substantially once you know how to use the system.  I think that the best thing about vpe is that the devs care about making the system the best it can be and in the end that will result in a phenomenal next platform for virtual pinball.

 

Untitled.thumb.png.beeed3f2e89bdafa08290edc165f7b0b.png

 

Link to comment
Share on other sites

I especially like hearing about creation of the asset library to help streamline the process for table creators. Thats a great idea.  Also, AR support using something like Tilt Five sounds awesome.

 

Alot of work has been put into this up till now and we all understand that good things take time and are worth the wait. Thanks for the updates. :D

Edited by xoller
Link to comment
Share on other sites

Very, very cool. No ROMS needed.  I’ll have to read the articles. My pinball itch is starting again after a 4 year hiatus. Being an old man, I love EM machines but look forward to the solid state stuff. GREAT WORK GUYS!

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

I do not if there is any interest in this group, but HumbleBundle.com has two bundles currently related to Unity:

 

image.png.d79830066582e9e07e8a5b9ad1316b35.png

 

Each landing on ~ 30$ each for the full pack. They include 3D art, sounds and tooling.   I am not affiliated in any way with Humble Bundle

Link to comment
Share on other sites

  • 3 weeks later...

So if you're buddies with a bunch of early adopters who you talked into starting their own cabinet builds, what video card do you tell them to get that has a decent chance for playing VPE v1.0 on release day with at least mid-level settings?
Or is it too early to take a stab?

Link to comment
Share on other sites

The goal is to have current-gen running at 4k@60fps, and last gen at 1080p@60fps. Conveniently, we're at the beginning of a generation shift. But remember that goals don't always equal reality, so it's most likely too early to take a stab.

 

If I had to guess, you'll probably be fine with a 3060.

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...
  • 1 month later...

Time for another update!

 

Asset Library

 

After my last post, I've continued putting more focus on the asset library, which didn't contain many assets and didn't have all the features I wanted. So the first few weeks I spent with Blender, modeling an extensive hardware library (screws, nuts and bolts). McMaster-Carr was an invaluable resource because they offer 3D models of all of their products. However, they are CAD models and not polygon based, so I remodeled most items based on a hi-poly CAD conversion.

 

vpu-update-2022-12-blender-hardware.thumb.png.5f6719883108381a54325553d4c34078.png

 

I learned a lot about topology in 3D modeling. It's actually quite interesting to see that sometimes you literally have to place vertices by hand in order to get a good topology. Before, modeling for me consisted of extruding 2D shapes and sometimes adding a boolean operator, but it's actually important to think about the loops and edges of a mesh before you even start modeling something.

 

Anyway, one of the methods I learned and seemed to work well for decimating 3D scans I have documented in a tutorial. Have a quick look if that's something you're interested in.

 

After finishing with the hardware collection, I decided it was time to do something about the ugly preview thumbnails. So I set up a new Unity project, created a scene with nice lighting and wrote an editor tool that would loop through all the assets to generate a thumbnail for each. And boy, this adds so much. The project has DXR enabled, so we're getting ray-traced reflections and shadows.

 

vpu-update-2022-12-hardware-thumbs.thumb.png.5fad6bcb95cd8af650d4e7ec86de9453.png

 

Then, after some minor topology fixes I've also ported the metal and plastic posts from @Niwak's pinball-parts, and they look great. However, once I started dropping them into the existing VPE projects, there was a problem: Scaling.

 

vpu-update-2022-12-posts.thumb.png.58588d44691e8e3c6f4ef3d376f5e9b2.png

 

See, all the assets in the library are real-world scaled. That's because we measure them in the real world, and then model them based on those measurements. It's actually quite important to model at the correct scale, otherwise things will start looking wrong very quickly.

 

VPX, on the other hand, doesn't use real-world units. In VPX, one unit is 0.02125" or 0.53975mm. VPX also uses a Z-up coordinate system, while Unity uses Y-up, so there is rotation involved as well.

 

Until now, we kind of solved that problem by applying a transformation to the top node of the playfield hierarchy, where within that playfield hierarchy, everything is in VPX space. So if you drop a real-world sized object into the playfield hierarchy, Unity automatically applies a transformation to that object so it stays the same as in world space, implicitly applying a world->VPX transformation (while in rendering it gets re-transformed into world space by the playfield top node).

 

But so far we're talking about non-collidable primitives (in VPX-lingo: "toys"). In order to make them collidable, we need to assign them a primitive collider, which exists in VPX space exclusively (remember, VPE uses VPX physics). That means that even though we modeled an object in world space, we need to transform it into VPX space first, in order to make it collidable.

 

So, we were in a situation where we had non-collidable assets like screws that we could model in world-space without too much of a headache, but at the same time, assets like rubber posts that we had to convert into VPX-space.

 

My first approach was to tag assets appropriately. A screw would be tagged as world-space, a rubber post as VPX-space, and they would be transformed accordingly when added to the scene.

 

This became messy quite soon. For example, I created plastic post assets with a single rubber collider, thus in VPX space. But rubbers aren't always attached to a single post, sometimes multiple posts are grouped together through a separate rubber object (e.g. slingshots). Those posts wouldn't have a collider, bringing them to world space. So I would have the same post without rubber, in world space, and with a single rubber, in VPX space. Ugh.

 

Then I had an idea. Why not move the whole playfield into world space, author everything in world space, even render everything in world space, and only keep the physics simulation running in VPX space?

 

It was a bit of a facepalm moment, since I could have done that from the beginning and it would have made many things so much easier. But better late than never, I guess.

 

I think I got the main changes done in about two days and then spend the following two months fixing unforeseen bugs, but also converting our current VPE projects into world space, where even more bugs were found and fixed.

 

Today I'm very happy to announce that in VPE, everything is rendered in world space. You can model your toys in world space, drop it into Unity, and they will be sized correctly, whether they are on the playfield, or not.

 

While converting the VPE tables, I've also spent some time adding more assets to the library. We now have more flippers, nice Gottlieb bumpers and a bunch of other things.

 

vpu-update-2022-12-new-assets.thumb.png.b8a5540cdb719f9772c5a8de1d1ce39b.png

 

Another feature I was working on when doing all the assets are what we call Material Variations. Many items in a pinball machine come in the same shape but different colors or materials. One way to go about that would be to just create a new asset for each material, but then number of assets would explode and the library would become confusing to browse.

 

With a material variation, we assign different materials to meshes or sub meshes to an asset. The asset browser then lists those variations under the same asset. If you add multiple variations to multiple parts of an object, the asset library will compute all combinations between the different parts. For example, a flipper with three rubber variations and three plastic variations will get in total nine rubber/plastic combinations listed.

 

vpu-update-2022-12-material-variations.thumb.png.07b01bc5690156a06ee2be24a9b7e157.png

 

It also works for nested objects. Say you have a plastic post in three colors. If you re-use that post in another asset (let's say, this time with a rubber), the library will automatically list the variations of that first rubber. This is nice, because we then don't need to maintain those variations multiple times if an object is used in multiple assets.

 

I've also started adding the Substance materials I've created to the repository, so anyone can load them into Substance Painter, modify them, and create their own variations.

 

Another change in the asset lib is that tagging now mainly serves as sub navigation. Since there are no sub-categories, and categories can't be nested, you quickly end up with lots of assets per category (for example, there are 145 assets under Hardware now).

 

In order to let creators find what they are looking for more quickly, when you select an category, we'll show all the tags of the selected items, which allows you to drill down into specifics more quickly.

 

vpu-update-2022-12-tag-filters.thumb.png.b1ceb6573787a56ba7fe85793cb16dd1.png

 

You can also quickly combine those. For example, in the screenshot above, we selected both slotted and Phillips screw heads, so it shows those with a combination of both (and yes, that's the only combination that actually gets you any results ;)).

 

Finally, there were lots of minor improvements like thumbnail caching, support for tags and attributes containing quotes, separate UI for showing and editing meta data, and the ability to batch-copy meta data from one asset to other assets. There's now also a button in the toolbox that opens the asset library directly.

 

Flipper Physics

 

@nFozzy and @rothbauerws flipper tricks improvements made it into VPE. We're still figuring out which of the numerous parameters we should expose in the editor, but the feature is working pretty well.

 

Score Motor Support

 

Thanks to @jsm174 and @scottacus we now have accurate score motor simulation. Check out the documentation here and here.

 

Next Up

 

Unity has released version 2022.2 which comes with a lot of nice features, many of them relevant for VPE. The first step to upgrade to 2022 is to migrate to DOTS 1.0, which after all those years has finally dropped, and comes with a ton of improvements.

 

I also want to work on a Tilt Five demo, which I'm particularly looking forward to. Most of the other upcoming things are in my last update.

 

Oh, and I'll try to give y'all an update once a month from now on, since it has been a long time since the last few updates. Even if it's just work in progress.

 

That's it for now. Happy holidays!

 

  -freezy.

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...