Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | pmorim |
I am trying to create an advanced Falling-Sand simulation (like Noita) in Godot with GDScript. I’m waiting on Godot 4.0’s GDExtension to rebuild this demo with Rust, but until then I’m using GDScript and slowly learning how to use this engine.
As I expected from the start, I quickly outgrew the built-in Tilemap
and its capabilities, so I decided to use a Texture
to draw the pixels and create a custom Grid
system.
But for this game to be any fun, a Player KinematicBody2D
(and other bodies) needs to be able to collide with this pixel-simulated world. Thus, I’m scratching my head around the idea of somehow converting the pixel “areas” into a CollisionPolygon2D
. But how would I do that?
I didn’t find any solutions to this online, so I asked OpenAI’s ChatGPT about this and it told me to use the generate_sdf()
and convex_decompose()
methods of the SDF
class, but I can’t seem to find any reference to an SDF
class in the documentation.
How would you approach this problem?
Is this task even feasible?
Would it even be performant (with multi-threaded chunks)?
Should I consider building my Grid system in another way?
Or would it be simpler to just build my project in another (perhaps lower-level) engine?
Thanks!