cuberact-library

GDExtension for Godot 4.5+

GDExtension GDScript Open Source Examples Godot 4.5+

A growing collection of GDExtension components for Godot 4.5+. Check the installed version at runtime: CuberactLib.get_version()

New in v1.1.0

  • Sleep system: settled ropes skip simulation and run only a cheap watchdog, a big saving for scenes full of ropes.
  • Red-black constraint solver (now the default): up to 10x faster substeps on long ropes.
  • CRopeWorldGravityForceMod: follows your project's 2D gravity, including runtime changes.
  • Gradient coloring on the direct renderer.
  • Six new showcase scenes, for 17 in total.
Full changelog →

Supported Platforms

macOS (universal) Windows (x86_64, arm64) Linux (x86_64, arm64) Web (wasm32)

Installation

Option A - Godot Asset Library
Install directly from the Godot editor's AssetLib tab.

Option B - GitHub Release
Download the latest ZIP from Releases, extract cuberact-library/ into your project's addons/ folder, reopen in Godot.

Option C - Clone the full repository

git clone https://github.com/cuberact/godot-cuberact-library.git

Links

CRope2D

2D Rope Physics Simulation

CRope2D jellyfish scene - bioluminescent bells drifting over a seagrass meadow

2D rope physics simulation built on Verlet integration. Supports collisions, anchoring, and a modular system for forces, rendering, line processing, and breaking.

CRope2D (Node2D)
├── data: CRopeData              - point positions, segment length
├── anchors: CRopeAnchor[]       - attach rope points to nodes
├── force_modules: CRopeForceMod[]   - gravity, wind, magnets, custom
├── line_modules: CRopeLineMod[]     - smooth, simplify, subdivide, custom
├── break_modules: CRopeBreakMod[]   - tension break, custom
└── render_modules: CRopeRenderMod[] - direct, Line2D, debug, custom

Key Features

  • Verlet integration with configurable stiffness and damping
  • Red-black constraint solver, up to 10x faster on long ropes
  • Sleep system that skips simulation for settled ropes and wakes on disturbance
  • Collision support (StaticBody2D, RigidBody2D, CharacterBody2D)
  • Anchor system with two-way physical interaction on RigidBody2D
  • Modular architecture - forces, line processing, breaking, and rendering are all interchangeable modules
  • Custom modules in GDScript - no C++ required
  • Debug probe for performance profiling

Built-in Modules

Force Modules

  • CRopeGravityForceMod - constant gravity
  • CRopeWorldGravityForceMod - follows the project's 2D gravity
  • CRopeWindForceMod - oscillating wind
  • CRopeMagnetForceMod - attract/repel toward a node

Line Modules

  • CRopeSmoothLineMod - Laplacian smoothing
  • CRopeSimplifyLineMod - Ramer-Douglas-Peucker
  • CRopeSubdivideLineMod - Chaikin subdivision

Render Modules

  • CRopeDirectRenderMod - lightweight canvas draw
  • CRopeLine2DRenderMod - Line2D with gradient & material
  • CRopeDebugRenderMod - tension, forces, velocity overlay

Break Modules

  • CRopeTensionBreakMod - breaks when stretch exceeds threshold

API Reference

Full documentation of all properties, methods, and signals is available in the CRope2D API Reference on GitHub. The same documentation is also built into Godot's editor help system.

17 Example Scenes

The set ranges from polished showcases to focused feature demos: a bioluminescent jellyfish opener, a plug-the-wires mini-game, a kite in gusty wind, growing sunflowers, a firefly meadow, then gravity and magnet forces, simplify and subdivide line processing, custom GDScript render modules, a debug overlay, rope breaking, a pendulum, a sandbox playground, a grappling hook, a stress test, and a grand curtain finale.

Jellyfish scene - bioluminescent bells drifting over a seagrass meadow Plug the Wires scene - colored cables dragged into matching sockets Kite scene - a figure flying a kite with fluttering ribbon tails Growing Sunflowers scene - rope stems growing and leaning toward the sun Firefly Meadow scene - fireflies on thin glowing tethers at night Grand Curtain scene - a theater curtain of rope strands revealing the logo

Try it in your browser

All 17 example scenes running directly in the browser via Godot's web export.

Web demo →

Changelog

v1.1.0

Latest

June 16, 2026

Added

  • Rope sleep system. A settled rope skips the whole simulation and runs only a cheap watchdog until something disturbs it (a moved node or anchor, changed forces, or a collider entering its bounds). New API: sleep_enabled, sleep_tolerance, sleep_frames, sleep_min_awake, is_sleeping(), wake(), and the slept / woken signals.
  • CRopeWorldGravityForceMod. Zero-config force module that follows the project's 2D gravity every frame, including runtime changes.
  • Red-black constraint solver. Up to 10x faster substeps on long ropes, and now the default. The sequential solver remains available.
  • Gradient on CRopeDirectRenderMod. Colors the rope along its length, sampled by arc length.
  • CRopeData.get_rect(). Bounding box query for the rope points.

Changed

  • Per-second damping. Frame-rate and substep independent. The default changed from 0.4 to 0.6, so re-tune any explicit damping values.
  • Red-black is the default solver. Slightly more elastic at the same iterations; raise iterations or switch to sequential for the old stiffness.
  • Debug renderer renames. draw_overlay (was draw_debug_overlay) and wake_color (was debug_overlay_color), plus a new sleep_color and an AABB section.

Examples

  • Reworked the example project: new showcase scenes (jellyfish, plug the wires, kite, growing sunflowers, firefly meadow, grand curtain), older single-feature scenes removed, everything renumbered (17 scenes total).
Fixes and performance

Fixed

  • Crash safety for freed anchor and attractor nodes, and for out-of-range break indices.
  • simulate() is safe against data mutation from signal handlers and force modules.
  • Break modules run on current-frame data, so a break no longer loses a simulation step.
  • A rope created over existing data no longer starts with stale velocities.
  • break_at no longer spawns dead single-point ropes and rejects invalid segments.
  • Anchors with an index outside the rope data are treated as inactive.
  • The anchor target node is cached per rope instead of on the shared anchor resource.
  • Physics space state is refreshed each frame instead of cached forever.
  • The wind time accumulator wraps to the wave period to avoid float precision loss.
  • create_path_by_count enforces a minimum segment length on degenerate paths.
  • The mesh builder guards zero width, clamps tile_aspect, and fixes round-joint preallocation.
  • A warning is emitted when a CRope2D enters the tree with an unsupported scale.

Performance

  • Skip the local-to-global transform for unchanged ropes and materialize prev_points lazily.
  • Skip rope sections and anchor pull when no RigidBody2D consumes them.
  • Skip pinch detection for points near a single collider.
  • Reuse scratch buffers across the line modules and the debug renderer.
  • Squared-distance math in simplify and magnet, and raw-pointer geometry writes in the mesh builder.

v1.0.0

March 4, 2026

Added

  • CRope2D node: Verlet 2D rope physics with configurable stiffness and damping.
  • Collision support (StaticBody2D, RigidBody2D, CharacterBody2D).
  • Anchor system (start, end, both, none).
  • Modular architecture with four module types: force, line, render, and break.
  • Platform support: macOS, Linux, Windows, Web.
  • 13 example scenes and 10 custom GDScript module examples.
  • Complete API documentation.

License

Free for learning, prototyping, and game jams. A paid license is required when you publish a game. See LICENSE.md for full terms.