11/1/2022 0 Comments Godot rustI've found the godot-rust bindings work well, however they're still not very mature so the documentation and examples feel a little light - you may find yourself digging through code, looking at other projects or doing some trial and error to get things working (good for learning, but also something you'd largely avoid going the GDScript route). If the goal is to learn about the game development process and build a game, I would lean you towards Godot with GDScript it has had some time to mature, is well documented and the GDScript syntax makes it easy to learn and quick to get things done. Given your limited experience in both Rust and game development at this point, I think it's worth considering what your end goal is as that may help guide your decision. Godot rust code#I don't even need Rust for performance reasons, it's just that it's so much better! Knowing that my code is faster just by virtue of writing in it is just a very much welcome side effect, really. Rust has none of this issues, and brings a lot of cool stuff to the table (immutability, memory safety and a modern type system among others). Removing an element from an array is remove, but on a dictionary that's delete You don't have Option, so if you want an optional parameter which could be null, you have to drop type annotations for it. No modules or other sorts of code organization features.Ī half-baked static type system. The more elegant of the two (class_name) has bugs that have been sitting in the issue tracker for years. Importing other classes can be done in two different ways. The only supported paradigm is OOP, but lacks many basic OOP constructs like abstract classes or interfaces. Creating your own abstractions is painful. Equality operator compares pointers for dictionaries, there's no alternative structural (deep) equality comparison operation.īad support for custom types. Lots of pitfalls: Dictionaries have reference semantics, but array parameters are always copied. For instance, integer division is always a warning in GDScript, even if it's your intention to divide integers. Incoherent and sometimes contradictory compiler warnings. I'll just mention a few things (not exhaustive by any means) of what made me migrate most my game from GDScript to Rust: Once you understand the Godot API, the transition to Rust will be far less painless. My advice would be to learn the engine by starting in GDScript because there's far more support and documentation. Still, I believe there's a lot of value in writing Rust even when code is not performance critical, because GDScript has several language design issues. That's typically things like UI code and signal glue-ing that benefit very little from using Rust and where the extra overhead is not worth. You can write your whole game in Godot with Rust, but some things are just more ergonomic to write in GDScript with editor support.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |