You can make almost anything that has to do with collisions or physics in general. This makes it easy to make stuff like people’s playground, construction based educational/adventure games, pong games, slither io games, physics based platformers etc.
It all lies within the infinite boundaries of imagination!
It should do well, although I haven’t tested it yet. It may result in the simulations being a bit faster. If you encounter any undesired behavior, you can open an issue in the github repository or alert me here.
Thanks for bringing this up, I’ll make the use of detlaTime (I should have from the start >_<) and push the update sooner or later!
Amazing resource. If something like this was around (or if I was as bigbrain as OP to implement this myself) when I was making my game Calmfall, I would’ve made it 2D! Thank you for the resource OP
This is so amazing! This will enable some really cool things to be done with GUI, such as more natural animations. It will also enable some cool interactions with GUI… like replacing the Backpack GUI with a dynamic item shelf at the bottom of the screen, where items can be dragged around and can be dragged onto other items to interact with them, as well as dragged onto certain 3D things to interact with them (e.g. dragging a key onto a locked door to unlock the door) Cool stuff!
v0.0.2 - Custom Point Support, Configuration Methods and More!
Installation through Wally! Nature2D can now be installed using Wally, the package manager for Roblox. This requires wally to be installed on your device. In order to install Nature2D, add a dependency to your wally.toml file
After you have added the dependency, run wally install in the command line. A “Packages” directory is created containing the library. You can now use Nature2D in your external editor using wally!
Earlier: Simulations running on different frame rates had a difference in their speeds. A simulation running on 60fps would run faster than that of a simulation running at 30fps.
Now: Frame-rate no longer affects simulations. A RigidBody covering a distance of 10 units in a simulation running at 30fps and a simulation running 60fps will take almost the same time to reach the destination.
Note: This hasn’t been tested with multiple kinds of simulations. Thus, if you encounter any unwanted behavior, errors or visual bugs - you can open an issue at the github repository!
I have been messing around with this a little and it’s pretty cool! Although I did run into two issues:
There’s a lot of lag when there is a large amount of RigidBodies (I was able to fix this on my own by editing the collision checking code to only check for collisions on anchored bodies if the other body is not anchored)
If an unanchored RigidBody is in a position where it should seemingly not be moved by physics (on top of an anchored RigidBody, for example), it will be continuously moved by a small amount to the left/right every few frames
This resource would be incredibly useful if these issues were to be fixed!
The large amount of lag is purely due to collision detection. In the next coming updates, I would be switching to quadtrees for iterating through the rigidbodies during collision detection, to make the engine 10 times faster!
The 2nd issue is known, well, to be honest that’s just how verlet integration works! A work around would be to set friction of all rigidbodies stacked on top of each other to 0 (RigidBody:SetFriction()) and then set it back to normal when some other body collides with it, etc. But yes, this is something I wish to fix in the future!
Added new example which covers the concept of creating Custom Constraints, where we create the following simulation of a RigidBody hanging from a rope, and wind forces being applied on it.
In the next few updates, I’ll try to implement Quadtrees in the collision detection algorithm to improve performance and make the library 10 times faster!
engine.Started:Connect(function()
-- fires when the engine starts
end)
engine.Stopped:Connect(function()
-- fires when the engine stops
end)
Documentation Updated
Roblox Model and Github Updated
Wally Package Updated - 0.0.5 → 0.1.0
Check out some stuff I made in the past weekend with Nature2D! The game of Plinko and a weight bearing flexible bridge by connecting RigidBodies with constraints!
Quality updates soon. Next updates will be regarding the implementation of quadtrees in collision detection. If anything breaks, open an issue at the github repository!