Jump to content



Photo
* * * * * 26 votes

WIP: Visual Pinball in Unity


  • Please log in to reply
813 replies to this topic

#481 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

  • Flag: ---------

  • Favorite Pinball: T2, TOM, AFM

Posted 24 August 2020 - 08:29 AM

Thanks Ben, I've missed this thread completely.

 

For me it looks like you guys have spent hours and hours of observing real-world behavior, even have some formal approaches ready (e.g. spring physics), but don't have the courage to dive into VP's C++ code to test them out. And I don't blame you, VP's code base is large, files are huge, and you have to deal with stuff like memory management that are hard (even if you have a computer science background).

 

But maybe we can get you guys writing code for VPE (and get it back into VPX later, of course). C# is managed, so you don't have to deal with memory and it's much more beginner-friendly in general. Additionally, the VPE code is split into more (a lot smaller) files, has a data-oriented design (as opposed to VP's object-oriented design), so you should find relevant code more quickly.

 

I've written some prose a few months ago about how internally VP deals with physics. I think that's a good starting point. You can read it here. I'd like to extend this documentation to the point where it's clear where to look if you want to let's say change the rubber collision code to use spring physics. If you can help me do that (i.e. bombard me with questions, and I'll incorporate the answers into a documentation), that would be a first step into that direction. Those among you who prefer Discord and aren't already on our server, let me know.


Edited by freezy, 24 August 2020 - 08:32 AM.


#482 batman444mab

batman444mab

    Neophyte

  • Members
  • Pip
  • 7 posts

  • Flag: France

  • Favorite Pinball: theatre of magic

Posted 24 August 2020 - 05:13 PM

Hi,

 

I would like to thank all of you guys that are working for such a project. I am following this thread since day one and have tested table import via unity. That's so good to see how simple it is.

One thing that differenciate VPX from real pinball machines is the ball size. VPX has lots of tables that gives you a too small ball size. Does it change the overall physics ? The way we're playing the game ?

Another thing is the ball motion is very linear. When we look at a real pinball machine the ball speed is changing very quickly and slows down very fast before dropping as the ball is made of metal.

I agree that the bouncing needs to evolve. Lots of videos on youtube on pinball79 channel are available. You can play it 1080p vertical on your cabinet to get a sens of full size motion.

It might be usefull to study ball motion via a tracking analysis software like : https://physlets.org/tracker/ or another one that i forgot. I don't even know how it works but i can try having speed, velocities etc

If DOTS physics engine allows tweaking, you can get very close to it. It would be nice getting Discord forum access btw ?



#483 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

  • Flag: ---------

  • Favorite Pinball: T2, TOM, AFM

Posted 24 August 2020 - 08:01 PM

Hi!

 

I'm not sure about ball size. We have an issue about handling real-world units correctly here, maybe it will solve a few things when the rest of the table is imported with the correct dimensions.

 

The Physlets thing looks very cool! Could definitely be useful.

 

Technically we're not using DOTS physics (which is Unity's own physics implementation in DOTS), but VPX physics ported to DOTS. That still means it's tweakable of course.



#484 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 25 August 2020 - 06:00 AM

I've written some prose a few months ago about how internally VP deals with physics. I think that's a good starting point. You can read it here. I'd like to extend this documentation to the point where it's clear where to look if you want to let's say change the rubber collision code to use spring physics. If you can help me do that (i.e. bombard me with questions, and I'll incorporate the answers into a documentation), that would be a first step into that direction. Those among you who prefer Discord and aren't already on our server, let me know.

 

One thing that immediately sticks out: For static objects, actually a quadtree is used. The kd tree is only used for dynamic objects (i.e. balls).

Due to the 2d-ish nature of pinball tables, a quadtree on the average works faster (especially as one can also easily optimize it using SIMD/SSE) than an octree or a full 3D/kd tree (at least in all my performance experiments back then), except for cases where one has a lot of geometry 'on top of each other', like its the case for 4-wire primitive ramps, for example (which in some tables can be seen as micro-stutter in some places and can be tracked down via the table stats/F11).

 

As for the units problem: This is also an old one, which was renovated during the PM5 days. The preferred solution would be to convert everything up front on table load to finally get rid of the internal unit system, but here there were also problems regarding all those damn heuristics within the physics code, as these then didn't match up then anymore.  :/



#485 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

  • Flag: ---------

  • Favorite Pinball: T2, TOM, AFM

Posted 25 August 2020 - 06:47 AM

I'm pretty sure that k-d tree is the overall term. Both quadtrees and octrees are k-d trees. The "k" is actually the number of dimensions.

 

I know that in the code one is called kdtree and the other quadtree, and it's confusing ;)

 

About the units problem: If VP breaks BC by changing units, VPE will do the same. The current plan is to adapt units during import and keep VP's units internally (maybe adapt the fields to real-world units and convert on the fly).



#486 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 25 August 2020 - 08:01 AM

One can use kd tree as the overall term, yes, but nobody in computer graphics/physic simulations will assume that you also mean a quadtree or an octree or anything else with it.  ;)

(for ray tracing, kd tree ALWAYS assumes spatial splitting without restrictions and k is ALWAYS 3, whereas a quadtree has k=2 and enforces uniform splitting, etcetc  ;)).

Its a terminology mess, that again evolved historically (say thanks to one of my ex bosses for that ;)).

 

Btw: In the VP code its historically even more confusing as there the quadtree is still called octree for whatever reason ;)  (which i should change finally i guess ;))



#487 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

  • Flag: ---------

  • Favorite Pinball: T2, TOM, AFM

Posted 25 August 2020 - 08:04 AM

Thanks, learnt something new :)

 

Let's call them quadtree and octrees to be clear!



#488 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 25 August 2020 - 08:21 AM

As for the units: I think thats the best approach, convert externally, and use internally the VP units (for now).



#489 hitman2304

hitman2304

    Enthusiast

  • Members
  • PipPipPip
  • 129 posts
  • Location:Poland

  • Flag: Poland

  • Favorite Pinball: AFM,Monster Bash,Medieval Madness,TOM.

Posted 26 August 2020 - 07:29 AM

I am glad that everything is going in the right direction, but I am concerned about these problems with the GPL license.



#490 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

  • Flag: ---------

  • Favorite Pinball: T2, TOM, AFM

Posted 26 August 2020 - 08:04 AM

You seriously want to start a discussion about that here?

 

Comment on the GitHub issue please if you there's something more particular you want to know.



#491 Robsoie

Robsoie

    Enthusiast

  • Members
  • PipPipPip
  • 65 posts

  • Flag: ---------

  • Favorite Pinball: Addams Family, Goldorak, Flash Gordon

Posted 31 August 2020 - 11:52 AM

A question about performance.

 

on window 10 , microsoft upgraded its security with AMSI  :

https://www.vpforums...30

 

On tables that have many events (fortunately only some of them are so event heavy), throwing then VBS scripts snippet all around in the communication between VPX and VPinmame, it triggers that AMSI thing so much that it creates stutter on those kind of tables, stutter that will go away if you disable security programs like the window 10 built-in window defender that use this AMSI (make sure to not be connected to the internet when doing that) .

 

If VPE continue to use VBS scripts, will this situation happen in VPE too ?


Edited by Robsoie, 31 August 2020 - 11:53 AM.


#492 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

  • Flag: ---------

  • Favorite Pinball: T2, TOM, AFM

Posted 31 August 2020 - 12:09 PM

There are many options for scripting, but ultimately we would want to find a balance between drastically reducing scripting in general, provide pre-made components that can be configured in the editor, give coders a way to create new or override these components on a per-table basis, and swap the entire table logic by a plugin (mpf, p-roc, etc). Also we want to keep cross-platform compatibility as long as possible (we might allow plugins to break it, but the core should be platform-agnostic).

 

This pretty much eliminates everything but C# and would result in compiled scripts without any scripting host.

 

Long story short, no, I don't think that'll be an issue.



#493 gStAv

gStAv

    Pinball Lover

  • Members
  • PipPipPipPip
  • 1,331 posts

  • Flag: Sweden

  • Favorite Pinball: TOM, IJ, AFM, WC94

Posted 27 September 2020 - 09:00 AM

any news about this project team? I check this thread on a daily basis, so sorry for naggin but could not stand it any more :D

Keep it up and stay safe  :otvclap:


3rs054-6.png


#494 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

  • Flag: ---------

  • Favorite Pinball: T2, TOM, AFM

Posted 27 September 2020 - 09:34 AM

Yeah sorry for the lack of updates. I've mostly spent time fixing physics bugs and working on performance, so nothing too sexy to present. However lately I've been fiddling around with a logo, but not too sure if it's going to do it:

 

unknown.png

 

unknown.png

 

Anyway, if you want to get updated on progress, I suggest you watch the GitHub repo, (click on the "watch" button at the top right) that way you'll get email notification when someone creates a pull request or features go upstream.

 

There are a few very cool things on the way, and I'll talk about them when they are done and merged :)



#495 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,859 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 27 September 2020 - 10:04 AM

Yeah sorry for the lack of updates. I've mostly spent time fixing physics bugs and working on performance, so nothing too sexy to present

 

 To heck with logos, lets hear about the physics calcs, what you mean not sexy?

 

Whats more sexy than physics?
lxdFV32.jpg


If you feel the need to empty your wallet in my direction, i don't have any way to receive it anyways

Spend it on Hookers and Blow


#496 vogliadicane

vogliadicane

    Pinball Fan

  • Members
  • PipPipPipPip
  • 517 posts
  • Location:Velbert

  • Flag: Germany

  • Favorite Pinball: The Addams Family

Posted 27 September 2020 - 02:29 PM

I love this logo!  :otvclap: 



#497 3rdaxis

3rdaxis

    Pinball Fan

  • VIP
  • 718 posts

  • Flag: United States of America

  • Favorite Pinball: The Addams Family

  • PS3 Gamer Tag: Thirdaxis01

Posted 29 September 2020 - 02:28 AM

I'm in:) 

untitled0.png



#498 Slydog43

Slydog43

    Pinball Wizard

  • Platinum Supporter
  • 3,008 posts
  • Location:Hackettstown, NJ

  • Flag: United States of America

  • Favorite Pinball: Addams Family, All Williams 90's Games

Posted 29 September 2020 - 02:29 PM

Its about time



#499 TouchMaster97

TouchMaster97

    Enthusiast

  • Members
  • PipPipPip
  • 153 posts

  • Flag: Netherlands

  • Favorite Pinball: Haunted House

Posted 30 September 2020 - 01:40 PM

I'm getting more curious lately: Are there any Prototype or Alpha versions of this Visual Pinball Unity program? Or do we need to wait a few more months?



#500 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

  • Flag: ---------

  • Favorite Pinball: T2, TOM, AFM

Posted 30 September 2020 - 01:57 PM

Nothing for players to test yet I'm afraid. A few more months sounds about right. Authors however I encourage to have a look!