EntityBase, HP, and Inheritance (Combat Essentials in Godot | P1)

Поділитися
Вставка
  • Опубліковано 4 жов 2024
  • And we're starting a Godot tutorial series dedicated to the basics of combat implementation! In this video, we'll cover setting up entity base and inheritance - one of the fundamental principles of OOP.
    INITIAL PROJECT: github.com/Ive...
    PROJECT REPO: github.com/Ive...
    o_lobster, the artist who provided me his asset pack: @sir_shazam o-lobster.itch...
    AnimationPlayer node tutorial: • Animating the Player i...
    SUPPORT ME▹
    Subscribe to my channel: / @johnivess
    Buy me a coffee: ko-fi.com/john...
    Follow me on Twitter: / ivess_john
    Check out my games and other products: ivess.itch.io/
    My Reddit: / ivessjohn

КОМЕНТАРІ • 41

  • @JohnIvess
    @JohnIvess  3 роки тому +17

    One smart guy remarked that it might cause confusion for newcomers because with Godot's tree structure nodes that are "folded" into other nodes are also called "children", and, respectively, that which they are folded into is named the "parent". This SHOULDN'T BE CONFUSED with the parent-child relationship in inheritance. Here's the difference:
    1) In the scene tree, parent and children nodes can just access each other, and that's it - children do not directly expand their parent's functionality. It's like if you had your documents in a folder - sure, they are folded, but the folder is just a container.
    2) In inheritance, a parent is a base upon which a child builds its functionality. It's basically taking a knife (parent) and inventing many more specific instruments of it, like bowie knife, utility knife, combat knife, surgical knife. Children not *necessarily* expand functionality, but they do inherit the parent's features.

    • @hiiambarney4489
      @hiiambarney4489 11 місяців тому

      Exactly this!
      A Player "folded", as you stated eloquently, into a Game World shouldn't need to inherit its, say, Parallax Texture for example.
      Conversely, we can assume the Utility Knife should inherit it's parent "Knife"'s defining features, such as having a Blade and a Handle (I guess that is the bear necessity for a Knife).

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

      I almost strangled god because of this, THIS is the one thing that was confusing me to no god damn end. I literally couldn't understand how to make nodes communicate with each other because no one specified this

  • @ihtasham9237
    @ihtasham9237 3 роки тому +13

    Ive literally been looking for a tutorial like this for MONTHS now. Thank you for this

    • @JohnIvess
      @JohnIvess  3 роки тому +2

      I'm super glad it helped!

  • @lyrdinn6185
    @lyrdinn6185 3 роки тому +4

    Very nice tutorial, can't wait for more ! I really like this form of tutorials where people get to the point instead of writing it in real time, your editing is good !

  • @richbuilds_com
    @richbuilds_com 11 місяців тому

    I couldn't understand why my custom classes weren't picking up their parents child nodes!
    Scene -> New *INHERITED* scene was the magic I was missing! Thanks so much for that!

  • @ivyy8221
    @ivyy8221 3 роки тому +3

    I'm writting here to let you know that you have a new sub. Saludos crack.

  • @stefanfyhn4668
    @stefanfyhn4668 3 роки тому

    Thanks for this simple introduction. I think I now understand how an entitybase works. Other tutorials seem to skip over it so fast I couldn't really understand it :)

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

    I’ve seen a few of your videos now and your presentation is very simple and helpful. Thanks a ton.

  • @solodolphin
    @solodolphin 3 роки тому

    You're making a great job man, I understand everything more clear than much of old tutorials. I am expecting to see your all videos.
    You are a very good Godot Teacher :d

    • @JohnIvess
      @JohnIvess  3 роки тому

      Thank you!
      You mean my old tutorials are less understandable, or tutorials that were out there on a similar topic prior to me?

    • @solodolphin
      @solodolphin 3 роки тому

      @@JohnIvess The second one. Most of the tutorials in youtube are outdated and hard to understand and also very long to get some tricks about Godot. (Sorry for my not clear message :D)

  • @tayete
    @tayete 3 роки тому

    Great tutorial John! Very well explanied and clearly documented.

    • @JohnIvess
      @JohnIvess  3 роки тому

      Thanks for your kind words, Tayete!

  • @stanisawslany322
    @stanisawslany322 2 роки тому +1

    Could you do a tutorial on how to make two units fight without controlling them? Like in every rts game, two units will automatically fight each other when they get close or when given an attack command.

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

    Thank you ❤

  • @Betegfos
    @Betegfos 11 місяців тому

    Nice video! Can you make an updated version for this in 3D for Godot?

  • @Michael-ih3fp
    @Michael-ih3fp 5 місяців тому

    I am currently trying to update the hp_max to something different for the enemy and I get the error invalid set index max_value (on base: 'Nil') with value of type 'int'. This occurs in function func set_hp_max on line healthBar.max_value = hp_max. Please help anyone. Thank you!

  • @Flo-go6bf
    @Flo-go6bf 3 роки тому +1

    can you maybe link the video where you do the animation?

    • @JohnIvess
      @JohnIvess  3 роки тому

      It's already linked as a suggestion. If you do not see it, check the description, I left a link there, too!

  • @nicholaslabonte3491
    @nicholaslabonte3491 7 місяців тому

    Ik godot 4 changed the variables.
    @export var number: int = 5
    Im currently using export range for species variation of stats
    @export_range (1, 100) var Name: int
    Im trying to add personality integers as well
    is it possible to add to children levels for Base --> Species --> individual with nature? or am I mistaken?

  • @rambosweat
    @rambosweat 2 роки тому

    why not use class_name for base class and then extend the base class in the player script? this way if path to base script changes game doesn't break.

  • @miketomas7536
    @miketomas7536 3 роки тому

    Great tutorial, i just have one question. Why is there a _physics_process(delta) with the move function in it in both the enity and the player?

    • @JohnIvess
      @JohnIvess  3 роки тому +1

      Because I have overwritten the functionality of Entity in the player regarding the method _physics_process(delta) that exists in both of them.
      I expanded the functionality of Player compared to Entity, but regarding particularly this method the function was basically rewritten. I could write Player's new code and at the end of the method call .base(), calling the basic functionality to go after that (or something like that, can not really recall the exact way you call it). However, I preferred to not mention it because 1) I never use it, especially in Godot 2) IMO it's better to have a couple of methods rather than rewriting one big.
      Hopefully, it helps.

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

    How come most ppl just skip this? I was having a hard time cuz I'm a veteran and this engine seems so good but no one was talking about this and instead where teaching me things like hard code, only interact with objects you already have a reference...

  • @g0ldhat55
    @g0ldhat55 3 роки тому

    Can you do a tutorial for enemy ai as well?

    • @JohnIvess
      @JohnIvess  3 роки тому

      I will. It is one of the planned videos. I can't really say when to expect it exactly, but it will be eventually.

  • @saku-ra8813
    @saku-ra8813 3 роки тому

    Hello!
    I’ve got a little problem, when I was programing the movement of the player, I couldn’t move, but when I changed the move_left, move_right…
    to ui_left, ui_right… I could finally move, do you know what’s the difference between them?

    • @JohnIvess
      @JohnIvess  3 роки тому

      You didn't set up the move_left and move_right input actions in the Input Map. It's one of the tabs inside of your Project Settings window.

  • @Syed21871
    @Syed21871 2 роки тому

    Hey.. I have a small issue to say, I really want to make this, but the github file when I click "raw" to download it says the web page is not available 😢 Is there any other way I can download all the assets?

    • @JohnIvess
      @JohnIvess  2 роки тому

      You can download the whole repository and take the files you need from there.

    • @Syed21871
      @Syed21871 2 роки тому

      @@JohnIvess how tho?

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

    haha i'm like number 666

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

    i cant understand what your saying at all, please speak more clear next time less scratchy

    • @Trendsthismonth
      @Trendsthismonth 21 день тому

      I have been coding for a while and thought the same thing. However, I will watch it a few times to get the idea down.

  • @miss.antidote
    @miss.antidote 10 місяців тому +1

    Thank you for sharing you knowledge, going to start today!