Resources in Godot Are Amazing

Поділитися
Вставка
  • Опубліковано 20 жов 2024
  • Follow Me on twitch: / chaff_games
    Here is the playlist to the course: • Godot 4 FPS Tutorials
    Today we're looking at Resources in godot. And how to make a custom resource for your game. This an incredibly powerful tool that can empower you to create amazing tools in your game.
    Support the Channel: / chaffgames
    Join The Discord: / discord
    My Latest Course: www.udemy.com/...
    Get the FPS Template Here: chaffgames.com...
    My Set Up:
    VO Mic: amzn.to/3QfnL6d
    Audio Interface: amzn.to/46MFidg
    CloudLifter: amzn.to/49dMUqE
    Camera Mic: amzn.to/4980cFh
    Case: amzn.to/46JiTxi
    CPU: amzn.to/471Jeah
    GPU: amzn.to/3si8r0G
    Keyboard: amzn.to/3tPL6nC
    Mouse: amzn.to/46KhM0h
    As an Amazon Associate I earn from qualifying purchases.
    ---------------------------------------------------------------------------------------------
    ----------------------------------------------------------------------------------------------
    Please like and Subscribe! It's truly appreciated
    #gamedevelopment #godot4 #godot
    Links to my Socials
    Instagram: / chaff.dev
    Twitter: / chaffdev
    Itch.io: chafmere.itch.io/
    Website: chaffgames.com

КОМЕНТАРІ • 81

  • @Chaff_Games
    @Chaff_Games  Рік тому +8

    Check out the full FPS Course: ua-cam.com/play/PLhnGgh9GDmn5DRLPnIlPRPS8ci5GnAsvO.html

  • @kardrasa
    @kardrasa Рік тому +57

    First week of learning games, I have no idea what he is talking about but I feel productive

    • @Chaff_Games
      @Chaff_Games  Рік тому +11

      Well it took me 2 years of using Godot before finding out about resources so even if you don’t fully understand, the memory may help you when the time come.

    • @youessmati3806
      @youessmati3806 Рік тому +1

      Well it took me 2 years of using Godot before finding out about resources so even if you don’t fully understand, the memory may help you when the time come.@@Chaff_Games

  • @theohallenius8882
    @theohallenius8882 Рік тому +62

    Pretty good explaination, as someone who have been with the Godot since it was announced, I kept saying that once you understand the relationship between nodes and resources - everything else will click.

    • @toby818
      @toby818 Рік тому +4

      So if I’m understanding this let’s say I wanted to make a characters stats like health and shield should it be a resource

    • @Chaff_Games
      @Chaff_Games  Рік тому +3

      As always, it’s going to depend on the project and the complexity of the scene you’re working with.

    • @toby818
      @toby818 Рік тому +8

      @@Chaff_Games it finally clicked i understand EVERYTHING!!!!

  • @Ceisriel
    @Ceisriel Рік тому +27

    i needed this yesterday, i was literally searching for it, thx for making the video so youtube could reccomend it to me

    • @Chaff_Games
      @Chaff_Games  Рік тому +1

      Awesome glad to be able to help 😊

  • @philnewberryls
    @philnewberryls Рік тому +22

    Super nice breakdown there! Resources seem like a real power-house ready to be exploited, but I haven't seen a use case demonstrated yet. This video was my answer ;D Thanks! And good vid! ;D

    • @Chaff_Games
      @Chaff_Games  Рік тому +1

      😊 thanks

    • @MrVbarroso
      @MrVbarroso Рік тому

      Here is a use case :)
      ua-cam.com/video/V79YabQZC1s/v-deo.html

  • @dconworld
    @dconworld 9 місяців тому +3

    I'm just in the process of creating a character controller, and it's working very well now. Anyway, I wanted to add in the ability to equip weapons, and wasn't quite sure how best to do it in godot... I skimmed reddit and saw someone mention resources. The docs didn't quite bridge the knowledge gap for me, so I checked out this video- and yes, it's exactly what I need.
    Thanks for the quick 5 minute demo, now I know that this is the right feature to use for what I need.

  • @viniciusantonio2253
    @viniciusantonio2253 Рік тому +76

    for unity devs, this is just ScriptableObjects's brother, right?

    • @gerhardtdebeer560
      @gerhardtdebeer560 Рік тому +7

      Yip, Godot just has a different name for it :D

    • @guilhermealmada1791
      @guilhermealmada1791 Рік тому +23

      Yes, but unlike in unity, they have sub resources

    • @the-guy-beyond-the-socket
      @the-guy-beyond-the-socket Рік тому

      Yes but in godot you dont have choise to not use scriptable objects, and funny enough its the upside cuz it teaches to manage project resources.

    • @maxdroulez7305
      @maxdroulez7305 Рік тому +4

      It’s better : resources fields can be edited directly in the inspector.

    • @wiechciu0
      @wiechciu0 Рік тому +1

      But you can edit the properties of SO in the Unity's inspector too...

  • @blazenetic
    @blazenetic 10 місяців тому +2

    Wew! Very well made, thank you!

  • @torrescle
    @torrescle Рік тому +1

    Backing in Godot 3.x I was looking for it.

  • @indierusty
    @indierusty Рік тому +1

    Exactly what i needed. ❤

  • @TheRealKaiProton
    @TheRealKaiProton Рік тому +14

    I recently completed Code Monkeys free Unity course, and the recources seem to work like Unity's Scriptable Objects,

    • @Chaff_Games
      @Chaff_Games  Рік тому +6

      I heard that. I've never worked with Unity long enough to get into Scriptable Objects.

  • @shukhambalie3936
    @shukhambalie3936 5 місяців тому +1

    From what I understand. Resources is same as component? Or is there any difference between the 2? I created my fps game and use node as component for my "Upgradable". For example, for my shotgun, it can be upgraded to explosive shotgun that stick to the wall or enemy for certain second before explode. And it can be simply add the node to the "Bullet" node via the code itself. Is there any difference or advantage to use resource?

  • @KDD0063
    @KDD0063 2 місяці тому +2

    I don't get how to assign a resource in code. Everyone shows dragging and dropping a resource into the inspector, but I want to have a character script that has a resource assigned to it by code, because it will be changing multiple times during gameplay. Anyone know what I mean?

    • @Chaff_Games
      @Chaff_Games  2 місяці тому +1

      It does not need to be loaded via an export variable. You can just load it in code as well “ var some_resource = preload(the_path_to_the_resource) “. Is that what you mean?

    • @KDD0063
      @KDD0063 2 місяці тому +1

      @@Chaff_Games yes thank you! except i think i need to use load not preload

  • @Gwizz1027
    @Gwizz1027 Рік тому +2

    great tutorial!

  • @valley-artifact
    @valley-artifact 10 місяців тому +2

    you don't need to store the names of all the animations in your gun resource, it looks like you could just infer them from the name since all the ones shown onscreen follow the same simple pattern:
    ("name" + "_" + "the type of animation").
    the video was helpful btw, thanks for making it.

    • @Chaff_Games
      @Chaff_Games  10 місяців тому +2

      I actually did do that back in 3.5 but opted out to allow for more flexibility. When I’m prototyping my naming schemes are all over the shop.

  • @AgentChick
    @AgentChick Рік тому +5

    Wait, I'm a bit confused, what is actually the difference between classes and resources, and under what circumstances would classes actually be more appropriate to use?

    • @Chaff_Games
      @Chaff_Games  Рік тому +4

      The first thing that comes to mind, is that resource can’t be placed in the scene tree. So in a case where whatever you’re working with is pure data a resource maybe more appropriate. But if it needs to be in the scene tree, perhaps you extended the rigid body class for a common object in your game, then it’s a class.

    • @AgentChick
      @AgentChick Рік тому +3

      @@Chaff_Games The thing I'm confused about is that in the video, you say that your weapons are pure data, but then they're also objects in the game, which fits my idea of a class better.
      Are you using both a Weapon resource and class to make the weapon objects, or do you just have one weapon object that loads data from the resource upon spawning?
      For example, the class would be a generator for the weapons, that draws the data from a resource similar to how you would use arrays in other languages.

    • @Chaff_Games
      @Chaff_Games  Рік тому +5

      @AgentChick Oh I see, I have a simple node3d that reads the data and controls that state (current weapon). The state machine does all the lifting, it tells the animation player what animation to play and when damage ray casting ect, the resource is behind that feed the manager the data. So basically yes, it could be it’s own class, weapon manager or something like that. What the resource allows me to do is have a single script that controls what weapon I’m using and what it should do, since it’s always querying the resource for that information first. So if I want a new weapon I just need a set of animations and a new resource, because the behaviour is already defined. If you want to learn more I have a series that I’m going through showing how to make exactly this and you can also download the project and check it out.
      If you’re curious about how this would look as a full class system rather than resource based. My old 3.5 fps template did that instead. It’s not as good, but it can totally be done that way if you want.

    • @AgentChick
      @AgentChick Рік тому +3

      @@Chaff_Games Ah, that clears things up, thanks!

  • @gerhardtdebeer560
    @gerhardtdebeer560 Рік тому +1

    Congrats on the patron launch :D, resource creation is a very powerful tool especially if you want to make swap-able objects and if non programmer(s) (artists, writers and etc) are helping on the game creation they can swap out pieces of the game for testing and so on without touching your code base. It should be mentioned that resource creation using C# does not work. Cool vid and keep up the great work!

    • @FloMinicHD
      @FloMinicHD Рік тому +1

      The following video explains how to do it in C# as well - haven't tried it out myself though: ua-cam.com/video/yUmY3Gi3z5U/v-deo.html
      If you are like me and don't want to klick links a random person on the internet sent you, the video is called "Creating custom resource types [Godot/C# Tutorial]" and made by "Mina Pêcheux"

  • @wildbanana5527
    @wildbanana5527 9 місяців тому +5

    I don't understand why I have to see 48 seconds of random intro, only to have to pause between the actual instructions that are shown within miliseconds

    • @Chaff_Games
      @Chaff_Games  9 місяців тому

      🫡

    • @Sunrymoon
      @Sunrymoon 3 місяці тому

      I doubt this was a tutorial even tho the tags say so,it was much more an explanation

  • @DuarteRoso
    @DuarteRoso Рік тому +1

    They are indeed. Use them extensively

  • @brucelee7782
    @brucelee7782 9 місяців тому +2

    so it's like a dictionary but you are exporting it?

    • @Chaff_Games
      @Chaff_Games  9 місяців тому

      It’s like dictionary plus the added bonus of being able to execute code and typed variables that you can enter into the editor.

  • @SamOakwood
    @SamOakwood 10 місяців тому +1

    So resources are shared among multiple nodes. But for example, if i wanted to create a multiplayer game, where each player has different stats, should i still use resources and how would I make them be individually changeable without changing all others?

    • @Chaff_Games
      @Chaff_Games  10 місяців тому +1

      I’ve not looked at multiplayer for a long time. But if I was going to do multiplayer. The player stats would probably held on the server in a database. Then when the player logs on you would query the database and get the stat as required. You could have a resource on the client side that you could populate with those stats at log on and periodically check to make sure that they’re the same to reduce queries.

    • @SamOakwood
      @SamOakwood 10 місяців тому

      @@Chaff_Games yeah with persistent stats, databases or rest interfaces would be best, but I rather meant things like player stats such as damage per shot or collected power ups that don't need to be persistent and are discarded after the round...

  • @wenerd5692
    @wenerd5692 9 місяців тому +1

    I recently tried to understand how to transfer resources over the network, through the godot multiplayer, but I still did not understand (
    I had to parse the resource into a dictionary and transfer it in this form.
    Maybe someone has faced a similar problem, how did you solve it?

    • @Chaff_Games
      @Chaff_Games  9 місяців тому

      I've never tried but I would do the exact same thing.

  • @demiqas254
    @demiqas254 9 місяців тому +1

    So resources can be godot's way of doing enumerators?

    • @Chaff_Games
      @Chaff_Games  9 місяців тому

      Think scripted objects on unity

  • @ClayTheFoxx
    @ClayTheFoxx Рік тому +3

    KDE PLASMA FTW!

    • @Chaff_Games
      @Chaff_Games  Рік тому +1

      Yep, my DE of choice. Can’t go wrong.

    • @ClayTheFoxx
      @ClayTheFoxx Рік тому +1

      @@Chaff_Games same)

    • @ClayTheFoxx
      @ClayTheFoxx Рік тому +1

      I am obliged to say “I use arch btw”

    • @Chaff_Games
      @Chaff_Games  Рік тому +1

      @@ClayTheFoxx Nice! I want to make the switch but this Manjaro build has been really stable and everything is set up. I used to be more gallivant switching distros but since I started development, I'm a little more cautious switching.

  • @LookjaklooK
    @LookjaklooK Рік тому +1

    I'm curious if a ScriptableObject as Architecture is possible with Godot Resources, that work just like in the Ryan Hipple talk. I know it's more of a Unity thing, but can it be applicable in Godot in some way?

    • @Chaff_Games
      @Chaff_Games  Рік тому

      I’m honestly not sure it’s been years since I used Unity. Godot is very flexible however, it’s likely possible to do.

    • @raulzilla
      @raulzilla Рік тому

      In the video it sounded just like Scriptable Objects and since it can also have methods, then it might really be just like scriptable objects.

    • @LookjaklooK
      @LookjaklooK Рік тому

      @@raulzilla Well, I couldn't figure out how to implement the SO architecture using them,

  • @catafest
    @catafest Рік тому +2

    can be resources created with C# in Godot?

    • @Chaff_Games
      @Chaff_Games  Рік тому

      Sorry I’m not sure. I would assume so, but you never know with mono.

    • @TMHedgehog
      @TMHedgehog Рік тому

      @@Chaff_GamesThey can, I've literally just done one!

  • @the-guy-beyond-the-socket
    @the-guy-beyond-the-socket Рік тому +1

    So with resources its very easy to make games with mod support?

    • @Chaff_Games
      @Chaff_Games  Рік тому +1

      I’ve never tried. But I could see their utility.

  • @SangeethSSanthosh-t2p
    @SangeethSSanthosh-t2p Рік тому +1

    how do you quickly load the game when start pressed (f5), it takes me 30 sec . can you please guide me...please

    • @Chaff_Games
      @Chaff_Games  Рік тому +2

      Hey there, sorry to disappoint you but it’s just edited. I do experience a wait but it’s just going to depend on your hardware, I don’t think there’s anything you can do.

    • @sheppowed4483
      @sheppowed4483 Рік тому +1

      do you have a corsair keyboard ?

    • @pingvin9166
      @pingvin9166 Рік тому +2

      You can save your scenes in scn format instead of tscn.
      Scn is a binary way to save scenes, tscn is textual, this should speed up the launch of the project in test mode.

    • @sheppowed4483
      @sheppowed4483 Рік тому +2

      because i noticed my godot is slower if the RGB on my Corsair K55 RGB is controlled by a software on the PC , the fix is to unplug / plug the device from the computer

    • @Chaff_Games
      @Chaff_Games  Рік тому

      That’s so weird I wonder what causes that

  • @principleshipcoleoid8095
    @principleshipcoleoid8095 Рік тому +1

    Hmm. Godot looks like a nice engine, but I guess bevy's simplicity and Rust is what stole me. ESC seems a bit simpler to me.

    • @Chaff_Games
      @Chaff_Games  Рік тому +2

      I had done a course in Unity before changing to godot. I never made a game in Unity so I sort of count Godot as my first serious game engine. And in a way this made it easier for me to click into the Godot way of doing things rather than having to re wire my brain to work with a different system. At the end of the day the best tool is the one you feel most comfortable with.

  • @morten940
    @morten940 11 місяців тому +1

    Nooooo. TOTK spoiler