10 Tips For Using The Godot Engine

Поділитися
Вставка
  • Опубліковано 30 лип 2024
  • In the words of a wise man, "my inner child is a prostitute [for UA-cam views]"
    Patreon: / alexhoratio
    Twitter: / alexhoratio_
    Website: www.alexhoratio.co.uk/
  • Ігри

КОМЕНТАРІ • 72

  • @willnationsdev
    @willnationsdev 5 років тому +90

    00:07 Singletons (autoloads)
    00:35 PhysicsBodies (KinematicBody, Rigidbody, StaticBody)
    01:24 GDScript Ternary Operator (a = b if d else c)
    01:51 Use Singleton to preload all needed resources
    02:28 Specifying neighbors in Control nodes
    03:14 NinePatchRects
    03:53 Alex has a nervous breakdown
    04:49 Autotiling
    05:19 Using an external code editor
    05:45 Use >1 audio bus to control volume/settings for types of audio independently

  • @willnationsdev
    @willnationsdev 5 років тому +49

    Important to note: preloading a resource means that the resource is loaded when the *scene* is loaded. If it is in your main scene, or if it is in a singleton, then those resources will be loaded during the game's startup.
    Another reason you might want to stuff preloaded assets into a singleton is to use the singleton's name as a namespace. If I have a singleton called "Game" and I preload a scene called "BulletScn" onto it, then I can, anywhere in my code, just do "Game.BulletScn.instance()". You can even define subclasses within the singleton script that serve as sub-namespaces for resources. On the brightside, it effectively lets you simulate namespaces in GDScript. On the downside, it means modifying a separate script file just to maintain a namespace.
    This problem is *slightly* simplified in 3.1 since script classes allow you to add new "toplevel" namespaces just by naming your script (since that script will then be globally accessible and its preloaded resource constants will also be accessible without having to instance the script).
    extends Reference
    class_name Game
    const BulletScn = preload("bullet.tscn")

  • @TitlePending
    @TitlePending 5 років тому +11

    I'm doing a sort of guide by mistakes people have when starting, and found this as I was researching. I'm going to put a link to this in the video.

  • @nightmathzombieethan
    @nightmathzombieethan 5 років тому +2

    Loved the humor and the vid in general, Bravo and all that.

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

    Do not give up on your channel, i like it, and you are awesome.

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

    If your pasta didn't cook properly try to put it in water and cook it in the microwave for 5-8 minutes, it surely will be ready to eat, also you can boil your water in the kettle, before using it (water will boil much faster and you can heat up your stove simultaneously if it's electric and needs time to heat up). Also, you can try 1 piece of pasta before you strain it, so you know for sure that it's ready. Just use some creativity you surely already have, if you're fit to making games.

  • @rsensato
    @rsensato 5 років тому

    Just found your channel. Awesome.

  • @Casho0106
    @Casho0106 5 років тому +18

    I love your sense of humor. I now use GameMaker rather than Godot - but I I still watch your videos. LOL.

  • @torq21
    @torq21 5 років тому +11

    Pretty sure that after tip 7 I began to unlearn stuff by watching your video... I feel like a refund is in order.

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

    I love the way this guy talk :)

  • @Marduk401
    @Marduk401 4 роки тому +4

    My brain today: its time to stop being depressed and actually do some work, go search for some godot tips to feel better.
    3:53 comes in.

  • @bagandtag4391
    @bagandtag4391 5 років тому +1

    The audio bus one is pretty neat. Any tips for the ng+ lost sinner bossfight in dark souls 2?

    • @AlexHoratio
      @AlexHoratio  5 років тому +2

      I quit playing Dark Souls 2 after encountering a Smelter Demon so uhh I guess tip #11 is to just quit

  • @user-pl3gw1gi9n
    @user-pl3gw1gi9n 4 роки тому

    I"ve been using LibGDX before, and it has some very good dedicated classes for resource upload and storing, which makes implementing resource management very easy(it had methods for adding resources for loading queue, and further loading of queue itself, and for accesing those resources later by their path and/or name). I'd like to do something like that with my Godot game, but not sure how to implement it better. Could you please do a more detailed tutorial on your resource loader singleton?
    Also, just want to check my understanding of how it works in Godot.
    Let's say I have a texture file, and I've preloaded it in my Preloader. Now, if I want to set that texture to a sprite, I have to do it with code in my sprite's (or whatever holds the sprite) script, right? I mean, if I then just drag a texture to the sprite's "texture" field in the edior, it will still preload it when creating a scene, ignoring the fact that i have already preloaded it in my Preloader?

  • @ColdBlueLight
    @ColdBlueLight 5 років тому

    i have a really odd problem where my 2d sprites blur when moveing but are fine when not i tryed serveral solutions but none worked do you know what might be causeing this?

    • @AlexHoratio
      @AlexHoratio  5 років тому

      Probably what's happened is that they're being imported with a filter. On the right hand side in your file explorer thingy, find the .pngs, click on them, on the right hand "import" tab deselect "filter". That should do it.

    • @ColdBlueLight
      @ColdBlueLight 5 років тому

      @@AlexHoratio i have done this its not the filter i think its something to do with interpolation but i dont know how to turn that off in godot its either that or something like an optical illusion brought on by the low contrast background or something weird like that.

    • @MaoDev
      @MaoDev 5 років тому

      @@ColdBlueLight It should disapper after exporting I think. Godot's gdscript is interpreted in the engine and it runs slower, but after you export the project it compiles and should be 3 times faster.

    • @ColdBlueLight
      @ColdBlueLight 5 років тому +1

      @@MaoDev i found out that this was a bug with certain nvidia cards and when i last checked still has not been fixed in the current release but is a currently known bug.

    • @MaoDev
      @MaoDev 5 років тому

      ​@@ColdBlueLight Well...I have this bug on my intel hd graphics too

  • @granwithlasers
    @granwithlasers 4 роки тому

    Dude what was that pasta tale... I'm here if you need anything ok...
    jokes aside, nice video, +1 sub

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

    whats the game from the video background?

  • @aatifimmortal
    @aatifimmortal 5 років тому

    Pasta story 👌

  • @maoitsme0
    @maoitsme0 4 роки тому

    What's wrong with using kinematic body for bullets?

    • @avgchoobafan
      @avgchoobafan 4 роки тому +1

      You have so much functionality that you don't use. I use Area2D as parent and ColliderShape2D and Sprite or AnimatedSprite as child.
      In the script attached to Area2D just make the bullet go forward using translate(vector2) and that is, the collitions are handled via signals.
      Im using things like
      export (int) var dmg = 2
      func body_entered(body):
      if(body.is_in_group("Enemy")
      body.TakeDamage(dmg)
      queue_free()
      And that's all for making a simple health system and projectile damage

    • @maoitsme0
      @maoitsme0 4 роки тому

      @@avgchoobafan yeah, it's just as easy using kinematic body

    • @maoitsme0
      @maoitsme0 4 роки тому

      @@avgchoobafan for example, in the script of the bullet. To detect collisions you can use:
      for collision in get_slide_count():
      var body = get_slide_collision(collision).collider
      if body.is_in_group("enemy"):
      body.take_damage()
      self.queue_free()
      but you can use the move_and_slide function instead of adjusting the position. I don't think Area2D is a bad choice for making a bullet, but only that KinematicBody2D is just as good.

    • @maoitsme0
      @maoitsme0 4 роки тому

      @@avgchoobafan so what's the functionality you were talking about that you cannot use with a KinematicBody?

    • @festerdam4548
      @festerdam4548 4 роки тому

      @@maoitsme0 @Matt-San meant there's too much functionality not too little. KinematicBodies have some more functionality than Area2D's. Most of it is not really needed.

  • @Antelope2000
    @Antelope2000 5 років тому +7

    Please help! I downloaded RPG maker like you suggested, and my tablet crashed!

  • @vikas_room
    @vikas_room 5 років тому +4

    Alex: Singletons-
    Me, holding holy water and a bible: BEGONE, DEMON!

    • @MaoDev
      @MaoDev 5 років тому

      why?

    • @XMaster340
      @XMaster340 5 років тому

      @@MaoDev Singeltons, goto and some other concepts are considered bad amongst programmers. This has several reasons and is true for most cases. However game developement is kind of an exception from most rules.

    • @MaoDev
      @MaoDev 5 років тому

      @@XMaster340 I mean, if there weren't singletones in godot, you had to copy and paste a function in every script you needed it.

    • @XMaster340
      @XMaster340 5 років тому

      @@MaoDev You can preload a script and use it

    • @MaoDev
      @MaoDev 5 років тому

      @@XMaster340 that's what a singleton is in Godot. A global script that is preloaded.

  • @MinchPlayer
    @MinchPlayer 5 років тому

    how does one fuck up a spagetti this badly?

  • @festerdam4548
    @festerdam4548 4 роки тому

    Is it just me or do you have some difficulties with the "r"s? To me it actually sounds nice, although I sometimes have to chuckle a bit (I'm not used to it).

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

    LOL! THE PASTA JOKE IS SO RANDOM!! I ROFLED! THANKS FOR MAKING ME LAUGH!!!!!!!!!

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

    This guy had a really bad time with pasta

  • @embodyingocean189
    @embodyingocean189 4 роки тому

    14 scripts?! jee my game maker game has at least 40

  • @hairiclilred
    @hairiclilred 5 років тому

    how can you fuck up cooking pasta? is the easiest food to cook!

    • @igorthelight
      @igorthelight 5 років тому

      He has Cooking skill (-1)
      A very rare talent :-)

  • @neetizen5692
    @neetizen5692 5 років тому

    why u talk to fast:(

    • @igorthelight
      @igorthelight 5 років тому +1

      He is talking fine.
      Oveclock your brain :-)

    • @festerdam4548
      @festerdam4548 4 роки тому

      Just use subtitles. For me it's easier to accompany someone talking when it has subtitles. Also, you can change the speed in most good video players I know of.

  • @oskarjohansson6128
    @oskarjohansson6128 5 років тому +1

    4:20 r/oddlyspecific

  • @jameshall8781
    @jameshall8781 5 років тому +1

    Vulgarity and blasphemy was unfortunate. Shut it off 5 seconds in.

    • @AlexHoratio
      @AlexHoratio  5 років тому +4

      Thanks for letting me know? :D

    • @igorthelight
      @igorthelight 5 років тому

      @@AlexHoratio That was not a problem for me! :-)

    • @FreeD00M
      @FreeD00M 4 роки тому

      Well that was what I liked about it.
      Taste may vary...

    • @alfie8778
      @alfie8778 4 роки тому +1

      Blasphemy? Cute.