HD-2D Style in Godot 4.1

Поділитися
Вставка
  • Опубліковано 3 жов 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

КОМЕНТАРІ • 127

  • @kplays_6000
    @kplays_6000 Рік тому +64

    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!

  • @Casseous
    @Casseous 11 місяців тому +77

    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 місяців тому +8

      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 7 місяців тому +12

      What tutorial should we use ;-;

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

      ​@@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 7 місяців тому

      ​@@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 2 місяці тому +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!

  • @bluzenkk
    @bluzenkk Рік тому +28

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

    • @gamedevaki
      @gamedevaki  Рік тому +6

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

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

      nah that always looks ugly

    • @longtranha8695
      @longtranha8695 Рік тому +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

  • @angryybot6367
    @angryybot6367 Рік тому +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  Рік тому +3

      that's cool, thanks for the tip!

    • @triskaideka13
      @triskaideka13 8 місяців тому +2

      you angryybot are a scholar and a gentlebot

  • @Gatitasecsii
    @Gatitasecsii 9 місяців тому +3

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

  • @ShadowOverflow
    @ShadowOverflow 10 місяців тому +4

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

  • @lagmaronchim1435
    @lagmaronchim1435 Рік тому +4

    great 2.5d tutorial, thanks!

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

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

  • @SaharatOfficial
    @SaharatOfficial 4 місяці тому +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 Місяць тому

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

  • @user-tp1fy3sp5c
    @user-tp1fy3sp5c Рік тому +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  Рік тому

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

  • @revidev
    @revidev Рік тому +4

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

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

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

  • @KevinNijmeijer
    @KevinNijmeijer 4 місяці тому +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.

  • @TEDDeng
    @TEDDeng 6 місяців тому

    Really learned a lot from this video, much appreciate.

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

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

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

    Fantastic video! Thank you so much.

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

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

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

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

  • @Ah2o5b
    @Ah2o5b Рік тому +2

    Great tutorial as always

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

      Thanks for the constant support!

  • @ebooooooy4249
    @ebooooooy4249 Рік тому +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  Рік тому

      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 Рік тому

      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  Рік тому

      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

  • @HE360
    @HE360 Рік тому +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  Рік тому

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

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

    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

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

    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!

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

    Fantastic video!

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

    thanks a lot, great video

  • @Chareidos
    @Chareidos 10 місяців тому +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

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

    Thanks learned a lot

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

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

  • @glitched_code
    @glitched_code Рік тому +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  Рік тому +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.

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

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

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

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

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

    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  2 місяці тому

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

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

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

  • @misguidedcouch
    @misguidedcouch Місяць тому

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

  • @TA-MUSIIQUE
    @TA-MUSIIQUE 7 місяців тому +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 7 місяців тому

      I need this tutorial in Unreal Engine :/

    • @gamedevaki
      @gamedevaki  7 місяців тому +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

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

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

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

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

  • @richardlitter6956
    @richardlitter6956 10 місяців тому +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

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

    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.

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

    Te amoooo!!!!

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

    how is your project going?

  • @Lexipumpkin783
    @Lexipumpkin783 Місяць тому

    could you try doing this in cyclops editor for godot?

  • @UZPvNUCaaQdF
    @UZPvNUCaaQdF Рік тому +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  Рік тому +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.

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

    I can't find the sprite sheet for download

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

      You can use any free on don't worry

  • @Снеговикхочетвассожрать

    3:57 what value does "facing" represent?

  • @casul-4891
    @casul-4891 Рік тому +1

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

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

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

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

    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  7 місяців тому

      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.

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

    How do you get the trees to sway?

    • @gamedevaki
      @gamedevaki  7 місяців тому +1

      I've made a video to go through the tree sway here - ua-cam.com/video/g17C_EXna3M/v-deo.html

    • @luisquintero9998
      @luisquintero9998 10 днів тому

      ​@@gamedevakiit's a private video

  • @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  7 місяців тому

      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 9 місяців тому

    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  7 місяців тому

      Yeah, you need a separate animation for attacks.

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

    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  7 місяців тому +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

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

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

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

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

      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

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

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

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

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

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

      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.

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

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

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

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

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

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

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

      I'm still new at godot

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

      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

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

      @@gamedevaki ok!!! Thank you!

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

    🙏

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

    Are you alive?

  • @AppMaker728
    @AppMaker728 Місяць тому

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

  • @notSoAnonyymus
    @notSoAnonyymus Рік тому +3

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

    • @gamedevaki
      @gamedevaki  Рік тому +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 Рік тому +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 Рік тому

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

    • @sergey_a
      @sergey_a Місяць тому

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

  • @lynic-0091
    @lynic-0091 Рік тому

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

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

      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?

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

    is...this voice an AI?

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

    why you charge for source code?

    • @Ah2o5b
      @Ah2o5b Рік тому +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 Рік тому +1

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

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

      It's marketing trick and nothing wrong with it

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

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

    • @casul-4891
      @casul-4891 Рік тому +5

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

    • @Ah2o5b
      @Ah2o5b Рік тому +6

      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 Рік тому

      Lol you're pathetic

    • @kplays_6000
      @kplays_6000 Рік тому +3

      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 Рік тому +4

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