TitanNano

joined 2 years ago
[โ€“] TitanNano@vger.social 2 points 2 months ago

what are the benefits to using it in Godot?

Primarily performance and type safety. You can get some type safety with typed GDScript, but it doesn't really compare to Rust. You also get all the language constructs for free and access to the entire Rust ecosystem, as you can depend on basically any crate you like.

Does the game run any faster than if it were programmed in CO# or GD script?

Yes, you can get more performance out of your CPU-intensive code compared to GDScript. If you have complex calculations or a large amount of data to process, you will fare better with Rust. The interoperability between Rust and GDScript is also quite good, so you can mix and match as much as you like. I can't really say how it compares to C#, as I have never tested it myself.

Is web more stable with it?

I'm not sure what you mean by more stable, but web exports are possible, which is not currently supported with C#. Rust also does not rely on a runtime like C#, which should give you a smaller export size compared to C#.

 

cross-posted from: https://vger.social/post/37291894

godot-rust goes into the next round with v0.5, just released on crates.io!

On the toolchain side:

  • We now support Rust edition 2024 and Godot 4.6 out of the box, as well as all versions >= 4.2.

  • WebAssembly support no longer needs LLVM/bindgen and is being unit-tested on CI.

  • It's now possible to depend on other godot-rust crates through rlib.

Some features added in this cycle:

Typed dictionary. Also, enums in Godot collections!

let tiles: Dictionary<Vector2i, Tile> = dict! {
   Vector2i::new(1, 2) => Tile::GRASS,
   Vector2i::new(1, 3) => Tile::WATER,
};

Non-null engine APIs:

// Instead of...
let t: Gd<Tween> = node.create_tween().unwrap();
// ...now:
let t: Gd<Tween> = node.create_tween();

Direct == &str comparison, saving allocation:

let s = StringName::from("hello");
if s == "hello" { ... }

Bitfield Debug impl:

assert_eq!(
    format!("{flags:?}"),
    "PropertyUsageFlags { EDITOR | READ_ONLY }"
);

Optional parameters -- call from GDScript as method(1) or method(1, 2):

#[func]
fn method(
    required: i32,
    #[opt(default = 100)] optional: i32,
) { ... }

Export tool button -- click in Godot's inspector to immediately execute Rust code:

#[export_tool_button(fn = Self::on_clicked, icon = "2DNodes")]
click_me: PhantomVar<Callable>, // not a physical property

We now also have a Games page showcasing projects that users made with godot-rust! And I'm still behind on adding new entries there :)

Huge thanks to the community for making this possible! Countless bug reports, PRs, and feedback based on real-world projects have helped godot-rust immensely to reach this point.

If you like the project, consider giving us a star on GitHub. As it's maintained entirely in free time without any financial backing, small GitHub Sponsor contributions are also very appreciated (Yarwin or TitanNano or Bromeon). Thanks to everyone supporting the project -- We are excited to see what will be built on v0.5!

 

cross-posted from: https://vger.social/post/37291894

godot-rust goes into the next round with v0.5, just released on crates.io!

On the toolchain side:

  • We now support Rust edition 2024 and Godot 4.6 out of the box, as well as all versions >= 4.2.

  • WebAssembly support no longer needs LLVM/bindgen and is being unit-tested on CI.

  • It's now possible to depend on other godot-rust crates through rlib.

Some features added in this cycle:

Typed dictionary. Also, enums in Godot collections!

let tiles: Dictionary<Vector2i, Tile> = dict! {
   Vector2i::new(1, 2) => Tile::GRASS,
   Vector2i::new(1, 3) => Tile::WATER,
};

Non-null engine APIs:

// Instead of...
let t: Gd<Tween> = node.create_tween().unwrap();
// ...now:
let t: Gd<Tween> = node.create_tween();

Direct == &str comparison, saving allocation:

let s = StringName::from("hello");
if s == "hello" { ... }

Bitfield Debug impl:

assert_eq!(
    format!("{flags:?}"),
    "PropertyUsageFlags { EDITOR | READ_ONLY }"
);

Optional parameters -- call from GDScript as method(1) or method(1, 2):

#[func]
fn method(
    required: i32,
    #[opt(default = 100)] optional: i32,
) { ... }

Export tool button -- click in Godot's inspector to immediately execute Rust code:

#[export_tool_button(fn = Self::on_clicked, icon = "2DNodes")]
click_me: PhantomVar<Callable>, // not a physical property

We now also have a Games page showcasing projects that users made with godot-rust! And I'm still behind on adding new entries there :)

Huge thanks to the community for making this possible! Countless bug reports, PRs, and feedback based on real-world projects have helped godot-rust immensely to reach this point.

If you like the project, consider giving us a star on GitHub. As it's maintained entirely in free time without any financial backing, small GitHub Sponsor contributions are also very appreciated (Yarwin or TitanNano or Bromeon). Thanks to everyone supporting the project -- We are excited to see what will be built on v0.5!

 

cross-posted from: https://vger.social/post/37291894

godot-rust goes into the next round with v0.5, just released on crates.io!

On the toolchain side:

  • We now support Rust edition 2024 and Godot 4.6 out of the box, as well as all versions >= 4.2.

  • WebAssembly support no longer needs LLVM/bindgen and is being unit-tested on CI.

  • It's now possible to depend on other godot-rust crates through rlib.

Some features added in this cycle:

Typed dictionary. Also, enums in Godot collections!

let tiles: Dictionary<Vector2i, Tile> = dict! {
   Vector2i::new(1, 2) => Tile::GRASS,
   Vector2i::new(1, 3) => Tile::WATER,
};

Non-null engine APIs:

// Instead of...
let t: Gd<Tween> = node.create_tween().unwrap();
// ...now:
let t: Gd<Tween> = node.create_tween();

Direct == &str comparison, saving allocation:

let s = StringName::from("hello");
if s == "hello" { ... }

Bitfield Debug impl:

assert_eq!(
    format!("{flags:?}"),
    "PropertyUsageFlags { EDITOR | READ_ONLY }"
);

Optional parameters -- call from GDScript as method(1) or method(1, 2):

#[func]
fn method(
    required: i32,
    #[opt(default = 100)] optional: i32,
) { ... }

Export tool button -- click in Godot's inspector to immediately execute Rust code:

#[export_tool_button(fn = Self::on_clicked, icon = "2DNodes")]
click_me: PhantomVar<Callable>, // not a physical property

We now also have a Games page showcasing projects that users made with godot-rust! And I'm still behind on adding new entries there :)

Huge thanks to the community for making this possible! Countless bug reports, PRs, and feedback based on real-world projects have helped godot-rust immensely to reach this point.

If you like the project, consider giving us a star on GitHub. As it's maintained entirely in free time without any financial backing, small GitHub Sponsor contributions are also very appreciated (Yarwin or TitanNano or Bromeon). Thanks to everyone supporting the project -- We are excited to see what will be built on v0.5!

 

godot-rust goes into the next round with v0.5, just released on crates.io!

On the toolchain side:

  • We now support Rust edition 2024 and Godot 4.6 out of the box, as well as all versions >= 4.2.

  • WebAssembly support no longer needs LLVM/bindgen and is being unit-tested on CI.

  • It's now possible to depend on other godot-rust crates through rlib.

Some features added in this cycle:

Typed dictionary. Also, enums in Godot collections!

let tiles: Dictionary<Vector2i, Tile> = dict! {
   Vector2i::new(1, 2) => Tile::GRASS,
   Vector2i::new(1, 3) => Tile::WATER,
};

Non-null engine APIs:

// Instead of...
let t: Gd<Tween> = node.create_tween().unwrap();
// ...now:
let t: Gd<Tween> = node.create_tween();

Direct == &str comparison, saving allocation:

let s = StringName::from("hello");
if s == "hello" { ... }

Bitfield Debug impl:

assert_eq!(
    format!("{flags:?}"),
    "PropertyUsageFlags { EDITOR | READ_ONLY }"
);

Optional parameters -- call from GDScript as method(1) or method(1, 2):

#[func]
fn method(
    required: i32,
    #[opt(default = 100)] optional: i32,
) { ... }

Export tool button -- click in Godot's inspector to immediately execute Rust code:

#[export_tool_button(fn = Self::on_clicked, icon = "2DNodes")]
click_me: PhantomVar<Callable>, // not a physical property

We now also have a Games page showcasing projects that users made with godot-rust! And I'm still behind on adding new entries there :)

Huge thanks to the community for making this possible! Countless bug reports, PRs, and feedback based on real-world projects have helped godot-rust immensely to reach this point.

If you like the project, consider giving us a star on GitHub. As it's maintained entirely in free time without any financial backing, small GitHub Sponsor contributions are also very appreciated (Yarwin or TitanNano or Bromeon). Thanks to everyone supporting the project -- We are excited to see what will be built on v0.5!

 

cross-posted from: https://vger.social/post/35803407

Recently I created a Godot proposal to change VoxelGI nodes so they can use a sub-thread to bake their VoxelGIData. This allows baking more than one VoxelGI node at once, but also to observe the bake progress and show it in, e.g. a progress bar.

https://github.com/godotengine/godot-proposals/issues/14243

I also created a proposal to expose the bake progress via signals, since it is currently not visible to non-engine code.

https://github.com/godotengine/godot-proposals/issues/14242


I have already completed the implementation:

Expose VoxelGI bake progress via signals #116600

Allow baking VoxelGI nodes off the main-thread #116833


If you are interested in these changes, please give a thumbs-up to both the proposals and the pull requests. The maintainers already let me know that they will most likely only merge if other people express interest in this.

Please also share it with others that you think might be interested in these changes.

 

Recently I created a Godot proposal to change VoxelGI nodes so they can use a sub-thread to bake their VoxelGIData. This allows baking more than one VoxelGI node at once, but also to observe the bake progress and show it in, e.g. a progress bar.

https://github.com/godotengine/godot-proposals/issues/14243

I also created a proposal to expose the bake progress via signals, since it is currently not visible to non-engine code.

https://github.com/godotengine/godot-proposals/issues/14242


I have already completed the implementation:

Expose VoxelGI bake progress via signals #116600

Allow baking VoxelGI nodes off the main-thread #116833


If you are interested in these changes, please give a thumbs-up to both the proposals and the pull requests. The maintainers already let me know that they will most likely only merge if other people express interest in this.

Please also share it with others that you think might be interested in these changes.

 

cross-posted from: https://vger.social/post/29542502

Godot Fest in Munich just ended, and it was a blast. There were numerous great talks, and you can already see most of them on the media site of the Chaos Computer Club, as they were providing the recording infrastructure and team.

https://media.ccc.de/c/godotfest2025

I met plenty of interesting people there who were eager to talk about a wide range of topics.

 

Godot Fest in Munich just ended, and it was a blast. There were numerous great talks, and you can already see most of them on the media site of the Chaos Computer Club, as they were providing the recording infrastructure and team.

https://media.ccc.de/c/godotfest2025

I met plenty of interesting people there who were eager to talk about a wide range of topics.

 

cross-posted from: https://vger.social/post/24108563

๐ŸŒป Highlights

  • PhantomVar<T> for properties without a backing field
  • Base::to_init_gd() to access pointer during initialization
  • Gd::try_dynify() for runtime trait downcast
  • Further improvements to match_class! dispatch

๐Ÿ“š Further reading

Full Changelog.

 

๐ŸŒป Highlights

  • PhantomVar<T> for properties without a backing field
  • Base::to_init_gd() to access pointer during initialization
  • Gd::try_dynify() for runtime trait downcast
  • Further improvements to match_class! dispatch

๐Ÿ“š Further reading

Full Changelog.

 

cross-posted from: https://vger.social/post/19509421

godot-rust v0.3 brings type-safe signals to the table.
If you register a signal:

#[signal]
fn damage_taken(amount: i32);

you can now freely connect it with other Rust functions:

fn ready(&mut self) {
    // Connect signal to the method:
    self.signals().damage_taken().connect(Self::on_damage_taken);
    
    // Or to an ad-hoc closure:
    self.signals().damage_taken().connect(|amount| {
        println!("Damage taken: {}", amount);
    });
    
    // Or to a method of another object:
    let stats: Gd<Stats>;
    self.signals().damage_taken().connect_other(&stats, |stats, amount| {
        stats.update_total_damage(amount);
    });
}

Emitting is also type-safe:

self.signals().damage_taken().emit(42);

Furthermore, you can now await signals, effectively introducing async tasks:

godot::task::spawn(async move {
    godot_print!("Wait for damage to occur...");
    
    let (dmg,) = player.signals().damage_taken().to_future().await;
    godot_print!("Player took {dmg} damage.");
});

There are many other improvements, see devlog and feel free to ask me anything :)

Huge thanks to all the contributors who helped ship these features!

~this was originally posted by @bromeon@mastodon.gamedev.place the project author on reddit. I'm just maintaining some parts of the project.~

view more: next โ€บ