10 Tips For Using The Godot Engine

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ต.ค. 2024

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

  • @willnationsdev
    @willnationsdev 6 ปีที่แล้ว +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 6 ปีที่แล้ว +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.

  • @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.

  • @L0wPressure
    @L0wPressure 3 ปีที่แล้ว

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

  • @Casho0106
    @Casho0106 6 ปีที่แล้ว +18

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

  • @torq21
    @torq21 6 ปีที่แล้ว +11

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

  • @nightmathzombieethan
    @nightmathzombieethan 5 ปีที่แล้ว +2

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

  • @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.

  • @ВікторГаврилюк-х2ч
    @ВікторГаврилюк-х2ч 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?

  • @rsensato
    @rsensato 6 ปีที่แล้ว

    Just found your channel. Awesome.

  • @granwithlasers
    @granwithlasers 4 ปีที่แล้ว

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

  • @bagandtag4391
    @bagandtag4391 6 ปีที่แล้ว +1

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

    • @AlexHoratio
      @AlexHoratio  6 ปีที่แล้ว +2

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

  • @vikas_room
    @vikas_room 6 ปีที่แล้ว +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.

  • @eduardomota3068
    @eduardomota3068 2 ปีที่แล้ว

    whats the game from the video background?

  • @MinchPlayer
    @MinchPlayer 6 ปีที่แล้ว

    how does one fuck up a spagetti this badly?

  • @thegiantratthatmakesalloft9415
    @thegiantratthatmakesalloft9415 3 ปีที่แล้ว +1

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

  • @ColdBlueLight
    @ColdBlueLight 6 ปีที่แล้ว

    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  6 ปีที่แล้ว

      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 6 ปีที่แล้ว

      @@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

  • @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.

  • @projectvibe1226
    @projectvibe1226 4 ปีที่แล้ว

    This guy had a really bad time with pasta

  • @Antelope2000
    @Antelope2000 6 ปีที่แล้ว +7

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

    • @AlexHoratio
      @AlexHoratio  6 ปีที่แล้ว +1

      does your tablet run gentoo?

    • @Antelope2000
      @Antelope2000 6 ปีที่แล้ว +2

      Idk. On the back it says "wacom".

    • @AlexHoratio
      @AlexHoratio  6 ปีที่แล้ว +3

      wtf the fuck

    • @vikrambhavsar3558
      @vikrambhavsar3558 6 ปีที่แล้ว +2

      @@AlexHoratio what the fuck the fuck LMAAO

    • @TrentTheCreator
      @TrentTheCreator 5 ปีที่แล้ว +1

      Lol she trolling bruh😂🤣😂🤣

  • @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).

  • @aatifimmortal
    @aatifimmortal 6 ปีที่แล้ว

    Pasta story 👌

  • @embodyingocean189
    @embodyingocean189 4 ปีที่แล้ว

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

  • @hairiclilred
    @hairiclilred 6 ปีที่แล้ว

    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 :-)

  • @oskarjohansson6128
    @oskarjohansson6128 5 ปีที่แล้ว +1

    4:20 r/oddlyspecific

  • @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.

  • @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.