[V1] Integration of BEPUphusics V1 To Unity

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
UmairAndTalha
Posts: 5
Joined: Fri Nov 20, 2020 11:25 am

[V1] Integration of BEPUphusics V1 To Unity

Post by UmairAndTalha » Fri Nov 20, 2020 11:40 am

Hi,
We are developing a physics based game in Unity. We are fairly new to coding and we need cross platform determinism. After some deep searching we found out that Unity's physics engine is not cross platform deterministic. So after that we found out that BEPU is.....
So Is BEPUphysics V1 cross platform deterministic??
And How to integrate BEPU with unity ..
Kindly if someone can give us a direction It will be greatly appreciated..
Thanks :)

Norbo
Site Admin
Posts: 4928
Joined: Tue Jul 04, 2006 4:45 am

Re: [V1] Integration of BEPUphusics V1 To Unity

Post by Norbo » Fri Nov 20, 2020 7:50 pm

The fixed point fork of bepuphysics1 is supposed to be cross platform deterministic, but I didn't make that fork and haven't used it so I can't offer much commentary there. I also don't use unity, so I'm of limited help- but at the core, there's not much to it. There's stuff in a simulation, you can read its position and orientations and apply that to other game entities, and so forth. I would recommend playing around in the demos or looking at the getting started documentation to get a general idea of how stuff works.

I may suggest rethinking the requirement for cross platform determinism, especially if you're new to the field. It will make almost everything you write more complicated. The space of possible bugs is enormous, and you'll have to bend over backwards while doing gymnastics to guarantee correctness sometimes. Cross platform determinism typically comes down to bandwidth optimization, but there are other ways to optimize bandwidth. Even Planetary Annihilation, for example, doesn't use the usual RTS lockstep deterministic networking.

UmairAndTalha
Posts: 5
Joined: Fri Nov 20, 2020 11:25 am

Re: [V1] Integration of BEPUphusics V1 To Unity

Post by UmairAndTalha » Mon Nov 23, 2020 7:21 am

Thanks for the reply!!!
The Game we are developing relies on Cross Platform determinism and solely on the physics engine. We cannot implement any lockstep networking framework. We have achieved per architecture determinism using only Unity and its physics engine, but our game requires cross platform determinism which can only be achieved through FIXED-POINT-Math. We are trying to implement BEPUphysicsint v1.
https://github.com/sam-vdp/bepuphysics1int
Any other insight i.e.(references, on how to implement it to UNITY) would be greatly appreciated :)

Norbo
Site Admin
Posts: 4928
Joined: Tue Jul 04, 2006 4:45 am

Re: [V1] Integration of BEPUphusics V1 To Unity

Post by Norbo » Tue Nov 24, 2020 10:36 pm

Other than the standard recommendations I already mentioned (play around in the demos and look at the documentation to get a feel for how things are set up), I don't have much to add, especially with respect to unity integration. If you have a specific non-unity question, I might be able to help more.

UmairAndTalha
Posts: 5
Joined: Fri Nov 20, 2020 11:25 am

Re: [V1] Integration of BEPUphusics V1 To Unity

Post by UmairAndTalha » Fri Nov 27, 2020 7:07 am

Thanks for recommending the demos. I was able to successfully integrate BepuPhysicsIntV1 into Unity and achieve cross platform deterministic results!! :D

My next task will be to implement multiple colliders on a single rigid body, if you have any expertise in that area I would greatly appreciate any help!! Thanks AGAIN!!

Norbo
Site Admin
Posts: 4928
Joined: Tue Jul 04, 2006 4:45 am

Re: [V1] Integration of BEPUphusics V1 To Unity

Post by Norbo » Fri Nov 27, 2020 6:18 pm

Using a CompoundBody (which is v1's named entity type for an entity with a CompoundShape) would work: https://github.com/bepu/bepuphysics1/bl ... iesDemo.cs

Post Reply