Skip to content

Falloff Map Expansion#602

Open
cullumi wants to merge 13 commits intogaea-godot:2.0from
cullumi:falloff-map-expansion
Open

Falloff Map Expansion#602
cullumi wants to merge 13 commits intogaea-godot:2.0from
cullumi:falloff-map-expansion

Conversation

@cullumi
Copy link
Copy Markdown
Collaborator

@cullumi cullumi commented Mar 30, 2026

Falloff Map Expansion

Aims to close #591 ( plus #604, #603 and #590 by extension )

Improvements

Adds support for the following:

  • Falloff Area configuration: Chunk, World and Custom (w/ position and size pins)
  • 3D falloff generation
    • Automatically stretches based on the provided area. So, an area z axis size of 1 would represent a 2D falloff map. A rectangular area w/ Circle as the Falloff Shape would yield an oval or capsule-like shape.
  • Custom falloff curves
    • Required support for curve resources.
  • Constant axes
    • The ability to produce falloff cylinders, rectangular prisms, sheets and the like by simply checking some x/y/z boxes.

Also adds:

  • GaeaCurve parameter resource
    • GaeaCurve abstract base w/ sample, sample_2d and sample_3d functions.
    • GaeaCurveScalar, GaeaCurve2D, and GaeaCurve3D
      • Includes value aggregation.
        • For example, if a GaeaCurve3D is asked to produce a scalar result with the sample(offset) method, it could return its sampled vector's x, y, or z values, or it could return the average of the three.
      • Includes value defaults.
        • For example, if a GaeaCurveScalar is asked to produce a Vector3 result with the sample_3d(offset) method, it returns a vector with exported y and z values.

Also fixes:

  • A bug where the preview panel didn't actually use the correct world size in generation. Its generator settings' world size was set to the preview chunk size instead.

Examples

Examples of what is now possible using these upgrades. The "noisy" edges are simply there to give a clearer sense of the ends of the falloff map itself. There is a green circle made with a Distance Filter at the center to show a common reference point.

World Area, Circle, Restrict X
image

Chunk Area, Circle, Restrict X and Z
image

Chunk Area, Rounded Square, Restrict Y
image

Custom Area, Squircle, Position (16, 0, 16), Size (32, 48, 32)
image

@cullumi cullumi added this to the v2.0.0-stable milestone Mar 30, 2026
@cullumi cullumi self-assigned this Mar 30, 2026
@cullumi cullumi added the ✨ enhancement New feature or request label Mar 30, 2026
Copy link
Copy Markdown
Collaborator

@Zehir Zehir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am quite lost with this node now it's not that easy to use. For the curve I would only use a single 1D curve, why do we need 3d curve ? I can't think of what that should look like

return [&"start", &"end"]
match get_enum_selection(0): # Faloff Area
FalloffArea.CUSTOM_AREA: return [&"position", &"size", &"curve", &"restrict_x", &"restrict_y", &"restrict_z", &"start", &"end"]
_: return [&"curve", &"restrict_x", &"restrict_y", &"restrict_z", &"start", &"end"]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, for better readability, the added property should be in an if statement instead of having almost the same list twice

Comment thread addons/gaea/runtime/graph_nodes/root/sampling/generation/falloff_map.gd Outdated
Comment thread addons/gaea/runtime/graph_nodes/root/sampling/generation/falloff_map.gd Outdated
Comment thread addons/gaea/runtime/resources/curves/data/curve_2d.gd Outdated
@@ -0,0 +1,25 @@
@tool
class_name GaeaCurveScalar
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use the name GaeaCurve1D instead

Suggested change
class_name GaeaCurveScalar
class_name GaeaCurve1D

RANGE = 100,
MATERIAL = 101, ## A [GaeaMaterial].
TEXTURE = 102, ## A [Texture].
CURVE = 103, ## A [GaeaCurve]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's would be easier to have 3 types, a curve 1D, 2D and 3D like vectors class. I find it confusing because the node may be expecting one of the other and you may now know what type you need.

return 1.0
&"position": return Vector3.ZERO
&"area": return Vector3.ONE
&"curve": return null
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to provide some kind of default value

return "FalloffMap"


func _get_description() -> String:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the description with the new properties ?

@@ -8,104 +8,85 @@
## For lower [param end] values, the generated 'square' will be smaller.[br]
## Multiplying this with a [GaeaNodeSimplexSmooth]'s generation can create island-looking terrains.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should split FalloffMap for 2D, I was not able to get the previous beavior of the node. How do I generate this ?

Image

I am often getting a black square, not sure why; (added this node in the walker demo for a 2D env)

Image

Can you add migration for the node and change the UID of the new falloff node ?

Sometime I am getting this error;

  ERROR: res://addons/gaea/editor/graph/preview_texture.gd:62 - Invalid assignment of property or key 'visible' with value of type 'bool' on a base object of type 'Nil'.

func _get_enum_options(idx: int) -> Dictionary:
match idx:
0: return FalloffArea
1, _: return FalloffShape
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1, _: return FalloffShape
_: return FalloffShape

cullumi and others added 3 commits April 13, 2026 21:08
…ff_map.gd


Changed "/ 2" to "* 0.5"

Co-authored-by: Zehir <zehir@zorim.fr>
…ff_map.gd


Removed print used for debugging

Co-authored-by: Zehir <zehir@zorim.fr>
Changed "/ 2" to "* 0.5"

Co-authored-by: Zehir <zehir@zorim.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Falloff Map Axis Constraints Curve / Curve Parameter Support Falloff Map Expansion 3D Falloff Map

2 participants