How to make better games using Curves in Godot | Game Dev Tutorial 6

Поделиться
HTML-код
  • Опубликовано: 6 фев 2025

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

  • @danniemi9990
    @danniemi9990 2 года назад +36

    This was very helpful!
    Also, for folks missing the interpolate function, in Godot 4, the "interpolate" method has been renamed "sample"

    • @ayrengreber5738
      @ayrengreber5738 Год назад +1

      For me I need to reload my scene to see changes in Godot 4… is that a bug or am I doing something dumb?

    • @bruceparker6142
      @bruceparker6142 Год назад +1

      For a project I'm doing using from another tutorial I coded
      var power_factor = power_curve.sample_baked(rpm_factor)
      I get the error message Parser Error: Cannot call non-static funcion "sample_baked" on the Class Curve directly. Make an instance instead.
      I have no clue what that means. I don't know why it does not work.
      I believe the code is to return the power_factor for a given rpm on the curve.
      the tutorial is 3 years old and used var power_factor = power_curve.interpolate_baked(rpm_factor)
      with no problems.

    • @uselessheartinbox1711
      @uselessheartinbox1711 Год назад +2

      @@bruceparker6142 Friend, I figured it out, When you write "@export var BobCurve = Curve", apparently its incorrect!, instead write "@export var BobCurve: Curve", As of now I do not know the difference with = and :, but I will research, Hope this helps!

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

      *:* comes before the type, *=* comes before the value. for example, it's always ``var value: float = 1.0``, not ``var value = float: 1.0``

  • @xKeelar
    @xKeelar 5 лет назад +13

    I had no idea you could even make curve resources. This will be very useful. Thanks for the great video!

  • @FrancoisSchnell
    @FrancoisSchnell 5 лет назад +26

    Very interesting, I didn't know godot had this feature and also with the code, thanks! :)

    • @DavetheDev
      @DavetheDev  5 лет назад +2

      Happy to share. Thanks a lot for the feedback.

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

    thank you very much 🙏
    i remembered watching this video a long time ago when i was learning Godot,
    and now i am much closer to making an actual game.
    i just got the first practical use for Curves:
    today i made a simple synthesizer as the first step of an early-development game having a built-in DAW
    that can respond to messages from other scripts so the music can instantly change based on what happens in the game.
    the first few prototypes of the synthesizer were more traditional, with some or all of the waveforms SINE, TRIANGLE, SAW, SQUARE being hardcoded into the synth.
    after that, today i remembered that i could use Curves to make any waveform visually
    so i watched this video again as a reminder of how Curves go.
    after i added support for curves, i deleted all code for hardcoded waveforms and got really excited to interpolate some of the Curve waveforms with another single-purpose node type before sending it to the synth node 😆💗
    the only thing i needed to change for Godot 4.3 was Curve.interpolate() into Curve.sample()
    - 2024-12-05, 5 years after this video got published

  • @Baekstrom
    @Baekstrom 4 года назад +8

    Nice feature. It can be used for so many things, like perfecting the feel of a jump in a platform game, dampening variables, tweening menu animations and making probability distributions, just to mention a few examples.

  • @colly9888
    @colly9888 Год назад +1

    I still come back to your tutorials now and then just to refresh my memory. Thanks again for your content, Dave!

  • @ChrisD__
    @ChrisD__ 4 года назад +4

    This is a game changer for me, thank you. Getting movement to feel right has been a huge struggle for me.

  • @ViaConDias
    @ViaConDias 2 года назад +2

    Thank you so much. I have done a lot of math that I could just have used the curve for instead! And then I even get a GUI to adjust it.

  • @synthoelectro
    @synthoelectro 3 года назад +1

    Thanks for the insight into a great feature, it will certainly allow me to do awesome stuff in the future.

  • @zenitaly
    @zenitaly 5 лет назад +4

    Thank you! Finally an interesting idea that I haven't thought about and I can actually use. Keep doing "different" tutorials, it's a great thing.

  • @HeroG9000
    @HeroG9000 4 года назад +2

    As someone coming from audio editing this really helps with visualizing stuff!

  • @rungeon83
    @rungeon83 4 года назад +3

    Very handy, it's like Tweens but with the ability to create your own custom transitiontypes and easyin functions. Thank you.

  • @BingtheLizard
    @BingtheLizard 4 года назад +1

    Haven't seen your channel before, but just the fact that your intro looks like a Ti83+ game made me sub immediately.

    • @DavetheDev
      @DavetheDev  4 года назад +2

      Back in high school, I used to make games on it during class.

    • @BingtheLizard
      @BingtheLizard 4 года назад +1

      @@DavetheDev That's exactly how I learned to code; I started with a number guessing game ("higher", "lower", etc). I was always impressed with how much more performant the Assembly games were which we downloaded (Tetris, Mario, Snake, etc). I have that calculator to thank for giving me the foundation to start learning to code simulations and games as I finished up engineering at uni.

  • @Rattja
    @Rattja 3 года назад +3

    Here I am drawing out curves on paper, then trying to concoct some sort of calculation together with a bunch of if statements to get the behavior I want, like some stitched together frankenstein monster that only sometimes works.
    And then you tell me that I could just have done this instead?
    Well then.. That sure makes things a lot easier.

  • @1u8taheb6
    @1u8taheb6 3 года назад +1

    Dave, your video is currently the only help available online when it comes to using curves in Godot. I'm still struggling and would really appreciate a more basic example to help me understand the minimum required code, and how to integrate this with my own code for different use-cases. Please consider making another helpful video on this subject. Thanks!

  • @Dragon20C
    @Dragon20C 4 года назад +1

    EXACTLY what I needed!

    • @Dragon20C
      @Dragon20C 4 года назад

      Though I need a little help, I want to use curves as recoil for my guns I am making but too add recoil I need to add the curve to a rotation_degrees.x but it seems I cant just add it, how would I go about this?

  • @RyanScottForReal
    @RyanScottForReal 4 года назад +2

    That's that was really useful!

  • @jeffg4686
    @jeffg4686 5 лет назад +2

    haha, love the family guy ref

  • @davidmurphy563
    @davidmurphy563 4 года назад +2

    Oh thank god for you. My maths really isn't that great and I was doing a min on a normalised vector 2 with a sine wave and all sorts just to get something approximate.
    Thank you so much.

  • @Mechasolaris
    @Mechasolaris Год назад +1

    godsend

  • @NateHeroic
    @NateHeroic 2 года назад

    This is great!

  • @fahimabidarnob1697
    @fahimabidarnob1697 4 года назад +1

    thanks for making me not hate jump mechanism :,)

  • @AgnisNeZvers
    @AgnisNeZvers 3 года назад +4

    Just a heads up. Don't use "self" to access the script's own variables and methods. "self" creates a reference to the script owner meaning you are creating unnecessary processing overhead.

  • @halilyasar3009
    @halilyasar3009 4 года назад +1

    THANK YOU

  • @xxgimpl0rdxx22
    @xxgimpl0rdxx22 5 лет назад +2

    Nice mic for your size

  • @patologicznypiotrus5638
    @patologicznypiotrus5638 3 года назад +1

    based mate user

  • @blenderer3191
    @blenderer3191 3 года назад

    i recommend desmos as website. My favorite website to visualize functions

  • @stephenmackenzie9016
    @stephenmackenzie9016 3 года назад +1

    I would like to use this to model the perfect jump,but not sure how you would then make it variable jump height

  • @nov_flp
    @nov_flp 4 года назад +1

    Don't forget about tween node...

  • @Crisisdarkness
    @Crisisdarkness 5 лет назад +2

    Wow, your channel is great, thanks for helping, I have subscribed, I would like you to teach, how to animate a 3d objects in blender. And in future videos, make more advanced animations, such as face animations, animations of quadruped beings.

    • @DavetheDev
      @DavetheDev  5 лет назад +7

      Thanks a lot! I hope there will be lots of animation stuff on the way in the future, but I do animations in a super interesting way that allows one person to make the most of the limited time available called procedural animations. In a nutshell, I try to push off as much of the animation work to the computer as possible. Done right, animating procedurally has the potential to save system resources, produce interesting emergent behavior, sometime look and feel more fluid, and most importantly, saves me from the super time consuming task of traditional key frame animation. Here are two videos I reference a lot when doing procedural animation...
      ruclips.net/video/LNidsMesxSE/видео.html
      ruclips.net/video/l9NX06mvp2E/видео.html

    • @DavetheDev
      @DavetheDev  5 лет назад +4

      Also, this... ruclips.net/video/sVntwsrjNe4/видео.html ^_^

    • @Crisisdarkness
      @Crisisdarkness 5 лет назад +1

      @@DavetheDev Wow, what you just told me is super interesting, it's something new for me, I would be very excited if you made a video on this topic (or better yet, if you could create a course), I like to save time, taking advantage of the programming, thank you friend, I will review those videos, thanks for commenting, I'm going to keep that in mind

  • @pyrosoup4413
    @pyrosoup4413 Год назад +1

    please update tutorial

    • @colly9888
      @colly9888 Год назад +2

      Try using the sample() function instead of the interpolate() function! It got updated in Godot 4

  • @JacobKinsley
    @JacobKinsley 2 года назад +1

    I understood this up until the example with the rocket then I completely lost you. I have no idea what landedness means or how that rocket is supposed to behave.

    • @DavetheDev
      @DavetheDev  2 года назад +1

      Noted! Appreciate the feedback. Programmers really like using numbers to emulate things from the "real world". We especially like using numbers between 0.0 and 1.0 to represent percentages. In this case, "landedness" is the percentage of a landing procedure a rocket has completed.

  • @testteset9625
    @testteset9625 3 года назад +1

    You really dont have to put self before everything

    • @semi9
      @semi9 2 года назад +2

      me when I meet a narcissist

  • @Bunchiebo
    @Bunchiebo 9 месяцев назад +2

    Is it just me or does math put in code make way more sense than whatever nonsense they do in algebra