Code Monkey home page Code Monkey logo

Comments (3)

ravarcade avatar ravarcade commented on May 14, 2024

Background
The possibility of comparing two physics engines gives a chance to improve both. So I started looking for an alternative. The first 2 attempts have been a failure. Both Unity's default physics and DOTS Physics have many problems with the collision between a fast-ball and a fast-flipper. Also, simple ball stacking gives unstable behaviour. It may be possible to overcome that obstancles, but that would take a lot of time.

Bullet Physics
First tests looks good. Without any tweaking ball-flipper interactions looks realistic. Not same as VPX, but not bad. Portability looks good, linux, ios, osx, android are supported. Performance is ok too. I can put few more stacked balls than in current VPX physics. It doesn't mean VPX is slower, just that particular case is slow in VPX. For now it is also worst case scenario.

Current status

  • we have first version of comunition interface between VPE Core and external physics engine (and with DebugUI too). This interface is probably not in finall form, but for start it is enought.
  • basic ball - flipper or static object collisions works.
  • manual ball roller for testing works... Well it is crucial tool to check models shape when debug draw of physical shapes don't work.
  • flipper params are accessible to DebugUI. Few charts usefull in tweaking/debuging works fine. They are also accessible for VPX physics. Here is first place when we can compare both.
    BulletPhysics-monitoring

Guidlines

  1. A new Unity package containing a physics engine is added to the Unity project

Adding Bullet Physics is as simple as adding VPE to Unity. See instuction on my BulletPhysics repo.

  1. The editor somehow allows to select the desired engine (preferably on per-table basis, somewhere in the table inspector)

It is matter of one click in inspector to enable/disable Bullet Physics:

  1. If the (default) VPX engine is chosen, the other engine(s) should be invisible (not called at all in the game loop)

It works like that. There is one thing to remeber. Bullet physics code will be added to builded VPE. It will be possible to select engine later, when builded VPE will be executed.

  1. If another engine is chosen, the VPX engine should be completely disabled (no systems active).

Right now Bullet Physics will disable ECS systems used by VPX on start.

  1. Each engine can be configured somehow, by the table (i.e. at runtime)

It is easy to add single switch and gives table-dev decision witch physics should run.
My goal is to minimize number special params for object when different physics is selected. Just to avoid confusion.

  1. The overhead should be minimal

In most cases, code required to select different physics engine, will be not in performance critical parts. So, it should not create a problems. Also adding more physics engines to chose will not make difference.

from visualpinball.engine.

freezy avatar freezy commented on May 14, 2024

PRs concerning this:

from visualpinball.engine.

freezy avatar freezy commented on May 14, 2024

Closed by #66.

from visualpinball.engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.