What are Resources? (Godot 4.0 Tutorial for Beginners)

Поділитися
Вставка
  • Опубліковано 20 жов 2024

КОМЕНТАРІ • 37

  • @hudsonator7259
    @hudsonator7259 11 місяців тому +3

    This is a really good example of resources, and really food job showing what you couldnuse the resources for

  • @PhucHuynh-u7m1k
    @PhucHuynh-u7m1k 3 місяці тому +1

    Great tut! Thank a lot!

  • @2dspaceadventuregame952
    @2dspaceadventuregame952 11 місяців тому +18

    Background music was unneccessey. The video is good.

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

      Thanks for the tip! And thanks for watching!

    • @tower1990
      @tower1990 4 місяці тому

      Also the keyboard sound is a bit distracting. Haha

    • @Cezkarma
      @Cezkarma 4 місяці тому +1

      @@tower1990 Nah that stuff is like ASMR in programming tutorials

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

    Great tutorial. Thank you very much. Keep up the good work.

  • @charlesabju907
    @charlesabju907 8 місяців тому

    I've instantly recognized the Brazilian accent, great video man.

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

    Super solid video!!

  • @bowl1858
    @bowl1858 5 місяців тому

    hey great video! it was quite helpful and explained well. i do have one relatively minor thing to say though:
    i heard that using resources for save and load can actually like leave vulnerabilities for modders since they can 1. access your entire computer not just the game and 2. can run code, so anyone copying code from the internet into the resource can get their whole computer hacked if they don't know what they're doing (which is likely if they're copying code from the internet).
    so its probably better to use json for save/load systems unless godot changed something abt how resources work recently.

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

    i didnt see so much difference using a resource vs not in this example but i understand probably in more complex games this will be very usefull, Thank you very much for you clean explaination. u got a new suscriber :)

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

      Thanks! I appreciate it! I’ll try to make a video explaining a more complex example in the future.

    • @Ro11ingBoy
      @Ro11ingBoy 8 місяців тому +3

      a huge point probably is that you can save resources on the disk

  • @ritzenhauf
    @ritzenhauf 8 місяців тому +1

    I need to get a giant monitor just so i can follow videos like these

  • @arcade_mntra
    @arcade_mntra 11 місяців тому +2

    Hey man, topic well covered but I had to struggle through the video due to the cartoon font and distracting background music!
    Small feedback from someone who found your video helpful:
    For programming tutorials, music with drums(snare and high-hats) is best avoided as they take attention away from the content and sonically compete with speech. Music with soft synth chords without percussions and rapid changes is a better fit as it truly stays in the background.

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

      Thanks for the feedback! I'll definitely take into account for next videos.

  • @swatmc607
    @swatmc607 2 місяці тому

    Thank you sir!

  • @RhogerAnacleto
    @RhogerAnacleto 11 місяців тому +2

    I am trying to understand what is the difference between using resources (in your example) and using a custom node to control the stat. Is there any advantage I am not seeing?

    • @thepolyglotprogrammer
      @thepolyglotprogrammer  11 місяців тому +5

      With the example in the video, since it is quite simple, I see how it can be hard to visualise a huge difference. But the difference is in the pattern. A node is an actual instance of something that only exists in the world. A resource is a data container that exists outside of the world and can be used by node and passed around.
      For example, in my game Basterd Blitz (store.steampowered.com/app/2275000/Basterd_Blitz/), I have a node called weapon, which I instantiate and add to the world in the hand of my player. But I have a custom resource for the configuration of the weapon, that being model to spawn, fire rate, animation, sound and etc. So for example, I can create a new weapon called "Machine Gun" with all the information about the gun using my custom resource and now I can give the same gun to my player and an enemy, without have to add or create an extra node for each gun in each character.
      I hope I explained clearly.

  • @ianpullinger4785
    @ianpullinger4785 5 місяців тому

    Great content and really covered a lot of details in a short time. Please remove music in the future though, quite distracting.

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

    this is really helpful thank you

  • @a1534-d7k
    @a1534-d7k 11 місяців тому +1

    awesome

  • @dre_met
    @dre_met 2 місяці тому

    This video helped me a lot but I am still unsure about naming/hierachies and the relation to Nodes. Maybe someone can help out. I am creating a game with cars driving around a track and for every car I have a Node2D called "Car" with a Sprite within and a script attached. Based on this video and what I learned before I would create a script that extends resource called "Car.gd" in which I do "class_name Car" and define some variables witi @export var max_speed: float = 300.0. Then I create a resource called "sports_car.tres" based on it. Then I can do "@export var car: Car" in the script attached to the Car Node2D and access the variables with "car.max_speed" for example. What I don't like is the naming. Within the Car Node2D I would like to have a "speed" variable and not a "car.max_speed" variable because I am already "inside" the car. Also, runtime variables like "current_speed" I would then define in the script attached to the node, right? But then I would have "current_speed" (without "car.") and "car.max_speed". Maybe someone can help me think through this.