godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.07k stars 69 forks source link

Add Rope3D and Rope2D nodes #3704

Open 2nafish117 opened 2 years ago

2nafish117 commented 2 years ago

Describe the project you are working on

fps game inspired by half life 2.

Describe the problem or limitation you are having in your project

I Needed an easy to use and performant rope simulation, either used as dressing around the level or something interactive like cable puzzles or a grapple mechanic.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

An easy to use Rope2D and Rope3D node that can be placed in the scene, scripted for puzzles, physics interactions, grapple. these two nodes can also be used in other 2d/3d games.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

here is a POC implementation, and a brief yt video showing how to use it.

some main features:

If this enhancement will not be used often, can it be worked around with a few lines of script?

A gdscript implementation would not be as performant as a native c++ implementation.

Is there a reason why this should be core and not an add-on in the asset library?

Performance. If not core it probably can also be implemented as a native c++ module.

Calinou commented 2 years ago

I feel this is too game-specific to have as a core feature. Improving built-in soft bodies to allow making ropes may be worthwhile, but dedicated Rope3D/Rope2D nodes are unlikely to be useful in a majority of games.

I Needed an easy to use and performant rope simulation, either used as dressing around the level or something interactive like cable puzzles or a grapple mechanic.

For level dressing, I would recommend using static meshes so you don't have to spend CPU time simulating ropes that will never move.

For grapple mechanics, you generally don't need soft body mechanics – custom code and basic joints are often used here.

A gdscript implementation would not be as performant as a native c++ implementation.

You can use GDNative (or GDExtension in 4.0) to have a faster implementation, while still not requiring core engine modification :slightly_smiling_face:

mrjustaguy commented 2 years ago

This would be a great addition to the Asset Store with 4.0's GDExtension