Making a Climbing Prototype in Unity in 48 Hours

Sdílet
Vložit
  • čas přidán 12. 09. 2024

Komentáře • 56

  • @jdhgeui2838
    @jdhgeui2838 Před rokem +11

    Hi Nick, I absolutely adore you AND your content. It's always nice to listen to how you explain stuff and your editing is consistently good! I hope the algorithm treats you well :) good day.

    • @NickMaltbie
      @NickMaltbie  Před rokem +1

      Thank you! Always happy to hear people like the videos. Seems like they got more views/watch time in the past 48 hours than the last year or so combined so something with the algorithm is happy today.

  • @Local_Nerd_
    @Local_Nerd_ Před rokem +7

    Why, doesn't this look familiar ;)
    Level designer for the original demo that inspired Nicks build here seen in the beginning! Super cool to see this be a thing and our work get out there more! The 3 of us that made that demo worked really hard on it, and were happy to share what we could of it when we could!
    I was impressed when one of my friends, showed me your browser demo of the character controller! He mentioned you'd put something up for it in the future, but, this was a pleasant surprise for my morning!

    • @NickMaltbie
      @NickMaltbie  Před rokem +2

      You guys demo was awesome! When making this version of it, I found so many edge cases with the camera to look into in the future though. If you ever make the full project I’m sure adding a free web demo for people to try it out would be a great addition!

    • @Local_Nerd_
      @Local_Nerd_ Před 5 měsíci

      @@NickMaltbie Absolutely. Sadly, we all have been too busy to return to this concept, as, the 3 of us all are busy with life and other projects, but, its something I want to make still, and will never forget making this project! I checked back to this recently and now it is up to 34K views! Congrats!

  • @SillyOrb
    @SillyOrb Před rokem +8

    Hi Nick, great video. Found you today and subscribed after watching a few of your videos.
    I have a minor correction concerning your statements about quaternions being matrices in a few videos (including this one). That's unfortunately not the case. Quaternions are decidedly not matrices. It's more akin to a axis-angle situation, but not quite so (see PPS below). The three axes on the other hand are basis vectors of a matrix. So, these are the equivalent of a (rotation) matrix, not the quaternion. I hope this makes sense and it wasn't too rudely worded (apologies otherwise).
    Having also written a few character controllers (for commercial games), I know you're doing very important practical and (I have to stress this ->) educational work here and I applaud you for going way beyond the basics by asking and (most importantly) answering the hard questions that other channels simply ignore.
    Another hard question is how to deal with a low physics (fixed) update rate, while rendering and executing game logic at much higher rates. Unity sure puts a few obstacles in your way and their solutions often simply fail, because as soon as the rendering rate is higher than the physics rate, anything physical will judder, while other elements are smooth (e.g. animation). Unity's physics interpolation is of little use in many cases. I'd love to test OpenKCC in regards to that, once I have a bit more time on my hands.
    FYI: For these sorts of tests I usually set the fixed update interval to something conventionally ridiculous like 0.1 seconds /10 Hz (see PS below), which is okay, as long as it is constant. Then I make sure rendering is at least at 60, but errors are easier to spot at 120 or 144 Hz, if your display is capable of it. Then slow down time to 1/8 or 1/16 of real-time. The test passes, if everything looks smooth, without judder or jittering (or what looks like teleporting, in the worst case). I usually implement some sort of debugging function in a game, so this can be tested at any time. Along with visualisations (like yours, which are excellent), such debug functionality is highly recommended to any game developer.
    PS: The reason for the high fixed update interval / low rate is, because these issues get overlooked at Unity's default settings of 0.02 seconds / 50 Hz, if you render at 60 Hz. Some people will know / feel something is off, some others might still say the game feel isn't good, while others still will like it. I mean, what else would explain how Unity let the camera move during fixed update in their 3D game kit samples? Yikes!
    PPS: Back to (rotation) quaternions. They can be thought of as encoding a directional orientation along an arbitrary axis. Directional meaning, that there is a difference between +180 and -180 degrees. Both point in the same direction, but one is clockwise, the other is anti-clockwise. This covers the whole 360° in both directions, hence they are said to be 720° or to possess "quaternion double coverage." This is usually the reason for unexpected sudden and violent full rotations in animations for no obvious reason (at least from just looking at Euler angles or direction vectors). Or, you know, characters' heads turning in very neck-breaking ways.

    • @NickMaltbie
      @NickMaltbie  Před rokem +3

      Hi, thanks for the comment. Yes, I do simplify the videos quite a bit and call things matrix operations even if they aren’t matrices. I believe the quaternion can be represented in memory as a matrix when multiplying with vectors and doing math operations but it itself is not a matrix.
      Yeah, quaternions aren’t matrices but explaining how they represent a projection of a matrix can be a bit complex and it’s easier to equate it with a rotation matrix which most people may be familiar with!
      As for the update rate with OpenKCC, the code is generic enough to run in either the update loop or fixed update loop. For my default example k use fixed update loop. However, in unity, the physics world only updates at a rate of 60Hz so any faster and physics interactions wouldn’t change for interacting with non static objects faster than that. I believe the Rigidbody has a function called MovePosition docs.unity3d.com/ScriptReference/Rigidbody.MovePosition.html for interpolating properly. And since the physics update is locked to 60Hz, you could always move the character faster than that and just let the interactions with non static rigid bodies by slightly incorrect.

    • @SillyOrb
      @SillyOrb Před rokem

      ​@@NickMaltbie Hi, thanks for the reply.
      Disclaimer: I often watch or read about topics I know reasonably well, just to see if there is more to learn, new techniques or simply different perspectives and ways of thinking (or because its just that interesting of a topic). It took me many years to truly build an intuition for quaternions (I wouldn't call myself an expert, though) and I have had good success with opening the "black box" of matrices for trainees and junior programmers (even a select few seniors) in the past. Please don't read the last part as a call to authority, it is merely meant to illustrate my personal background. Any obvious statements are meant purely for others that chose to read along and might be missing some details required to follow the argumentation (this means I don't intend it to be condescending towards you).
      Your videos have a potential to be very good reference introductions that give people with a basic or intermediate understanding a deeper look into topics and which they can watch at their own speed. I also like the language you chose to use in specific places. Assuming the aforementioned levels of understanding, I agree that explaining quaternions or matrices would be too much. I wouldn't have expected it in context anyway, so all is well thus far. Where we seem to disagree is that equating quaternions to matrices is helping people at these levels to make sense of either of them. As you can probably tell, my use of "equal" is very strict, whilst yours seems to be a bit more informal. This might be a contributing factor, but it didn't effect my original comment.
      Let us get to the issue at hand then:
      Lots of things can be expressed as matrices, however that does not make them equal to one. I think this is an important and valuable distinction to make. Asked from the perspective of that target audience: "If they were equal, then how are there two equal but different things that do the same?" It's confusing and both quaternions and matrices are already quite confusing on their own when introduced to most people. Equating them is just adding to that, in my opinion. Contrast that with your explanation using directional vectors, which is much better. I guess what I mean is: Your video would have been just as good and possibly a bit more on-point without mentioning quaternions at all, specifically because they were unnecessary. (As they should be, in cases like these. That is, besides constructing one and assigning it to the transform component's rotation property, but that is more of an API issue with Unity than a conceptual or mathematical requirement.)
      To be super honest (which might be rude, again sorry for that), it's a bit hard to tell what you mean by "the quaternion can be represented in memory as a matrix (...)": Quaternions are four scalars in memory, representing one real and three imaginary components. Matrices (in this specific context: 3D transformation matrices) are 16 scalars in memory, which can be decomposed into four four-component basis vectors in turn representing three scaled directions / basis vectors and one position. Is it understandable how the quoted statement can be confusing?
      Same with "the quaternion can be represented (...) as a matrix when multiplying with vectors and doing math operations": There is no matrix required to transform a vector by a quaternion (see: GLM, Unity's mathematics package, Unity's built-in maths or any other reference implementation). After all, the whole point of quaternions is that they don't behave like matrices in many ways. Their purposes and use cases are quite different in fact.
      Sorry, should my nitpicking bother you. Hopefully you see that I care about this stuff or I wouldn't be commenting. This is in no way intended to diminish the value of your good and important work. On the contrary, it's because of its value, that I care to comment on it. At the end of the day it's just some feedback by a stranger on the web, so feel free to do as you please (in the most positive possible reading).

    • @SillyOrb
      @SillyOrb Před rokem +1

      ​@@NickMaltbie Yes, MovePosition exists, but it is mostly just to ensure continuous collision detection, which you won't get by manipulating the position directly on a simulated body, as far as I understand. If the rigid body isn't set to interpolate (or to extrapolate), MovePosition won't help on its own. It wouldn't solve all issues anyway, as physics queries lag behind and will only evaluate the uninterpolated state. Specifically this is an issue with (fast) moving platforms and it will cause jittering with interpolation. The physics debugger wasn't of use for some of these issues in the past, as it would simply display no or wrong data, but I hear that it has improved in some scenarios. (Didn't have the opportunity to test this out myself yet.)
      It's been a while since I've tested these issues in Unity, but I would be surprised, if anything substantial has changed since (I can still see some of the symptoms in the version with which I am working). So, unless I am missing something very important (which I assume I always am), there is always a compromise of issues you trade in for solutions with Unity's physics in regards to KCCs.
      You should give the test I outlined in my original comment a try. Any of Unity's 3D Game Kit Samples can be quickly configured to illustrate the issues.
      All of this is why I believe that OpenKCC can be a great publicly accessible platform for finding solutions to these common issues and to build an understanding of the compromises that have to be made. Especially since Unity themselves don't release anything but the very basics and while other more advanced solutions exist, they are paid-for, often closed-source and might still exhibit these issues. (Most available KCC do and that results in people complaining about the same issues with games made by different people using Unity). I am excited to give OpenKCC a try some time.
      Unity's physics is not locked to 60 Hz, btw. As stated before, 50 Hz is the default, but you can set it to virtually any frequency. You can verify this in Unity's profiler window. It is recommended to set the frequency slightly lower than your target display / game logic frequency (e.g. 25/50 and 30/60 Hz respectively), so you don't have more than one physics step per update should a frame take a bit longer than expected. And of course, for a few years now you can also issue physics steps manually or control them entirely yourself.
      Cheers.

    • @NickMaltbie
      @NickMaltbie  Před rokem +1

      @@SillyOrb wow, I guess there is more to that than I had considered. I’ll definitely write down this as a future topic to investigate or share. Thanks for the info!

  • @vinterbjork4128
    @vinterbjork4128 Před rokem +1

    Very educational and that gameplay looks solid and super fun!

  • @seekeroftheball
    @seekeroftheball Před rokem

    Not what I expected from wall climbing. This is way better. It looks really fun and the transitions are so smooth.

  • @JadenAllen
    @JadenAllen Před rokem +1

    everything about this video was amazing! keep up the good work

    • @NickMaltbie
      @NickMaltbie  Před rokem +1

      Thanks so much! Happy you enjoyed the video and will definitely make more on this topic and the character controller in general.

  • @quelfth4413
    @quelfth4413 Před rokem +3

    A quaternion is not a matrix. It can be represented as a matrix, but it is not represented that way in unity, and it is not itself a matrix.

  • @crosline
    @crosline Před 11 měsíci

    I've written the same sort of walking on the walls movement for my 4d game and now seeing it here made me smile a bunch, even enlightened me for some of the little bugs, thanks! (It was a course project for my college) (And it looks awesome with some ik and tweened rotation)

    • @NickMaltbie
      @NickMaltbie  Před 11 měsíci +1

      That's awesome! I always find this 3D math and movement fun because you can add or remove a dimension (like switching from 2D to 3D) and the same algorithms still apply correctly. It's really helpful for visualizing and debugging. Happy it could apply well to a 4D environment as well.

    • @crosline
      @crosline Před 11 měsíci +1

      @@NickMaltbie Only took my brain to be melt down

  • @ToastaToast
    @ToastaToast Před rokem +1

    I was thinking of using the KCC on the Asset store you showed in the video for my project, but I'm very interested in hearing about the limitations you mentioned and how OpenKCC differs!

    • @NickMaltbie
      @NickMaltbie  Před rokem +1

      Yeah, the store asset is very high quality and can be extended to most uses. However, if you want to do some specific interactions and control bounces the OpenKCC model can be more customizable. I hope to add mine to the asset store at some point but will probably take a bit of cleanup to ensure it follows all the store policies :)

  • @lewisnorth1188
    @lewisnorth1188 Před 8 měsíci

    Was not expecting diggy doggy hole at the start but I'm very happy about it

  • @jkid1134
    @jkid1134 Před rokem +5

    I just came here to mention Mail Mole

    • @NickMaltbie
      @NickMaltbie  Před rokem +2

      Wow, that's an adorable game with movement almost exactly like this mole movement! I didn't know about that game before, will have to give it more of a look. Thanks for telling me about the game.

    • @jkid1134
      @jkid1134 Před rokem +2

      @@NickMaltbie it is a lovely little platformer. it handles like a dream from start to finish, very smooth. it has that "if you want it to be harder, hurry up" energy like Mario 64, which you know you can only get away with if controls and physics are sublime (I was turned onto it by a Jak and Daxter speedrunner, which should say something), but despite that, I was able to play with one hand (with some practice) if the cat needed to be pet. AND it's very cute. it is a privilege to get to share it with someone who I know knows a thing or two about game dev, because it's really a treat.

    • @pixelsoupgames
      @pixelsoupgames Před rokem

      That looks like a really fun movement mechanic

  • @fleakuda
    @fleakuda Před 6 měsíci +1

    Am I the only one that saw him draw the 3 axis as green: y-up, blue: x-right, and red: z-back and have their brain break for a minute because I am so used to seeing it from the rotated 90 degrees view of that???

    • @NickMaltbie
      @NickMaltbie  Před 4 měsíci

      Colors confusing :) all the visuals are rendered in Unity so I might make a set of demos so anyone can view the samples and see how they work in the Unity editor.

  • @alexevaldez
    @alexevaldez Před rokem +3

    After i subbedd to your channel. I binged all of your videos.

    • @NickMaltbie
      @NickMaltbie  Před rokem

      Thanks! My friends are trying to make a full game off this concept and I found the movement so fun I had to make my own character controller like it.
      My demo is open source so you can check out the code or online demo if you interested in checking out how it works.

  • @DD-rn4gi
    @DD-rn4gi Před rokem

    That intro song is so nostalgic

  • @CodeConnor
    @CodeConnor Před rokem +1

    This channel is pretty underrated

    • @NickMaltbie
      @NickMaltbie  Před rokem +1

      Thanks :) I’m just trying to share fun projects, no big aspirations but always like to read comments on the videos!

  • @VincentNeemie
    @VincentNeemie Před rokem +1

    Gotta love normals and up vectors, imagine what a mess it would be to not use them?

    • @NickMaltbie
      @NickMaltbie  Před rokem +1

      Maths would be a lot more complex without this linear algebra stuffs :D

    • @VincentNeemie
      @VincentNeemie Před rokem

      @@NickMaltbie Haha ,touché. + 1 sub

  • @R0N-VEEAR
    @R0N-VEEAR Před rokem +1

    subbed. great vid

  • @woulfhound
    @woulfhound Před rokem

    I really wish I could see a technical demo of how Assassin's Creed does it's animations and parkour mechanics.

  • @yong-jinlee756
    @yong-jinlee756 Před rokem

    Diver Down Simulator

  • @Areoithmic
    @Areoithmic Před rokem

    This is makes me wanna go and look for M O L E

  • @REAVER_Game
    @REAVER_Game Před rokem +1

    dope

  • @scno0B1
    @scno0B1 Před rokem

    great video. but like you mentioned its got some big issues on any normal thats facing in a downwards direction.

  • @smarty265
    @smarty265 Před rokem

    wicked

  • @fluffydragon5056
    @fluffydragon5056 Před rokem

    Kinda like the Splatoon squids but on the ceiling aswell

    • @CJBoxyeet
      @CJBoxyeet Před rokem

      Made me think about splatoon right away

  • @acelinkio
    @acelinkio Před rokem +1

    Is there any interest in doing a similar project to OpenKCC in godot?

    • @NickMaltbie
      @NickMaltbie  Před rokem +1

      I would love to work on something like that. The OpenKCC is open source in C#, I haven't worked with Godot before but it would be an interesting project to translate this to work in Godot as well.

  • @DancingDonkey1
    @DancingDonkey1 Před rokem +1

    Can i use this movement mechanics in my own game

    • @NickMaltbie
      @NickMaltbie  Před rokem

      Of course, the project is open source. You can download the whole GitHub repo and try it out for yourself github.com/nicholas-maltbie/OpenKCC
      There should also be a demo for the mole movement in the description linked as well if you want to check it out. If you have any questions about the source code feel free to open an issue on the GitHub repo, happy to help explain and add more documentation.

    • @DancingDonkey1
      @DancingDonkey1 Před rokem

      @@NickMaltbie Thnx a lot

  • @Liim-ab
    @Liim-ab Před 3 měsíci

    this video motivate me to give up on gamedev 😵

  • @bone-spoof6666
    @bone-spoof6666 Před rokem

    You got the wrong song the right one is called dwarf hole

  • @schnitzelhannes6431
    @schnitzelhannes6431 Před rokem +1

    That was really cool but you should switch to Godot and ditch that nasty Unity

    • @NickMaltbie
      @NickMaltbie  Před rokem +1

      I did some research and think a Godot package would be fairly easy to make and has all the supported features for OpenKCC :) might make a port in the future.