HD-2D Style in Godot 4.1

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024
  • In this video, I'll go through how to implement some of the key elements from the Octopath Traveler style in Godot 4.1. These concepts can also be generalized for 3D or 2.5D games.
    ☕ Download the source code on Ko-Fi
    ko-fi.com/s/08...
    🕛 Time Stamp
    1:30 Pixel Art Player
    5:35 Level Design Elements
    8:54 Light, Shadow and World Environment
    10:14 Bloom Settings
    10:28 Depth of Field Settings
    10:56 Vignette
    11:20 God Rays
    🗑️ Pastebin
    Character Body 3D Code: pastebin.com/J...
    SpringArm 3D Code: pastebin.com/E...
    Vignette Shader: pastebin.com/2...
    🛒Amazon Affiliate Links
    If you feel like shopping and supporting me, here are some of my essential buys
    Productivity Mouse - amzn.to/3pqQjjN
    Low Profile Productivity Wireless Keyboard for Multiple Devices - amzn.to/43YtenR
    The BEST Office Chair - amzn.to/3NLbrKW
    Graphics Tablet for Your Game Assets - amzn.to/46zlNoX
    HDMI Extender - amzn.to/3NLDcTN
    🏅🏅Attributions🏅🏅
    Assets Used
    Skybox - artstn.co/m/1LgWz
    Pixel Art - cainos.itch.io...
    Spritesheet - www.spriters-r...
    Music
    'Permafrost' by Scott Buckley - released under CC-BY 4.0. www.scottbuckley.com.au

Комментарии • 126

  • @kplays_6000
    @kplays_6000 11 месяцев назад +60

    Some tips for people following this:
    - The player animation should have both feet on the ground between each step, or should not show that frame at all whilst walking
    - Maybe slow the player down a little - he seems to be walking a little too fast for it to look right in a larger scale project
    - Move the camera up a little - whilst your player should be the centre of attention, you should still be able to see what's in front of him
    Great tutorial!

    • @gamedevaki
      @gamedevaki  11 месяцев назад +3

      thanks for the great tips!

  • @Casseous
    @Casseous 11 месяцев назад +70

    I advise beginners to not use this tutorial as it does gloss over some finer details on creating this from scratch. Otherwise, it's a good tutorial for more seasoned devs.

    • @catcactus1234
      @catcactus1234 7 месяцев назад +7

      Also the walk animation code is pretty bad. You can achieve the same thing just by checking the input axis value for all 4 directional inputs, then playing the correct animation based on the number it returns. If no input is detected, stop the animation. There’s no reason to manually update the frames when you can just call .play(“animation_name_” + direction) method on your animation player mode. It’s unnecessarily complex and weirdly limiting.

    • @cromazac
      @cromazac 6 месяцев назад +11

      What tutorial should we use ;-;

    • @cromazac
      @cromazac 6 месяцев назад

      ​@@catcactus1234 explain it in code form so I can ̶c̶̶o̶̶p̶̶y̶ ̶a̶̶n̶̶d̶ ̶p̶̶a̶̶s̶̶t̶̶e̶ ̶i̶̶t̶ understand it better

    • @cromazac
      @cromazac 6 месяцев назад

      ​@@catcactus1234 can you explain it in code form so I can c̶̶o̶̶p̶̶y̶ ̶a̶̶n̶̶d̶ ̶p̶̶a̶̶s̶̶t̶̶e̶ ̶i̶̶t̶ understand it better

    • @casentinex1339
      @casentinex1339 Месяц назад +5

      @@catcactus1234 Can you give a more in depth explanation, or point to a video that explains what you are talking about regarding checking the animations based on axis value?

  • @bryansmith508
    @bryansmith508 11 месяцев назад +9

    I love your videos on HD2D! I appreciate how you walk through an entire scene, not just one aspect of the scene. It allows me to understand exactly how you went from scratch to the final product!

  • @angryybot6367
    @angryybot6367 11 месяцев назад +9

    You can simply mark the UV as triplanar instead of setting its coordinates to 3, 2 ,1.
    the checkbox for this is right below the UV scale and offset

    • @gamedevaki
      @gamedevaki  11 месяцев назад +3

      that's cool, thanks for the tip!

    • @triskaideka13
      @triskaideka13 7 месяцев назад +2

      you angryybot are a scholar and a gentlebot

  • @SaharatOfficial
    @SaharatOfficial 3 месяца назад +3

    Instead of incremental turns, the easiest method for turning is just if Input.is_action_pressed: "move_left" rotation.y += 1 x delta. (-= if your going right.)

    • @PopViewsPh
      @PopViewsPh 15 дней назад

      What code if I add animations? I'm still a beginner but I want to learn more

  • @ShadowOverflow
    @ShadowOverflow 9 месяцев назад +4

    Your content is amazing! Your editing, speed, and style is top notch!
    Thank you for all of the effort you put in.

  • @Gatitasecsii
    @Gatitasecsii 8 месяцев назад +3

    This has helped me kickstart my project so much!! I thank you from the bottom of my heart!

  • @bluzenkk
    @bluzenkk 11 месяцев назад +28

    Suggestion:
    add a normal map on the 2D sprite so it react with the light dynamically.

    • @gamedevaki
      @gamedevaki  11 месяцев назад +5

      Thanks for the tip, going to research about that next!

    • @ohiasdxfcghbljokasdjhnfvaw4ehr
      @ohiasdxfcghbljokasdjhnfvaw4ehr 11 месяцев назад

      nah that always looks ugly

    • @longtranha8695
      @longtranha8695 11 месяцев назад +2

      If you draw a pixel art of something and you have to spend time to make a normal map of it -> A lot of time -> Solution : draw pixel with shadow cast same direction with 3D direction light

    • @neozoid7009
      @neozoid7009 10 месяцев назад

      but how to enable shadow for the sprite ? my spite3D is not casting shadows

  • @KevinNijmeijer
    @KevinNijmeijer 3 месяца назад +4

    Claiming HD-2D doesn't work on web is completely false, it's the shaders that you use in the scene that don't work. HD-2D as a visual style can 100% work on Web / mobile.

  • @revidev
    @revidev 11 месяцев назад +4

    Awesome!🎉 . I'm eager to see combat mechanics from your game. Keep the good work!

    • @gamedevaki
      @gamedevaki  11 месяцев назад +1

      Thanks for the kind words! You're in for a treat, I'm currently planning the combat mechanics for my game!

  • @user-tp1fy3sp5c
    @user-tp1fy3sp5c 11 месяцев назад +2

    Thank you very much for your tutorial, I have been looking for it and I had given up on this type of 2D to 3D format and it came out recommended, keep it up (if by chance you see spelling errors or misspelled words, I used a translator.).

    • @gamedevaki
      @gamedevaki  11 месяцев назад

      Thanks for the kind words! Glad you find this helpful and good luck on your project!

  • @yusarimahubara
    @yusarimahubara 7 месяцев назад +1

    Dude wtf, this is top notch quality tutorial, keep going bro!

  • @lagmaronchim1435
    @lagmaronchim1435 11 месяцев назад +4

    great 2.5d tutorial, thanks!

    • @gamedevaki
      @gamedevaki  11 месяцев назад +1

      glad that you like it!

  • @ebooooooy4249
    @ebooooooy4249 11 месяцев назад +2

    This is fire, I've been looking for a HD-2D Style tutorial on Godot but almost all videos teach it on UE5. Do more videos about HD-2D Style and can you explain everything step by step. I'm a total beginner.

    • @gamedevaki
      @gamedevaki  11 месяцев назад

      Glad that you find this useful. Sure, think I can make a video for a total beginner.
      Curious which parts you find difficult to follow in this video so I can improve them

    • @ebooooooy4249
      @ebooooooy4249 11 месяцев назад

      For example at min 3:12 you typed some code for the animation, where do I type it? is it a script attached to the animation?Honestly your videos are very informative but for absolute beginners the pace might be fast. Also there is another ytuber who posts similar 2DHD tutorials for UE5, you can probably grow your channel by doing the same thing for Godot. his channel is CobraCode incase you wanna get some ideas.@@gamedevaki

    • @gamedevaki
      @gamedevaki  11 месяцев назад

      Cool, thanks for details. CobraCode looks cool, thanks for the recommendation!

    • @Zahuranecs
      @Zahuranecs Месяц назад

      My sprite sheet is completely different, so I'm having a bit of trouble coding that for facing, but this video is a start! (Maybe explaining how the script updates the actual sprite chosen?) Either way, great tutorial

  • @Ah2o5b
    @Ah2o5b 11 месяцев назад +2

    Great tutorial as always

    • @gamedevaki
      @gamedevaki  11 месяцев назад +1

      Thanks for the constant support!

  • @AsatteGames
    @AsatteGames 7 месяцев назад

    This really helped me a lot! Thank you for the video :)

  • @TEDDeng
    @TEDDeng 5 месяцев назад

    Really learned a lot from this video, much appreciate.

  • @meteorogames9523
    @meteorogames9523 11 месяцев назад

    This is exactly what I was looking for, thank you sir!

    • @gamedevaki
      @gamedevaki  11 месяцев назад

      Thanks for the kind words, glad that I could help!

  • @casesolia7356
    @casesolia7356 3 месяца назад

    Fantastic video! Thank you so much.

  • @Chareidos
    @Chareidos 9 месяцев назад +1

    Nice Tutorial. To the point.
    Unfortunately I have to look for another approach for implementing my 2D Character with Skeletal Animations into a 3D World.
    Bodyparts are using 2D Sprites (with 6 Frames for Directions).
    I do not think that it will work with Sprite3D?
    Maybe I need to look for some Tutorials with viewports in mind.
    But the video was overall useful and I still got plenty to take with me to make a 3D World rather quick and easy.
    Thank you for the Tutorial

  • @glitched_code
    @glitched_code 11 месяцев назад +2

    -Animating a sprite sheet like you described in the first part of the video is a bad idea. When you eventually will need to edit those animations it will quickly become an unmantainable mess, especially if you do it in code. It's better to use AnimationPlayer instead, since it has way more built in functionality and is easier to use for people that don't usually code, like animators, designers and sprite artists.
    -Did you dub this video using an AI voice model?

    • @gamedevaki
      @gamedevaki  11 месяцев назад +1

      Thanks for the good point.
      In my opinion, animation player is ideal for complex animations like cut scenes or battles.
      I would prefer my approach for homogenous animation - imagine having to set the same key frames for 100s of sprite. Of course, it is up to each developer to make the judgement call.
      Yes. Using Tortoise TTS model.

  • @grayfaux_
    @grayfaux_ 8 месяцев назад

    Fantastic video!

  • @HE360
    @HE360 11 месяцев назад +1

    I might adapt some of these ideas to Godot 3.5 since I probably won't be switching to Godot 4.0+ just yet.

    • @gamedevaki
      @gamedevaki  11 месяцев назад

      Good idea! Might need some tweaking though, especially in WorldEnvironment

  • @Vercidium
    @Vercidium 10 месяцев назад +2

    I love this pixel-art HD style! Do you have a Twitter or Discord where we can talk about game dev?

  • @user-xq3vh2bg1t
    @user-xq3vh2bg1t 7 месяцев назад

    Wow, keep these awesome videos coming! What a relief to find someone who gets to the point, and also has great taste. Plus, you are the only tutorial maker I have yet to come across who does not sound castrated. For real: so much content I won't access because I can't bear hearing the eerily common soy tone - and often ESL (English as a Secondary Language) pronunciation. It all results in sounding like fingernails scratching across a chalkboard. Thanks for being different!

  • @pipeliner8969
    @pipeliner8969 8 месяцев назад

    thanks a lot, great video

  • @fridyrogide8752
    @fridyrogide8752 11 месяцев назад

    Well, that's quite a tutorial there !
    Fantastic

    • @gamedevaki
      @gamedevaki  11 месяцев назад

      Thanks, glad you like it!

    • @fridyrogide8752
      @fridyrogide8752 11 месяцев назад

      @@gamedevaki Just show everything then loll

  • @DestusG
    @DestusG 11 месяцев назад

    Thanks learned a lot

    • @gamedevaki
      @gamedevaki  11 месяцев назад

      Glad to hear that!

  • @misguidedcouch
    @misguidedcouch 18 дней назад

    I have a simple movement with one frame, how would I update this code to properly execute?

  • @Yalloriess
    @Yalloriess 11 месяцев назад +1

    Sad we didnt get to at least see the result at the end of the video

  • @anomalyaces9204
    @anomalyaces9204 Месяц назад

    Sorry to necro this a bit, but how did you figure out the UV trick... it has saved me soo much time! Thanks!

    • @gamedevaki
      @gamedevaki  Месяц назад

      I remember reading about it somewhere in Godot 3.5 documentation. Can't seem to find the link now.

  • @TA-MUSIIQUE
    @TA-MUSIIQUE 6 месяцев назад +1

    I absolutely need this moving environment folllowing the camera of the character like you made with trees! Is that possible in Unreal Engine 5?

    • @TA-MUSIIQUE
      @TA-MUSIIQUE 6 месяцев назад

      I need this tutorial in Unreal Engine :/

    • @gamedevaki
      @gamedevaki  6 месяцев назад +1

      ah sorry, I don't have experience with Unreal Engine.
      I didn't really do anything crazy in this tutorial so it should be applicable to Unreal Engine 5

  • @collinvisser7108
    @collinvisser7108 11 месяцев назад +1

    Very good video - nice and detailed but not going into lot of details - very good pacing.

    • @gamedevaki
      @gamedevaki  11 месяцев назад +1

      Thanks for the kind words, glad that you enjoy this video!

  • @richardlitter6956
    @richardlitter6956 9 месяцев назад +1

    I'm playing around with making something like this so I'll ask here and see if someone recognizes my issue if that's alright? I can see the invisible parts of my sprite when it moves. It blurs whatever's behind it so you can clearly see the edges of the sprite frame. Any idea what could have caused this? It's not even animated yet, it just happens when the player moves. I have the spritesheet imported the way you did it and I can't really find anyone else who's got this issue and it's driving me nuts :P

  • @NexusBaum
    @NexusBaum 2 месяца назад

    how is your project going?

  • @Lexipumpkin783
    @Lexipumpkin783 24 дня назад

    could you try doing this in cyclops editor for godot?

  • @SaharatOfficial
    @SaharatOfficial 3 месяца назад

    Umm anyone realize the walking code is in Vector2? I debugged this for 30 mins to realize i needed to have direction.z instead of direction.y to move up and down.

  • @triskaideka13
    @triskaideka13 7 месяцев назад +1

    How do you get the trees to sway?

    • @gamedevaki
      @gamedevaki  6 месяцев назад +1

      I've made a video to go through the tree sway here - ruclips.net/video/g17C_EXna3M/видео.html

  • @user-ni4ll1gr2h
    @user-ni4ll1gr2h 9 месяцев назад

    3:57 what value does "facing" represent?

  • @Garretlike
    @Garretlike 7 месяцев назад

    i have the problem that th players feed are like inside the tiles from a y direction with collision detection, is there some kind of offset so that the sprite does not seem to have its feet cut off from the block tiles?

    • @gamedevaki
      @gamedevaki  6 месяцев назад +1

      I usually offset it based on the position of my tile. e.g. if my floor tile is on default position (0,0,0) and has a height of 1, I'll offset it by 0.5

  • @grayfaux_
    @grayfaux_ 8 месяцев назад

    I feel like a dithered shadow shader would set this off.

    • @gamedevaki
      @gamedevaki  6 месяцев назад

      thanks for the great idea, let me try figure that out!

  • @benjaflinston
    @benjaflinston 4 месяца назад

    My character's sprite is blured. How I fix this?

    • @The_Omnipotent
      @The_Omnipotent Месяц назад

      go to the sprite animation or animation player and on the right side yo will see flags in there you choose nearest as the texture filter
      let me know if this helped

  • @neozoid7009
    @neozoid7009 10 месяцев назад +1

    I can't find the sprite sheet for download

    • @LilFishowo
      @LilFishowo Месяц назад

      You can use any free on don't worry

  • @Garretlike
    @Garretlike 8 месяцев назад

    Should the SpringArm3D be bound to the player character? Shouldn't it be used in the level scene and the level scene inherits the player character? sry, i'm new to game development and just trying to think about structure a bit for my project as well. Hence, for some reason my animations for moving forward, back, left and right don't seem to work correctly. i think i did everything as according to the video. The sprite seems to orientate the specific frames at least in the directions it should look, but then is stuck on the one frame animation instead of doing the rest of the 6 frames for the specific direction it is facing. Anyone having a similar problem?

    • @gamedevaki
      @gamedevaki  6 месяцев назад

      I'm mainly using the SpringArm3D to control the camera in relation to the player, that's why I bind it to the player.
      That way, when the player moves to different stages, it will still have the same SpringArm3D and Camera attached to it.

  • @CHnailer
    @CHnailer 8 месяцев назад

    And if you want to add animations to attack moves Animation of storage position Do I have to draw another picture png and do it all over again?

    • @gamedevaki
      @gamedevaki  6 месяцев назад

      Yeah, you need a separate animation for attacks.

  • @casul-4891
    @casul-4891 11 месяцев назад +1

    Do you have any plan to make a game in steam?

    • @gamedevaki
      @gamedevaki  11 месяцев назад

      That's like the dream! Not sure how long it takes for me to get there though.

  • @danielantonioreyesarmas359
    @danielantonioreyesarmas359 9 месяцев назад

    Te amoooo!!!!

  • @UZPvNUCaaQdF
    @UZPvNUCaaQdF 11 месяцев назад +1

    This really isn't showcasing bloom or DoF very well (to be fair, a lot of Octopath players feel the effect is too strong in that game). I think you should build another scene and reassess whether your shaders are working as intended

    • @gamedevaki
      @gamedevaki  11 месяцев назад +1

      Thanks for the feedback. Agree that I failed to give bloom or DoF the showcase it deserves.
      Let me work on another video focusing on those effects across multiple scenes for a better showcase.

  • @michealsfriendtrevor9761
    @michealsfriendtrevor9761 9 месяцев назад

    can you make a video on how to flip the sprite of an enemy or other npc correctly so that they always face the player when you rotate the camera? My code only works when I am not rotating the camera. In my code, I make the enemy calculate the distance vector3 between it and the player when it is agro and normalized it, then I make the enemy choose to flip sprite or not based on the x axis of it. It worked fine before I saw your video and decide to add the rotate camera to the game like don't starve.

    • @gamedevaki
      @gamedevaki  6 месяцев назад

      off the top of my mind, I'm thinking of using RayCasting to identify the camera position relative to the players to decide on the flipping and facing.

  • @TheNixtlyWorkshop
    @TheNixtlyWorkshop 11 месяцев назад

    I Just have a question, how i can make the facing code? Like i should make a "onready var"?

    • @gamedevaki
      @gamedevaki  11 месяцев назад

      Sorry, I don't quite get the question you are asking. Do you mind giving me more context?

    • @TheNixtlyWorkshop
      @TheNixtlyWorkshop 11 месяцев назад

      ​​@@gamedevakii'm sorry for the delay, i got an error in the code: 'The identifier "facing" isn't declared in the current scope.' I use godot 3.5 because i cant use godot 4

    • @TheNixtlyWorkshop
      @TheNixtlyWorkshop 11 месяцев назад

      I'm still new at godot

    • @gamedevaki
      @gamedevaki  11 месяцев назад

      thanks for the context. yes, you need to define the variable through something like "var facing = 0"
      it's been a while since I've last used Godot 3.5, so I don't remember the intricacies but you would need to make sure facing is usable by the entire script, not just the function.
      you should be able to do that by placing "var facing = 0" outside of all functions

    • @TheNixtlyWorkshop
      @TheNixtlyWorkshop 11 месяцев назад

      @@gamedevaki ok!!! Thank you!

  • @ararashi8967
    @ararashi8967 11 месяцев назад

    If i make it in mobile renderer, ¿ who are the parameters i need to change ?

    • @gamedevaki
      @gamedevaki  11 месяцев назад

      mobile renderer would need some tweaking in the Depth of Field and bloom settings for greatest impact. World environment and light settings also need some tweaking for minor improvements.

  • @zitronekoma30
    @zitronekoma30 4 месяца назад

    4:45 this code makes my skin crawl, please never do this. initiate all your stuff first, then make the if statements which just set a variable to either +PI/2 or -PI/2, then tween. this is so much needless code duplication.

  • @NexusBaum
    @NexusBaum 6 месяцев назад

    🙏

  • @AppMaker728
    @AppMaker728 Месяц назад

    Too much ideas I keep getting about making video games godot I'm getting too many ideas of what game to make I never had many game ideas with unity like with Godot and Unreal

  • @CanalTVCP
    @CanalTVCP 2 месяца назад

    Are you alive?

  • @AppMaker728
    @AppMaker728 Месяц назад

    It's too much too much ideas of what game to create

  • @sadaneduardo4391
    @sadaneduardo4391 3 месяца назад

    after godot completely failed to load and properly displays basic 3d models I also tried to use the 2.5d aproach but after I noticed godot is bugged even to load a bunch of images I just went back to unity

  • @lynic-0091
    @lynic-0091 11 месяцев назад

    Your previews are way too short, show off what you've made for longer! Lol

    • @gamedevaki
      @gamedevaki  11 месяцев назад

      thanks for the feedback, I'll try adding longer previews in the future. curious what do you think is a good length for the end results showcase?

  • @notSoAnonyymus
    @notSoAnonyymus 11 месяцев назад +3

    Recommendation: remove the AI voice use your own or ask a friend to read the line.

    • @gamedevaki
      @gamedevaki  11 месяцев назад +11

      thanks for the feedback, being an Asian with English as my second language makes this a little challenging.
      not to mention the hate I've gotten from my old videos for my accent and grammar mistakes
      making videos is just a hobby for me, so I rather just use an AI voiceover so I don't need to deal with the haters lol

    • @temp_text7728
      @temp_text7728 11 месяцев назад +7

      I appreciate the current voice settings used. It's clear and not hard to listen to like other AI voices. Better to be able to understand what is being conveyed clearly. I have struggled to follow some other tutorials where the mic used is not very good quality or there's no voiceover at all, so this is very helpful. Thank you OP!

    • @engame1702
      @engame1702 11 месяцев назад

      do you know what ai voice did he use? i've heard mostly in yt shorts?

    • @sergey_a
      @sergey_a 11 дней назад

      I do not even know which voice you are using, because I use neural networks to translate and voice over into my native language

  • @TentacleShark
    @TentacleShark 3 месяца назад

    is...this voice an AI?

  • @ven7306
    @ven7306 11 месяцев назад

    why you charge for source code?

    • @Ah2o5b
      @Ah2o5b 11 месяцев назад +5

      It is his code he can do whatever he wants with it. Support other devs youtube ads don't pay the bills

    • @kplays_6000
      @kplays_6000 11 месяцев назад +1

      if you don't wanna pay for it, follow the tutorial

    • @Luluskuy
      @Luluskuy 11 месяцев назад +1

      It's marketing trick and nothing wrong with it

  • @ven7306
    @ven7306 11 месяцев назад

    unsub because you sell out, why no free code? greedy.

    • @casul-4891
      @casul-4891 11 месяцев назад +4

      ​@@iFruit9iXven dude is hilarious 😂. He's the epitome of "beggar asking too much"

    • @Ah2o5b
      @Ah2o5b 11 месяцев назад +5

      It is his code he can do whatever he want with it don't be an 8 years old and grow up.

    • @lynic-0091
      @lynic-0091 11 месяцев назад

      Lol you're pathetic

    • @kplays_6000
      @kplays_6000 11 месяцев назад +2

      or take the time to follow the tutorial and learn from it, and you'll end up with the source code without having to pay. Get a grip

    • @Cretaal
      @Cretaal 11 месяцев назад +3

      Oh no, and here I was excited to see your asset flip on kickstart. Shame...