Setting Up Rust in Godot 4.1! Advanced Godot 4!
HTML-код
- Опубликовано: 8 сен 2024
- Subscribe and learn more from me about Game Development and Programming!
In this video, we'll delve into the process of setting up and utilizing Rust for your Godot projects. Discover how integrating Rust can be used to help your game development process. Whether you're a seasoned developer or just exploring the possibilities, this video will provide step-by-step instructions to seamlessly set up Rust in Godot. Boost your game's performance and security with the synergy of Rust and Godot 4.1. Don't miss out on leveraging the best of both worlds!
RESOURCES
Installing Rust: rustup.rs/
Cargo.toml:
[package]
name = "testCrate"
version = "0.1.0"
edition = "2021"
See more keys and their definitions at doc.rust-lang....
[dependencies]
godot = { git = "github.com/god...", branch = "master"}
[lib]
crate-type = ["cdylib"]
GD Extension file content:
[configuration]
entry_symbol = "gdext_rust_init"
compatibility_minimum = 4.1
[libraries]
windows.debug.x86_64 = "res://lib/testCrate.dll"
windows.release.x86_64 = "res://lib/testCrate.dll"
Launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"preLaunchTask": "rust: cargo build",
"name": "Debug",
"args": [ "--path", "C:\\Users\\FinePointCGI\\Documents\\Rust Tutorial"],
"cwd": "${workspaceFolder}",
"windows": {
"program" : "C:\\Users\\FinePointCGI\\Downloads\\Godot_v4.1.1-stable_mono_win64\\Godot_v4.1.1-stable_mono_win64\\Godot_v4.1.1-stable_mono_win64.exe"
}
}
]
}
BE MY FRIEND:
🐦Add me on Twitter: / finepointcgi
Check out my Website: finepointcgi.io/
Where to suggestion Things: github.com/fin...
You can support me on Patreon: / finepointcgi
Hang Out with the Guys on Discord: / discord
TIMESTAMPS
01:00 Installing Rust
02:36 Creating Our Rust Lib Project
04:22 Istalling the Rust Addon
05:05 Setting Up Our Toml File
06:51 Setting Up or lib.rs File Properlly
08:02 Interaction With the Godot System Using a Class
13:22 Marker 8
14:35 Getting Into Godot
14:56 Explaning What a GD Extension File Is
18:01 How To Find Your Newly Created Node
18:30 How To Actually Program a Small Controller
22:20 Seperating Our Library Into Two Files
25:04 How To Interact With Rust From GD Script
29:35 How Do You Debug (Its Pain Kind Of)
32:28 Running Into an Issue With My Recorder
34:40 Outro and Recap of What We Learned
MUSIC
Music provided by TheRelaxedMovement.
Check it out here: / therelaxedm...
HASHTAGS:
#rustprogramming #Godot4 #basics
ABOUT MY CHANNEL:
I've been a software developer for over 7 years. I've worked in the game industry for 3 of those years. This channel is used for news on the gaming\programming industry and for tutorials for game\programming development.
Setting Up Rust in Godot 4.1! Advanced Godot 4!
Still watching (12 minutes in) but one thing worth mentioning that might not be obvious to people who do not know rust. Leaving off the semicolon of the last line of a function makes that the returned value.
Oooh I didnt know that! Im super new to Rust so alot of it is like hieroglyphics!
@@FinePointCGI Yeah easy to miss. I'm not a master of rust by any stretch but I've dabbled with it off and on for a few years so I know lots of random weird details.
Super helpful, thanks for making this. Excited to be able to pull in some existing rust code into my projects. The GodotString thing seems to be a little bit of an annoyance though.
Minor addendum, the latest rust gdext version seems to want "INode2D" instead of "Node2DVirtual", I guess that was a recent change.
With regards to the rust (yellow) warnings, most of them were just warnings about how variables/stucts were named. Start the struct names with an uppercase letter and at least half of the warnings will disappear.
Super appreciate this tutorial! I am fortunate enough to use Rust at work and I love it as a language. Excited to learn how to get set up in Godot!
I haven't had the chance it seems easier then c++.. it has a lot less to setup that's for sure..
@@FinePointCGI I originally came from C++. There are so many fewer foot-guns in Rust. I have spent exactly 0 time over the past 2 years chasing memory-related issues but still have all the performance of C++.
@@FinePointCGI I wouldn't say it's easier, it just has a lot of nice features built in and is much safer to use 🙂
This is a pretty damn deep look at this very specific topic and I love it. Hell you even explained how to install and what is Rust itself. Love it.
😍😍 I know exactly what I'm doing after work!
Thanks for the video and your awesome tutorials!
Thanks so much for this! I was struggling with the docs, as I think they haven't yet been fully updated for the new GDExtension. Now I have a working Godot + Rust sandbox!
i've played around a bit with this but i think bevy is the way to go if you want to use rust to build games.
I will be honest, I tried following this and ran into issues with small stuff being out of date and this not working for me due to it not detecting my gdextension. However, I instead followed the godot rust book and I feel like the project setup is much smoother and I got it working first try.
Like you can run cargo build and you don't need to copy any other files. So if anyone else is having troubles, follow the Godot Rust Book
Yep in just half a year this video is already outdated... Just goes to show how quickly the godot-rust API is being developed and they are clearly not afraid of deprecating and changing their API at an incredible pace.
Thanks for suggesting to follow the Godot Rust Book though! It was really helpful.
Thanks Mick, again an awesome tutorial.
BTW: Do you plan to continue the horror game tutorials? I really loved them.
I do I'm working on getting the enemy to kill you right now
@@FinePointCGI awesome. Can't wait for it
Great video over all, but as a Rust dev it did pain me to see `testExtension` and `test` being used for structs and the lack of basic formatting like with brackets without spaces, but still a great tutorial
Lol sorry I'm not a rust person... this is my second or 3d time using it so I have very little understanding of what it all means! It's a really cool language though! After using c++, and doing the tutorial on that one I understand completely why people are using rust!
Thanks for the tutorial really useful.
Also can you do tutorial about publish godot 4 game for the android & web which is use Rust extension
I seem to have read that a fix for hot reload issue is being tested in Godot 4.2 dev snapshots.
Would be great with an update to this video on how to do this. Probably won't need to copy paste anymore?
This is great!
Haskell next? 😅
I could not for the life of me get Godot to recognize my custom node. I did everything you said. But it didn't work. Would help if you provided a repo.
Sections:
0:00 intro and summary
1:01 installing rustup
2:40 creating the project
4:15 rust plugins
5:10 rust project
14:01 integrating the simple library on Godot
18:34 character controller in Rust
21:06 linking rust files
25:06 Signals
29:42 Debugging
The real MVP
@@FinePointCGI My pleasure, man. I love your videos and they have helped me a lot. Contributing like this is the least I could do.
That bird noise freaked me out omg
I could follow this until the debug at which point it kinda just completely ignored the breakpoint...
As far as I can tell, my launch json configuration looks identical to yours, so I have no idea why the breakpoint doesn't work. Godot launches and I did set a breakpoint to the same line as you but presing "a" does nothing in VSCode.
hello nice video thank you. Is there any chance that you will create a tutorial the newly released official Applovin Godot asset? thank you
I have added it to my list!
github.com/finepointcgi/FinepointCGI-Suggestions/issues/56
C++ next pleaaaaaaase😢❤❤
+1
That is the plan! I'm looking at it right now! It's quite a bit more complicated then rust oddly enough
@@FinePointCGI thanks for your all effort
Nah more in rust. These plebs barley know any cpp syntax 😂
Nice Video, Programming in Rust Godot looks painful ^_^
Can you do a networking tutorial for godot in rust or golang?
Love your videos. Any chance for Nim or Zig too?
That is on the list!
I havent looked at zig
Nim is confusing for me!
github.com/finepointcgi/FinepointCGI-Suggestions/issues/57
github.com/finepointcgi/FinepointCGI-Suggestions/issues/58
just what was looking for, just wondering is there a way I can add node programmatic for instance am creating checkers board and would like to create the squares automatically when board is created for instance in process function? but seem like nodes cannot be generated pro-grammatically it am i missing something
It's significantly better than C++!!!🎉
i am using it but facing problem in selecting multiple nodes as adroid hai no shift button how can i do ples guide me if some one know how to do
i have mobile verison godot 4
Awesome!!!
Are you able to hot reload?
I don't know too much about rust but have heard of it. I do have a question. Why use rust with godot? What are the pros and cons of using it with godot and why would it be better then using gd script? Thank you for the input to the question.
Rust is a C++ alternative its faster in execution time then GD script by 100x (last time I tested it). It is useful for doing anything really complicated like level generation or if you need to add additional libraries like machine learning or qr code reading.
@@FinePointCGI looks like I will have to look into rust. :) is it better then c++ with godot? Always love your tutorials.
@thomasparker7305 it's not necessarily better both of them are great for speed but pain to write. Rust has a simpler integration and generally is easier to use in my experience...
Both of them compile down to basically the same thing so it's more just dealers choice.
That being said with c++, you have to deal with a header file you have to deal with a file that does a lot of linking and things like that and you have to deal with scons... Whereas with rust all you have to do is type cargo build and it pretty much just handles it all for you...
@@FinePointCGI thank you for the feed back!! I will check our rust soon.
@@FinePointCGIDid you try Rust against typed GDscript or untyped on the 100X speed gain?
Please help me how to on mobile godot engine?
I want to use rust so hard
Got stuck on how to setup the debugger on Mac (ruclips.net/video/z14cfTc40uQ/видео.htmlsi=jddQ-A4cF0p2v4nL&t=1999). How do you change the launch.json. Doesn't seem to work to just change "windows" to "osx" e.g.
🤩
lool what a huge effort. I'm so glad that Godot comes with C# already;
You have a low caste mentality.
Better yourself.
Why rust instead of gdscript?
like c# vs javascript before unity remove javascript and boo. It basically faster althought if you correctly use the engine's features should not be the problem but it give your such options
Rust easy? 😅
I dont get why tutorials about a complex language always start of with explaining how to install the thing :D Dont get me wrong, if you cant install rust you most likely wont be trying to implement games in godot with it
The reason is I've made tutorials expecting it to be installed in the past and I get lots of comments saying cargo doesn't work it says not found so I just got into the habit of explaining from start to finish.
@@FinePointCGI rust is just a super complex language, and fiddling with ffi or theses things just is super complex. I get you want to educate but rust isnt really a language to start out, if you want to avoid headache. Also if you want to do formatted strings :D -> format!("Hello, World from {var_name}")
Still gonna try this, as it was kind painful the last time. GDscript is just to python for me
@@TillmannHuebner Oh it is! I dont think its useful for most people except in some situations. I found that if your going to do something that requires alot of speed like level generation rust is good... for everything else that requires some speed C# is fine...
I dont know if I plan to get more deeper then how to set it up becaue like c++ its just complicated....
Though I will be doing a tutorial on how to use C++ with Godot as well.
Well, why are you here on this video? The repos by themselves should get you going with rust and godot if you are such an expert.
The question is, why would i use rust, what are the benefits within godot
Oh no. No no no no no. No no no no no no.