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!

Комментарии • 74

  • @WizardofWestmarch
    @WizardofWestmarch 11 месяцев назад +7

    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.

    • @FinePointCGI
      @FinePointCGI  11 месяцев назад

      Oooh I didnt know that! Im super new to Rust so alot of it is like hieroglyphics!

    • @WizardofWestmarch
      @WizardofWestmarch 11 месяцев назад

      @@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.

  • @jay.rhoden
    @jay.rhoden 9 месяцев назад +8

    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.

  • @rabidhamper7
    @rabidhamper7 11 месяцев назад +8

    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!

    • @FinePointCGI
      @FinePointCGI  11 месяцев назад +3

      I haven't had the chance it seems easier then c++.. it has a lot less to setup that's for sure..

    • @rabidhamper7
      @rabidhamper7 11 месяцев назад

      ​@@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++.

    • @challe535
      @challe535 11 месяцев назад +4

      @@FinePointCGI I wouldn't say it's easier, it just has a lot of nice features built in and is much safer to use 🙂

  • @pyromancerforhire
    @pyromancerforhire 2 месяца назад

    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.

  • @The_Dialect
    @The_Dialect 11 месяцев назад +7

    😍😍 I know exactly what I'm doing after work!
    Thanks for the video and your awesome tutorials!

  • @jinjatube
    @jinjatube 10 месяцев назад +2

    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!

  • @smoked-old-fashioned-hh7lo
    @smoked-old-fashioned-hh7lo 2 месяца назад

    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.

  • @AJ213Probably
    @AJ213Probably 6 месяцев назад +2

    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

    • @thetruewhiteowl
      @thetruewhiteowl 3 месяца назад

      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.

  • @Tosek2010
    @Tosek2010 11 месяцев назад +2

    Thanks Mick, again an awesome tutorial.
    BTW: Do you plan to continue the horror game tutorials? I really loved them.

    • @FinePointCGI
      @FinePointCGI  11 месяцев назад +1

      I do I'm working on getting the enemy to kill you right now

    • @Tosek2010
      @Tosek2010 11 месяцев назад

      @@FinePointCGI awesome. Can't wait for it

  • @vercal
    @vercal 11 месяцев назад +1

    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

    • @FinePointCGI
      @FinePointCGI  11 месяцев назад

      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!

  • @DMTDD
    @DMTDD 11 месяцев назад +1

    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

  • @NoxicTonic
    @NoxicTonic 11 месяцев назад +3

    I seem to have read that a fix for hot reload issue is being tested in Godot 4.2 dev snapshots.

    • @Snorehog
      @Snorehog 10 месяцев назад +1

      Would be great with an update to this video on how to do this. Probably won't need to copy paste anymore?

  • @Linuxhype
    @Linuxhype 11 месяцев назад +1

    This is great!
    Haskell next? 😅

  • @throwawaydude3470
    @throwawaydude3470 3 месяца назад

    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.

  • @MrAntraxico
    @MrAntraxico 8 месяцев назад

    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

    • @FinePointCGI
      @FinePointCGI  8 месяцев назад +1

      The real MVP

    • @MrAntraxico
      @MrAntraxico 8 месяцев назад

      @@FinePointCGI My pleasure, man. I love your videos and they have helped me a lot. Contributing like this is the least I could do.

  • @MeatCatCheesyBlaster
    @MeatCatCheesyBlaster 10 месяцев назад

    That bird noise freaked me out omg

  • @Kram1032
    @Kram1032 10 месяцев назад

    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.

  • @zoltanfurko8778
    @zoltanfurko8778 11 месяцев назад +1

    hello nice video thank you. Is there any chance that you will create a tutorial the newly released official Applovin Godot asset? thank you

    • @FinePointCGI
      @FinePointCGI  11 месяцев назад +2

      I have added it to my list!
      github.com/finepointcgi/FinepointCGI-Suggestions/issues/56

  • @dzartxstudio
    @dzartxstudio 11 месяцев назад +8

    C++ next pleaaaaaaase😢❤❤

    • @FTFGS
      @FTFGS 11 месяцев назад +1

      +1

    • @FinePointCGI
      @FinePointCGI  11 месяцев назад +10

      That is the plan! I'm looking at it right now! It's quite a bit more complicated then rust oddly enough

    • @FTFGS
      @FTFGS 11 месяцев назад +3

      @@FinePointCGI thanks for your all effort

    • @Rogueixpresents
      @Rogueixpresents 11 месяцев назад

      Nah more in rust. These plebs barley know any cpp syntax 😂

  • @Wanfanel
    @Wanfanel 9 месяцев назад

    Nice Video, Programming in Rust Godot looks painful ^_^

  • @nicklesseos
    @nicklesseos 9 месяцев назад

    Can you do a networking tutorial for godot in rust or golang?

  • @4mb127
    @4mb127 11 месяцев назад +1

    Love your videos. Any chance for Nim or Zig too?

    • @FinePointCGI
      @FinePointCGI  11 месяцев назад +1

      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

  • @bestcoders
    @bestcoders 11 месяцев назад

    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

  • @goshawk_fly
    @goshawk_fly 10 месяцев назад +1

    It's significantly better than C++!!!🎉

  • @Frustratedhen
    @Frustratedhen 11 месяцев назад

    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

  • @bookerbug
    @bookerbug 5 месяцев назад

    Awesome!!!

  • @hoax-777
    @hoax-777 28 дней назад

    Are you able to hot reload?

  • @thomasparker7305
    @thomasparker7305 11 месяцев назад +1

    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.

    • @FinePointCGI
      @FinePointCGI  11 месяцев назад +7

      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.

    • @thomasparker7305
      @thomasparker7305 11 месяцев назад +1

      @@FinePointCGI looks like I will have to look into rust. :) is it better then c++ with godot? Always love your tutorials.

    • @FinePointCGI
      @FinePointCGI  11 месяцев назад +6

      @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...

    • @thomasparker7305
      @thomasparker7305 11 месяцев назад +2

      @@FinePointCGI thank you for the feed back!! I will check our rust soon.

    • @Mrme-cn9je
      @Mrme-cn9je 11 месяцев назад

      ​@@FinePointCGIDid you try Rust against typed GDscript or untyped on the 100X speed gain?

  • @user-hl5zx1qh7s
    @user-hl5zx1qh7s 8 месяцев назад

    Please help me how to on mobile godot engine?
    I want to use rust so hard

  • @Snorehog
    @Snorehog 10 месяцев назад

    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.

  • @DMTDD
    @DMTDD 11 месяцев назад

    🤩

  • @torrescle
    @torrescle 11 месяцев назад

    lool what a huge effort. I'm so glad that Godot comes with C# already;

    • @sean7221
      @sean7221 11 месяцев назад

      You have a low caste mentality.
      Better yourself.

  • @yoskokleng3658
    @yoskokleng3658 4 месяца назад

    Why rust instead of gdscript?

    • @kelvinchin5942
      @kelvinchin5942 2 месяца назад

      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

  • @ArcWeltraumpert
    @ArcWeltraumpert 5 месяцев назад

    Rust easy? 😅

  • @TillmannHuebner
    @TillmannHuebner 11 месяцев назад +16

    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

    • @FinePointCGI
      @FinePointCGI  11 месяцев назад +7

      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.

    • @TillmannHuebner
      @TillmannHuebner 11 месяцев назад

      @@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

    • @FinePointCGI
      @FinePointCGI  11 месяцев назад +5

      @@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.

    • @nobytes2
      @nobytes2 9 месяцев назад +3

      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.

    • @m0-m0597
      @m0-m0597 8 месяцев назад

      The question is, why would i use rust, what are the benefits within godot

  • @davymachinegun5130
    @davymachinegun5130 11 месяцев назад +1

    Oh no. No no no no no. No no no no no no.