How to use Resources in Godot 4

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ม.ค. 2025

ความคิดเห็น • 56

  • @ItsEphora
    @ItsEphora 18 วันที่ผ่านมา +28

    With the new typed dictionaries coming in 4.4, resources are gonna be even better

  • @soulsmanipulatedinc.1682
    @soulsmanipulatedinc.1682 18 วันที่ผ่านมา +29

    8:07
    You can also toggle the "local to scene" exported boolean, in the base class of Resource, to do this for you.

    • @Bitlytic
      @Bitlytic  18 วันที่ผ่านมา +7

      Very good point, forgot to mention that

    • @leejesm
      @leejesm 18 วันที่ผ่านมา +2

      Did you mean 7:07?

    • @soulsmanipulatedinc.1682
      @soulsmanipulatedinc.1682 18 วันที่ผ่านมา +4

      @@leejesm No, I mentioned 1:54. Thank you. Sorry for the confusion.

  • @georgepitoy5426
    @georgepitoy5426 16 วันที่ผ่านมา +8

    I've seen a lot of Godot code and your repo might be the cleanest complex Godot project I've ever seen. Great video, thank you.

  • @Felipe_2097
    @Felipe_2097 17 วันที่ผ่านมา +2

    Your videos have been incredibly helpful! I recently started with video game development to later dive into modding for a jam that caught my attention, and your content has provided some really important insights. I hope you keep uploading more videos!

  • @ShinSpiegel
    @ShinSpiegel 18 วันที่ผ่านมา +4

    Great video, nice that you have also provided a base project as example. Thanks for sharing.

  • @foorman2837
    @foorman2837 14 วันที่ผ่านมา +2

    For anyone who doesent know(i found out after messing with resources after this vid❤)
    You can set up your sprite frames in the animatedsprite node and just save the sprite frames (which are also a resource) and you have all your frames with fps set up for easy assignment down the line😊

  • @giantneuralnetwork
    @giantneuralnetwork 18 วันที่ผ่านมา +1

    Hey awesome video! Love how you show the concept and show it in use in such quick succession. It really helps keeps the main idea clear!

  • @FeyFen
    @FeyFen 16 วันที่ผ่านมา +1

    Thank you so much for your AWESOME tutorials! They are so helpful and well explained.

  • @Trance_
    @Trance_ 18 วันที่ผ่านมา +6

    Great videos, keep em coming. I started learning Godot from 0 (no coding experience) a month ago and your videos have been really helpful.

  • @Break.
    @Break. 12 วันที่ผ่านมา +2

    wow I really just designed and created an item/inventory/crafting system over the past week and then saw your video just now 😭

  • @Canyyon
    @Canyyon 10 วันที่ผ่านมา +4

    What is the point of doing this instead of composition with nodes? You can also use ready and process methods with those too

  • @mazander_man
    @mazander_man 18 วันที่ผ่านมา

    Excellent explanation happy holidays dude

  • @njdarda
    @njdarda 18 วันที่ผ่านมา

    your presentation is exquisite

  • @Evitrea
    @Evitrea 15 วันที่ผ่านมา +3

    Godot editor really needs to put more UX work for Resource, like you can't even batch edit the resources from the same Class...

  • @GoblinArmyInYourWalls
    @GoblinArmyInYourWalls 18 วันที่ผ่านมา

    Youve got a new sub from me, great video quality

  • @tower1990
    @tower1990 11 วันที่ผ่านมา

    Killer tutorial as always

  • @noelsanso1033
    @noelsanso1033 12 วันที่ผ่านมา

    Nice video :) what if we want to have different attack types as a Resource. Let's say some enemies attack by shooting in 8 direction and some apply some AOE damage around them. Do you think it's alright to add the logic on how they attack inside a resource as well? So in the enemy_stats we could have the attack type which is another resource which contains the methods that know how to attack? This means we would have AEO_Attack.res and Bullet_Attack.res for instance.
    If the answer is no, how would you approach something like this, would you simply have an enum in the enemy_stats resource and then a bunch of if else checking what to do base on the attack type? (this will grow like crazy if we keep adding more attack types). Would you create different Scenes for enemies with different attack? Doesn't make much sense if the only difference is how they attack... so in my head it makes sense to have the attack type as a configurable resource but would like to know your take on this! Thanks! And have a happy new year

  • @ErDev2
    @ErDev2 16 วันที่ผ่านมา

    this is what i need, thanks

  • @nickmuffin8186
    @nickmuffin8186 18 วันที่ผ่านมา

    I love the videos! Learning Godot from Unity has been a difficult shift in workflow. I just watched your video about component based design, and it looks you still use components in the reference project, but how do you decide what stays in the component and what data gets moved to a resource? Health specifically was one I could not understand why the information couldn't stay and be modified inside the component. Does this just save you from having to have multiple enemy scenes or am I not understanding the application? Happy Holidays

  • @fvhaudsilhvdfs
    @fvhaudsilhvdfs 18 วันที่ผ่านมา +1

    if you had an enemy type for which it made sense to use custom resources (like the dinos), but because the sprites were significantly different you needed a unique CollisionShape for each enemy, how would you handle that? would you draw the collision shape in the scene editor and then save the collision shape resource somewhere, and have the enemy load its corresponding collision shape in _ready()?
    that's the only method i can think of, but it seems somewhat cumbersome.

    • @Bitlytic
      @Bitlytic  18 วันที่ผ่านมา

      Yeah the stats are much more generic, or for enemy variations of the same type

    • @fvhaudsilhvdfs
      @fvhaudsilhvdfs 18 วันที่ผ่านมา

      @@Bitlytic thanks for the reply (and the great video). would you also handle the unique collision shapes the way I described?

    • @wasteurtime5677
      @wasteurtime5677 18 วันที่ผ่านมา

      ​​@@fvhaudsilhvdfsuse the node scenes to handle different collisions. The resources are better for holding data only. He talks about compositon in a different video.
      th-cam.com/video/74y6zWZfQKk/w-d-xo.htmlsi=ps7zq5MtC7u5tzJ4

    • @Bitlytic
      @Bitlytic  18 วันที่ผ่านมา

      ​@@fvhaudsilhvdfs If you want unique collisions, you could define a scale in the stats and change the scale of the shape based on that, or load in and swap the shape from the stats like you mentioned. To be honest I would probably go with a hitbox scale, since the games I'm making are 2d and most if not all enemies will use a circular shape

    • @smokelingers
      @smokelingers 12 วันที่ผ่านมา

      If they're significantly different, they should probably occupy their own scene. For example, you want a flying enemy to be rendered above ground enemies, and also not be hit by an attack like a ground slam, so they need to be on a different collision layer, then I'd save a copy of the enemy scene for flying enemies and be done with it. If only one enemy needs three collision shapes and its own light source, I'm making it its own scene. To do all of that in code sort of defeats the purpose of resources, I think, so it depends how significant the differences are.
      But of course they can still all use a generic stats resource that contains their health, damage, movement speed, and their loot values, etc.

  • @Gonzomat0
    @Gonzomat0 18 วันที่ผ่านมา

    Hey, great video! Are there any other benefits of using an item stack class unless the settings for adding up items and setting the min/max values and so on?

  • @furuthebat
    @furuthebat 18 วันที่ผ่านมา +1

    This is all good until you have more complex data and nested arrays or need to edit arrays in the Resource Editor. I also use a mix of Resources and jsons

    • @AgriasOaks99
      @AgriasOaks99 18 วันที่ผ่านมา +1

      Why?

    • @Bitlytic
      @Bitlytic  18 วันที่ผ่านมา +3

      The resource editor can be really annoying if you have nested resources yeah, but I personally find it better for editing visually than json

    • @watatitamf1598
      @watatitamf1598 18 วันที่ผ่านมา +1

      I am badly need godot custom editor tutorial. Editing and tweaking data causes so much headache with default editor

    • @rremnar
      @rremnar 16 วันที่ผ่านมา

      The problem is, resources require all its variables and even itself to be embedded into the property editor using the @export variable. I have tried to create a custom resource by calling MyResourceClass.new(); but for some reason it doesn't work with the ResourceSaver. There are no errors but you wind up with a resource file with no fields. Theoretically, it should have worked. This is what pisses me off about Godot, that you do something logical, with no errors and it doesn't work; because you had to do it in a very specific way, which makes little sense. It makes no sense that you have to embed a resource and its variables, in the editor, for it to work. I was thinking of using JSON as an alternative, but I got the bloody thing to work, using the same technique as in every resource video.

    • @AlyceIsFree
      @AlyceIsFree 13 วันที่ผ่านมา

      @@watatitamf1598 Join the server, we'll teach you

  • @Thisisitboys
    @Thisisitboys 18 วันที่ผ่านมา

    This guy is OP.

    • @Bitlytic
      @Bitlytic  18 วันที่ผ่านมา +2

      Shh, don't make the devs nerf me

  • @itssherif9777
    @itssherif9777 14 วันที่ผ่านมา

    How are your folders coloured?

    • @Bitlytic
      @Bitlytic  13 วันที่ผ่านมา

      4.2+ you can right click and color folders

  • @Lulink013
    @Lulink013 18 วันที่ผ่านมา

    How did you color code your file explorer in Godot?

    • @Bitlytic
      @Bitlytic  18 วันที่ผ่านมา

      In 4.2+ you can right click the folder and set a color

  • @MassiveBreaker
    @MassiveBreaker 18 วันที่ผ่านมา

    Hey Bitlytic, always interested in the visuals of the videos, what program do you use for all of the graphic and smooth movement during editing?

    • @Bitlytic
      @Bitlytic  18 วันที่ผ่านมา

      Motion Canvas! It's a js framework for motion graphics, made by fellow gamedev youtuber Aarthificial, you can find it here: motioncanvas.io/

    • @MassiveBreaker
      @MassiveBreaker 18 วันที่ผ่านมา

      @@Bitlytic Wow, this is a sick program, thank you!

  • @nauro9187
    @nauro9187 18 วันที่ผ่านมา +1

    IM HERE

  • @monarch1360
    @monarch1360 18 วันที่ผ่านมา +1

    what do you use for animation your video really love the look of it

    • @brahillms1374
      @brahillms1374 18 วันที่ผ่านมา +1

      motion canvas

  • @Jwduth
    @Jwduth 18 วันที่ผ่านมา

    8 minute Andy alert (peak video btw)

    • @Bitlytic
      @Bitlytic  18 วันที่ผ่านมา

      :rivboowomp:

  • @SeanBotha
    @SeanBotha 14 วันที่ผ่านมา +1

    Godot cm. Only woke can develop and play games developed in godot(cutting customers in half)
    Ceo:anyone that say keep politics out if game engines are toxic.
    Do not use godot EVER

    • @Bitlytic
      @Bitlytic  13 วันที่ผ่านมา +8

      What the fuck are you on?

    • @AlyceIsFree
      @AlyceIsFree 13 วันที่ผ่านมา

      Waaaaaahhhh, CM made a joke waaaaaah. Funny, cause ya'll call lefties soft, and unable to take a joke. Wassup snowflake, a little queer respect scare you?

    • @AlyceIsFree
      @AlyceIsFree 13 วันที่ผ่านมา +2

      Also, this show's what kind of person you are, to ignore a developers work, simply for the engine they worked in, but then again, you lot are used to hating demographics eh