Dreaming381 / Latios-Framework

A Unity DOTS framework for my personal projects
Other
935 stars 85 forks source link

Question: Can the framework be used in conjunction with Unity Dots Physics/Havok? #35

Closed Morphexe closed 1 year ago

Morphexe commented 1 year ago

I have been following the development of this framework for a while, and I finally got the time to start seeing the innards of the framework :).

My question is , after looking at the new transform system, it seems like this will be 100% incompatible with the Physics System present on Unity.

Rigid body interaction is a big part of one of the projects, and I would love to know if there is a way to get it to work side by side with framework, or do you think the time would be better invested in actually writing one from the ground up? There are some OSS options that one could use as inspiration (rapier from RUST comes to mind for example as base line).

Dreaming381 commented 1 year ago

So first off, the 0.8 alpha that is being developed has a mode which supports Unity Transforms. You enable it via the LATIOS_TRANSFORMS_UNITY scripting define. This mode works with Unity/Havok Physics.

Second, if you look at the commit history of both the 0.8 prerelease branch and the documentation repo, you'll see I have already begun developing a rigidbody simulation inside of Psyshock. There's still a ways to go, but you certainly wouldn't need to start from ground zero. This simulation will start out behaving very similarly to Unity Physics. But it will be significantly more modular, support QVVS Transforms (including stretch), and respect the transform hierarchy.

If you don't care about the performance or expressiveness benefits of QVVS Transforms, then my suggestion would be to use 0.8 in Unity Transforms mode.

But if you do care about those things or just want a significantly more customizable physics engine, I would very much appreciate any assistance on Psyshock's development.

Morphexe commented 1 year ago

I literally just checked out that branch for the 0.8.0 it looks great! I am going to have a play around with it, and maybe can contribute something to the simulations bit if you are open to it. I was navigating your Psyshock bits like 10 mins ago, and thats what prompted me to come to thread since I was going to mention I saw that there is compatibility plus you have simulation in the works!!!

QVVS are great, I going through the whole documentation repo as of now to get this more in scope, there is no reason not to use this right now me. So I will just wrap my head around what you have and see if there is anything I can help with. With that in mind, is there any particular area that you feel would be a good place for starting to contribute?

Thank you for the reply!

Dreaming381 commented 1 year ago

I appreciate the enthusiasm.

My next step with Physics simulation is contact generation leveraging the feature codes I just implemented. However, I don't want to wish that upon anyone else, as that's 49 different collider pairs to reason about. And worse yet, it will be a few weeks before I can look at it.

I think the best starting point for you would be to play around with the collider types and collision detection (FindPairs, DistanceBetween, and ColliderCast) already in Psyshock. They may take some getting used to. And triangles and trimeshes are very experimental, so there's probably bugs there you are welcome to report.

On top of that, keep an eye on Free Parking: https://github.com/Dreaming381/Free-Parking That's a new initiative designed to lower the barrier for people besides myself to discover and experiment with existing features as well as help develop new ones. I'll be uploading a guide there sometime within the next seven days on how to create a "dev dungeon".

Lastly, spheres only generate a single contact with any other primitive collider type, and all necessary information should be provided by ColliderDistanceResult. I believe it should be possible to prototype a solver that allows a sphere to roll down a ramp using only public Psyshock API and custom simulation code. Rotation in rigidbody physics is something I still haven't fully made sense of yet. So having that in place would be very valuable as a foundation and/or reference.

Also, if you decide at any point that building a physics simulation is too much for you, don't sweat it. Using the 0.8 alpha and reporting any potential bugs is already a huge help to me.

Lastly, while I do try to be responsive here, I am much more responsive on Discord. https://discord.gg/DHraGRkA4n Feel free to chat in that server or use the server to find me and DM me. I'm still learning the whole rigidbody physics thing myself, but I will do my best to answer whatever questions you may have!

Thanks for reaching out!

Dreaming381 commented 1 year ago

Latios Framework 0.8 is out. Closing as the original question is resolved with this release.