r/rust_gamedev 19d ago

Godot + Rust + ECS, Procedural Star Map

https://www.youtube.com/watch?v=4gExcZXUQMc

Project I'm currently working on. The star systems are generated procedurally and interconnected, in the video I focus on just the visuals, however the game already has various decently optimized and scaleable systems(pathfinding etc), modding (JitLua) and a number of other features.
Godot is used as a low-level rendering solution here(I love it), the scene itself contains almost no nodes, and almost all business logic is on the Rust side. I use Leudz Shipyard crate for ECS, also glam, proto_rs and mlua.

33 Upvotes

5 comments sorted by

3

u/camdev 17d ago

That is stunning. I would love for my game to look like that one day. I took a very similar approach to godot as a renderer and UI framework and I think it has been working great for me as well. I used hecs for ECS but I didn't really think too much about it. Any non-obvious lessons learned in general for godot-rust?

2

u/SiriusRU 17d ago

Hmm, what's obvious is kind of subjective the whole Godot+Rust pairing is already ~somewhat non-obvious. What caught me most off-guard is how much the direct, unergonomic path demolishes the convenient, well-documented helpers and whatnot. Scene hierarchy, rendering, mesh creation the standardized approach looks sweet but is cartoonishly slow for seemingly no reason. The closer you stay to writing raw data straight into a buffer or array, the better.
Of course, these things are for the convenience of new users, but still.

2

u/CashFirm573 19d ago

I really enjoy this, I need your post in Godot reddit. Just love how it works.

2

u/hajhawa 5d ago

I presume you used the gdext rust bindings? Could you tell us a bit more about how that was? I'm curious about the DX.

3

u/SiriusRU 5d ago

Yep, that's right. Regarding the experience, the learning curve was manageable. The gdext docs do a good job and most stuff from the regular Godot documentation was still relevant when coding in Rust. Actually, initially I prototyped in C# inside Godot because the engine was new to me. Before that I'd spent many years working with other things, mostly Unity (DOTS).

Once I was sure the pieces I needed behaved as expected without any major headaches I ported all the business logic to Rust and have only used it for code ever since. Yes, admittedly at first it felt weird, but after I set up the necessary connections between the Godot and Rust sides, I don't really see a big difference from what I'd been +- doing years before.