CORRECTIONS: - gravity on earth’s surface, g, is 9.8 m/s^2 and not -9.8m/s^2. The negative comes from saying that it is “pulling you down” and not “pushing you up” - a normal force is not just the force that counters gravity. In a Goldilocks scenario where the object is on a flat surface, it is, but normals are perpendicular to the surface, not just straight up in the air. If you find more leave a comment and I’ll add it here!
@HoSza1 Жыл бұрын
It depends on your choice of coodinate system axes. Choose your x coordinate to increase downwards and the equation for a falling object is going to become s=s0+v0t+½gt² with a positive g (a=g). Choose the opposite direction and you will need a negative value.
@1234macro Жыл бұрын
@@HoSza1 X coordinate?
@WillHessGameDev Жыл бұрын
@@HoSza1I just like to think about it like this, things get thrown in parabolas that open downwards. In order for a parabola to open downwards the term that has t^2 has to be negative so I just throw a negative in there. I usually don’t get too fussed about those negatives because using common sense works fine (until it doesn’t lol). Also don’t for get the (1/2) with your at^2 term, or else the integral gods will be sad.
@terjelindtveit8072 Жыл бұрын
You definitely want to do v squared for fluid forces. But honestly if you have an idea of the motion you want to replicate you are probably best off to keep the full equation and just place in imaginary values for certain prams. The cross section area is easily estimated, and so with that you are left with two parameters; density and drag coefficient. Put the density to the fluid you want it to behave like and put the drag coefficient such as to match whatever you want like terminal velocity or something. That way when you put other elements into your environment they all behave consistently.
@oisyn- Жыл бұрын
It's not the leaning tower of pizza. It's the leaning tower of Pisa. "Pee-sa" 😉
@mehmeh8883 Жыл бұрын
"thanks to Galileo and his balls.." lmao
@silvertakana3932 Жыл бұрын
That caught me so off guard 😂 💀
@badunius_code Жыл бұрын
And tower of pizza
@irvinmuziwenkosi10 ай бұрын
😆😆Got me rolling
@nikz0005 ай бұрын
Was coming to the comments to write that lmao
@Kam1kazePandasАй бұрын
A źz@@silvertakana3932
@maxfrobin8930 Жыл бұрын
My man just condensed an entire highschool physics semester into a 1h video... good work! I wish this was the pacing we had at school xD
@WillHessGameDev Жыл бұрын
Lol I guess so! Thanks for watching!
@Nightwulf1269 Жыл бұрын
What the actual F***...this is the most explanatory and comprehensive video explaining such complex topics I have ever seen. Extremely good job!
@WillHessGameDev Жыл бұрын
Thank you so much!
@kizlso11 ай бұрын
I gave up on physics in highschool since our teacher wasn't qualified to even teach. This video is honestly so helpful.
@WillHessGameDev11 ай бұрын
Glad it was helpful!
@sloppyy4 ай бұрын
lmao same, it was ostensibly "ap physics c" but we got a guy who only had chemistry training and ended up showing us grateful dead live videos instead. i got a 2 on the ap exam
@ItsStaffDaddy Жыл бұрын
I dropped physics 1 in college and went to a different science for my CS degree because I knew the topics conceptually, but my mathematical understanding of them were lacking (also was working full time and taking classes full time, so that didn’t help). This video alone taught me how to understand them on a deeper mathematical level much better than my professor ever did. Thanks boss
@WillHessGameDev Жыл бұрын
Thank you so much! I’m glad I could help!
@alansmithee41910 ай бұрын
Either Physics 1 was way more complicated than this, you weren't paying attention, or your professor *sucked* at teaching.
@nenadjovanovski1461 Жыл бұрын
Great video! Just wanted to mention a small funny moment. You said at 20:55 that static friction should always be greater or equal to dynamic friction, but a few seconds later when you show the unity settings, you entered dynamic 0.25 and static 0.2 friction. Apart from that, keep up the good work!
@WillHessGameDev Жыл бұрын
Yeah, I was probably just picking random numbers for that… thanks for catching that and watching!
@DrZwieback Жыл бұрын
Thanks for pouring so much energy into this video. Must have taken a while to produce. For me this is a super helpful refresher on physics in general and you did a great job relating it to game dev and Unity here. Thanks and subscribed! :)
@WillHessGameDev Жыл бұрын
Thank you so much for watching and subscribing!!!
@nikjeewon4672 Жыл бұрын
Started looking into math and physics yesterday to buff my gamedev - will be checking this out, thanks for your effort boss!
@WillHessGameDev Жыл бұрын
No problem!
@dannydoo3834 Жыл бұрын
Can't thank you enough for this, you gained my sub brother. I was collecting resources online so I can understand how to implement things. I stumbled upon your video (haven't finished it yet, but the sections you've covered with demos are tremendously useful.) and now everything seems a lot more in place.
@WillHessGameDev Жыл бұрын
No problem, and thanks for subscribing!
@daka.notatp Жыл бұрын
19 minutes in and my brain is fried. i'll come back tomorrow
@WillHessGameDev Жыл бұрын
Physics is a tricky subject and can get confusing fast. Here is some (not very good) words of encouragement my physics teacher would say, “all physics is, is F=ma, and everything else comes from that”
@marmikemp3767 Жыл бұрын
Finally a truly informational video. Instant sub.
@WillHessGameDev Жыл бұрын
Thank you so much!
@LRTOTAL Жыл бұрын
Pro vectors tip: If you had problems calculating the angle of a vector from 0 to 360° (or 2π rad), it's probably because you used atan(y/x) instead of the 2-argument arctangent: atan2(y, x) which takes the two variables. Dividing y/x before passing it to the arctan function actually loses information about directionality, for example -1/1 = 1/(-1). But (1, -1) and (-1, 1) are not the same vector and don't represent the same angle.
@WillHessGameDev Жыл бұрын
Thank you for these tips!
@martinthexr11 ай бұрын
Hey man, I just saw your video and it was one of the best about physics for game dev, pretty sure that you have spent huge amount of efforts into it. The knowledge was comprehensive and actually being all the knowledge a university student will learn in the first 2 years, which later apply for the game dev. And just want to say you did a great job, really appreciate your work !
@WillHessGameDev11 ай бұрын
Glad you liked it!
@MLCHRL Жыл бұрын
Hi! I really liked your guide! I understood about 10% the first time. I'll watch it again to understand more. Thanks for making this for beginners.I'm working as a full-stack developer for years, but I dream to be a game dev once a while. Your guide is a great help for my projects. Do you also live-stream your work? I would love to see you doing game development live. Thanks again for your great work!
@WillHessGameDev Жыл бұрын
Hi! First of all, thanks for watching and leaving a comment. I really appreciate it. And about the live streaming, I have never done it but I have always had that idea in the back of my head once the channel takes off a little bit more. My thing is that if I did it now it would be a lot of work on my end for like probably 10 people to watch, so it doesn’t seem worth it to me to do it now. But I’m glad you would watch live!
@arxsh430110 ай бұрын
BROOOO, idk why but that was SEEXYYYYYYY No CAP but you explained some concepts in such a way where most professional teachers also fails, SEGGZYYYY
@WillHessGameDev10 ай бұрын
lol thanks
@parsahosseini42419 ай бұрын
Liked, subscribed, shared, and commented... If there were anything else that I could do, I would bro, this is considered a piece of art, the art of making concepts easy to understand, without cutting any part of it. Awesome work man, appreciate the time and energy you put into this video ❤
@WillHessGameDev9 ай бұрын
Much appreciated!
@CosmoSock1 Жыл бұрын
I’m going to be honest. When I heard your voice, i thought this was going to be another uniformed, amateur game dev video by some teenager. But I was completely wrong, you absolutely killed it! Great info, succinctly explained. Great job!
@WillHessGameDev Жыл бұрын
Thanks! I appreciate it!
@congnam38011 ай бұрын
Your video is really helpful, I was stuck with creating friction for my game for the last few days then found out your video then I skipped to the 'friction' part and your explanation help me in just 5 seconds to figure it out.
@WillHessGameDev11 ай бұрын
Glad it helped!
@barvykovsky Жыл бұрын
Really useful video. I don't know how accurate it is but I learned a lot :D Thanks for doing this and I hope you'll get more views :)
@WillHessGameDev Жыл бұрын
Thank you!
@ruzgar1372 Жыл бұрын
I can't express just how important this video is for an aspiring game developer who kinda slept through his physics classes ngl.
@WillHessGameDev Жыл бұрын
Glad it helped!
@gregorynelson15684 ай бұрын
At about 29:50, you are comparing an estimated terminal velocity between a 5kg mass and a 10kg mass while using the same b coefficient, coming up with Terminal velocities of 612.5 m/s and 1225 m/s respectively. However, given similarly shaped and density object of different masses will not share the same cross-sectional areas when moving through a fluid medium. If object 2 has twice the mass of the first object, then the cross-sectional area is about 58.74% more than object 1. (Or more simply, an object of 8× the mass will have 4× the cross-sectional area, all else being equal). So, in part, you are correct in that it didn't get close enough to the terminal velocities in Galeleo's testing, but also the change in cross-sectional area was not taken into account when using a constant b term.
@oldmankatan7383 Жыл бұрын
Rock solid and practical, thank you for putting this out there for everyone!
@WillHessGameDev Жыл бұрын
No problem! Thanks for watching
@MaxIzrin Жыл бұрын
A good tip when it comes to calculating things for working with kinematics is offsetting. Don't bother calculating things in their own reference frame, do all you calculations assuming more favorable conditions (start at the origin of the axis, and move along a single axis, and not along some combination of a couple of axes). Then add the appropriate offsets to the results, this back and forth conversion may not be the most efficient, but it will help your calculation a lot. For example, having something move on a circle goes something like this: *(x₁ + x)² + (y₁ + y)² = R²* Where x₁ and y₁ are constants, the position of the circle's center. But that's a hard calculation, so we offset to 0 instead. Assume x₁ and y₁ are 0, you get a simpler equation: *x² + y² = R²* Then whatever result you get, you add the offset to that, and you're golden.
@WillHessGameDev Жыл бұрын
yes that is a very good tip!
@alansmithee41910 ай бұрын
The equation of a circle centered on the origin is x^2+y^2=R^2 x^2*y^2=R^2 gives an odd star-shape. I'm sure it has a name but I can't be bothered to look it up right now. Edit: From this the general equation is (x - x1)^2 + (y - y1)^2 = R^2 Where the centre is at (x1,y1).
@MaxIzrin10 ай бұрын
@@alansmithee419 Yes, my bad. I'll edit it.
@kahwull014 Жыл бұрын
Thanks a lot!! Just watched your pixel art video and i need to say I'm loving your channel, bro!!
@WillHessGameDev Жыл бұрын
Glad you enjoy it!
@skylark.kraken Жыл бұрын
I don’t know if it’s mentioned in the video as I haven’t finished it, but my favourite way to do physics only requires saving a velocity vector and simply multiplying that by a float that is in the order of `pow(0.99, MSPT)` every frame after velocities have been updated, as it will cap the velocity to a certain amount with a given acceleration. It also makes everything smooth and it’s really easy to change friction by changing the 0.99 into 0.999 for ice or 0.95 for more friction. You can also change the friction based on direction of travel. For my game that I’m working on all accelerations work the same, it doesn’t matter if you’re on ice you know that if you start moving now and move 5 blocks right you’ll be at the same velocity as normal, having ice be slower acceleration is possible but I don't feel there's enough of a benefit. The difference is when it comes to deceleration, changes happen when you either release controls or when changing direction (changing direction has higher drag allowing for quicker changes) The movement feels amazing and fluid. Multiplying by a float less than 1 simulates air resistance without doing anything complicated and actually dealing with forces
@WillHessGameDev Жыл бұрын
That’s pretty big brain. To me it seems like a classic game dev solution of doing stuff that makes it feel like real life without being 100% accurate, and there is nothing wrong with that at all. This video was more designed as a physics primer and explain a bunch of physics concepts that would be useful to know when making games and how you can use them. So no, I did not cover any of that in the video, but good on you for finding a cheeky work around for all this silly real life math I’m doing lol!
@colonthree Жыл бұрын
This sounds like a Verlet integration?
@jermaineallgoodАй бұрын
This was invaluable to me as I am learning game development. I greatly appreciate this lecture/tutorial! World Class!!!!!
@joshparrott4389Ай бұрын
best, clearest explanation of this topic I have found yet
@nameno703210 ай бұрын
Such a gem, hope you cover more physic topic in the future
@Whaddif_ Жыл бұрын
it might help someone, so i’ll mention it. velocity is speed AND direction, whereas speed does not regard direction
@WillHessGameDev Жыл бұрын
Precisely speed is the scalar and velocity is the vector. Speed is also the magnitude of velocity. Thanks for putting this up because I think I just said they were similar in the video and didn’t elaborate oops 🤦♂️
@TheZenytram Жыл бұрын
you know what is funny, only in english :)
@shun62846 ай бұрын
I rarely find video tutorial about physics for game Dev, I'm looking forward to more physics stuff for game dev if there's more to it or probably separate videos for each topic with additional or much detailed tutorial regardless this one is still good.
@MooseBoys42 Жыл бұрын
The reason a bounciness of 1.0 causes the ball to bounce higher over time is because of how collision detection works. The ball is simulated with a fixed time step, and eventually it intersects the plane. When this occurs, the velocity is reversed, but its position is also "snapped" to be above the plane so it doesn't appear intersecting. This small change in position without an accompanying decrease in velocity is what adds energy to the system and causes it to bounce back higher.
@WillHessGameDev Жыл бұрын
Ahhh that makes a lot of sense, thanks for clearing that one up for me :)
@LordBeef Жыл бұрын
Great video! One minor mistake is saying that -9.8m/s^2 is g. g is 9.8 m/s^2, so -9.8m/s^2 is -g.
@WillHessGameDev Жыл бұрын
Thanks for the correction! I always mess up with that one lol.
@davidmurphy563 Жыл бұрын
This has to be the pettiest correction ever... When people say g = -9.8m/s/s, it's beyond obvious that it's in reference to the 2nd derivative of displacement relative to the normal of the surface of the Earth in the Newtonian paradigm; ie. falling. The negation is clearly using the reference frame of someone stood on the surface of the Earth for the scalar; a very human perspective. So unless the usage is a constants library for onboard interplanetary exploration navigation software then there's no reason not to glance at it, understand what's meant and roll with it.
@LordBeef Жыл бұрын
@@davidmurphy563 I know what's meant, but it is something my physics professor would mark us down on. For a video about correcting common mistakes in game physics, I figured it was worth mentioning that g is an unsigned value.. I did say it was minor, after all.
@dianlabuschagne2239 Жыл бұрын
Now this is S tier content! Tnx so much! May your channel blow up!
@WillHessGameDev Жыл бұрын
Thanks!
@mikeorioles4 ай бұрын
Great refresher-thanks!
@WillHessGameDev4 ай бұрын
Thanks for watching
@redhood71057 ай бұрын
That's my friend is a golden standard of the gamedev content
@SpringySpring04 Жыл бұрын
I learned more from this video than I did in 9 weeks of college Physics (currently, as of writing this comment, we started going over momentum and impulse forces, but neither me nor any of my classmates understood anything in the class before this point, lol)
@WillHessGameDev Жыл бұрын
Glad I could help!!!
@JenrikkuAlt Жыл бұрын
As a curiosity more than a correction, gravity decreases slightly the higher you are from earth's surface. Gravity is partially defined by the distance between the center of 2 objects but since earth's radius is very large we can discard any height (distance from earth's surface) and say that gravity is 9.8 mostly always when working with relatively small units.
@WillHessGameDev Жыл бұрын
Very true. g = GM/R^2 where G is the gravitational constant and R is the distance to earths center, and mass is the mass of earth. Plugging stuff in at sea level I believe is where the 9.8 comes from!
@JenrikkuAlt Жыл бұрын
@@WillHessGameDev It is indeed!
@alansmithee41910 ай бұрын
38:30 My guess as to why this happens would be that when unity detects the collision of the ball hitting the surface it bounces from, because the ball's position and velocity are updated discretely between frames, the ball's position and velocity can be updated to a point that places the ball inside the object and the collision is detected pushing the ball back up out of the object it would otherwise have entered, but the velocity is not recalculated. I.e. the ball now has as much velocity as it would have had had it continued falling a tiny distance extra into the surface of the object, but is positioned at the surface of said object. The bounce is then processed, flipping this higher velocity into the upward direction. This can happen on every bounce, gradually increasing the energy of the ball.
@pik9109 ай бұрын
Inaccuracies are caused by floating point error (so exact calculations are doomed to begin with) and time steps being discrete. Collision resolution behavior depends on the closing velocity of the colliding objects. I *think* at the bottom the system is more likely to lose energy because we are not using the real impact velocity but a velocity from 16 ms or so earlier. For the same reason we are always overshooting a little bit at the top, so if I am correct that is where energy is added to the system. We could relatively easy measure this for science - and it is possible that the system might get lossy instead if the variables are different - but it does not really matter since we should always be damping to make errors irrelevant. If we need a more stable system we could calculate the positions in absolutes instead of relatives (which does not really work for interactions) or see that we occasionally "correct" the values to a default or maybe have a constraint that keeps the energy consistent.
@jaysol1914 ай бұрын
This video is amazing and I’m genuinely learning so much
@WillHessGameDev4 ай бұрын
Thanks I appreciate it!
@XanCraft2118 күн бұрын
This is a pretty good tutorial, thank you. It’s well detailed. Can you make another version in the future that does everything from scratch (assuming we already have a simple and basic 3D renderer already in place, no game engines)?
@XanCraft2118 күн бұрын
Ignore the hyper link that youtube added in a recent update, worst feature ever made. Someone needs to sue the company.
@물개친구수달6 ай бұрын
18:12 Break(GetEquilibriumForceMagnitude(Mathf.Deg2Rad * transform.rotation.x)); transform.rotation.x is the x element of the quaternion, why are you multiplying it by Deg2Rad? What does this mean?
@WillHessGameDev6 ай бұрын
Deg2Rad is a constant (pi/180) and you multiply it by an angle in degrees to get the angle in radians. The function took in a radian value as an input so that’s why I did it.
@ЭдуардСухарев-ш9ч5 ай бұрын
Why at 2:40 are we taking 1/2 of the acceleration times time squared? Why is it only 0.5? Should it not be just 1 (e.g. no additional multiplication at all)
@WillHessGameDev5 ай бұрын
I thought the same thing when I started learning physics. It has to do with integration (calculus) which is the area between a graph and its axis. With a constant acceleration, the acceleration vs time graph (acceleration on y axis and time on x axis) will be a straight horizontal line because acceleration doesn’t change. Integrating acceleration gives you velocity so the area between the acceleration line and the x axis with the times as bounds is the area of a rectangle, length times width. Length is the final time, t (assuming you start at t = 0), and width is just the constant acceleration, so v = at. The graph of that is a linear function that passes through the origin with the slope equal to the constant acceleration. The integral of velocity is displacement (position) so we find the area between that line and the x axis, this is a triangle so the area is .5 * base * height. Our base is again t and our height is v which is at, so the area is .5 * at * t which means the position is .5at^2. It’s a bit confusing but I hope that made sense! If you have any other questions or need me to explain this better lmk!
@ЭдуардСухарев-ш9ч5 ай бұрын
@@WillHessGameDev oh, right! It took me time to wrap my head around your explanation but now it's clear, though pretty much counter-intuitive if you think about it without graphs
@Rptr797-wn4iu8 ай бұрын
After a long day of chores, school, and boredom I wanted to learn some more c# and I saw this video, I already had a head ache this just 100Xed it
@cosmic4716 Жыл бұрын
Decided to check this video out because im learning physics by myself and sometimes coding a primitive ball physics simulator. It was really helpful, thank you. Also you're cute. Subscribed.
@WillHessGameDev Жыл бұрын
No problem if you need any help just ask!
@gamerneshabdofficial11024 ай бұрын
i accualy want to develop games will this video be enough for the whole game physics sector? please reply.
@WillHessGameDev4 ай бұрын
I definitely depends on what you are looking to get out of game dev. If you are trying to make your own engine then probably not. This video is the basics of Newtonian mechanics and how to use it in unity. If you are unity specific, then this video is most likely going to be enough, but if you use another game engine you might need to do additional research on the topics discussed here. All the topics should be the same though as physics is physics no matter what game engine you’re using. If you’re making your own engine you should already know how to do this stuff or start learning because a one hour video isn’t sufficient for making an entire engine
@gamerneshabdofficial11023 ай бұрын
@@WillHessGameDev i shall use unity.
@ekopratomo95 Жыл бұрын
Drag should be proportional to velocity squared. The drag equation clearly states v^2.
@WillHessGameDev Жыл бұрын
I 100% agree with you on that and I have no idea why it isn’t. My physics textbook used that equation with -bv as an equation for any “resistive force”. They just said it was air resistance, which confused me because I knew there was this long formula for it. I was messing around with reading velocity data for different falling objects in unity and low and behold they use this dumbed down version of drag too! Idk why it can’t be dumbed down but keep the square…
@ekopratomo95 Жыл бұрын
@@WillHessGameDev Perhaps what they mean is rolling resistance or friction based resistance, they scale linearly with velocity.
@gordonmccrary6279 Жыл бұрын
This was very good. You are a fantastic teacher also. Thanks for the effort.
@WillHessGameDev Жыл бұрын
Glad it was helpful!
@ArchonLicht Жыл бұрын
Great physics refresher video. Not sure what all the videogame stuff is about :D
@gutzimmumdo4910 Жыл бұрын
very usefull information, underrated video
@WillHessGameDev Жыл бұрын
Glad you think so! Make sure you share it with others who you think will find it useful so it will become un-underrated!
@calmhorizons10 ай бұрын
Great video. Slight presentation tip - your Ts look like + symbols, which can get confusing. Might want to draw them with the tail t. I have the same problem with my r's and c's as I habitually curl my r a small bit at the bottom.
@WillHessGameDev10 ай бұрын
The worst for me are my 2s and Zs, they always end up looking identical lol. Thanks for the advice!
@dev-dev-dev15 ай бұрын
Amazing video! It really helped me understand physics better. Thank you! I have recommended it to my friends several times, but some of them struggle with it due to their limited knowledge of English (we are not native speakers). Could you please let me know if I can create an AI translation and share it publicly (of course, with proper credit to you and without monetization)?
@WillHessGameDev5 ай бұрын
Yeah totally, again as long as you credit me that’s totally fine
@WillHessGameDev5 ай бұрын
Also thank you for asking before you did it! If you wouldn’t mind sending the link so I can pop it in the video’s description too to help other people too, that’d be great!
@unformedvoid2223 Жыл бұрын
Conceptually position is not a vector. It's a point. It just so happened that both vectors and points can be represented by tuples of numbers. In fact, each vector consists of two points: a starting point and an ending point. We just omit the starting point assuming it's in origin (0,0).
@WillHessGameDev Жыл бұрын
I might be wrong about this one but I’m pretty sure “displacement” is the vector, distance is the magnitude and position describes the point in space. I think…
@unformedvoid2223 Жыл бұрын
@@WillHessGameDev yes, displacement is a difference between final and initial positions, so it's a vector.
@theashbot4097 Жыл бұрын
38:20 you said you do not know why the dark green ball bounces higher the more it bounces. I THINK the reason why is the gravity will make the force at which it is moving down more so then it will bounce higher.
@WillHessGameDev Жыл бұрын
Idk if I understand you theory completely, but it sounds like you are saying that the force being exerted on the ball is higher when it is closer to the ground. I know that’s how our brains like to think of it because the ball is moving faster so there should be more force, but remember that force is related to acceleration and not velocity, so the force gravity exerts on the ball doesn’t change! A bounciness of 1 should be a collision where no energy is lost, so if we do a bunch of math and cancel terms, we would get that, but computers don’t think like that. They just plug stuff into an equation and compute the answer which could lead to rounding errors if they used a velocity that wasn’t perfectly accurate. That’s my current theory, and something I would blame all of my slight inconsistencies whenever doing physics, rounding errors lol. I have no definitive proof that this actually is the reason though…
@theashbot4097 Жыл бұрын
@@WillHessGameDevI have thought more about this. I THINK that the reason for it bouncing higher is the force in applied for going down but only a fraction of that force is needed to hit the ground. then Unity makes it bounce at it's full power including the fraction that was not needed to make it hit the ground. which would explain why it only bounces a fraction more every time. but I could be wrong.
@Random_Variableee6 ай бұрын
why do you add add 0.3 to the 0.74 value in the friction constant calculation in 24:07
@WillHessGameDev6 ай бұрын
At 22:47 I shows that the box has a static friction of .3 in the physics material, and the red surface has a static friction of .74 set to average. That means the .74 and .3 get averaged together to get the coefficient of friction in the actual friction calculation. So (.74 + .3) / 2 = .52
@Random_Variableee6 ай бұрын
@@WillHessGameDev thanks
@Sweet-z8m7 ай бұрын
This video is deadass just my AP Physics 1 class lol. Awesome vid!!!!!!!
@0xF81 Жыл бұрын
42:15 "zero equals one" and that huh sound with "?" symbol 😂😂 funny haha, and overall great video, thanks a lot for making it! ❤
@WillHessGameDev Жыл бұрын
No problem! Thanks for watching!
@apolos7851 Жыл бұрын
At 16:12, I don't understand why that angle is 90 - theta and the adjacent angle is theta. And at 16:25, the normal force is equal to mg.cos(theta). Do you have any videos that can explain these concepts? (sorry for my english if u didn't understand.)
@WillHessGameDev Жыл бұрын
kzbin.info/www/bejne/q5fKimVpbLJogbM this guy is really good and he answers your question in the first 3 minutes of the video!
@theashbot4097 Жыл бұрын
I am been trying to make a simple version of unity physics (because I do not need all the realistic stuff). I did not realize that physics is that complicated.
@WillHessGameDev Жыл бұрын
It is just a LOT of math. If you don’t mind me asking, is the “simple version” in unity? Or is it like a separate physics engine? I say that because if you are trying to make a simple physics engine you have one very hard topic to learn, collision detection and coming up with a good algorithm for that. If you were talking about just using physics in unity to make stuff move around, I’ll give you the TLDR. - use fixed update for forces that act over time - use forceMode.Impulse for forces that happen instantly (or if you aren’t concerned about realistic-ness you can use forceMode.velocityChange) -change an object’s mass to make it more or less “influenced” by the force you act on it Hope that helped and feel free to ask any questions!
@theashbot4097 Жыл бұрын
@@WillHessGameDev I am gust trying to make a light weight version of the unity physics. All the "physics" that my "physics engine" will have is Gravity, Collision Detection (Using unity colliders, and Physics.Overlap____), ground checking, fake velocity, fake drag, slopes. the drag, and velocity is even more simple then what you explained in the video.
@theashbot4097 Жыл бұрын
I amm planning on adding force when colliding with things though.
@WillHessGameDev Жыл бұрын
Cool, well if you get stuck feel free to reach out!
@averagegamer9513 Жыл бұрын
Correct me if I am wrong, but I think your saying of “the force that counters gravity” is a bit misleading... The definition of a normal vector is one that is perpendicular to a surface, which I think is fairly descriptive. On the other hand, what you are describing seems more like the positive y component of a force vector, which in general is not the same as a normal vector. Other than that, this is a great video, and I’ll be following along to integrate physics into Unity. Thanks! Edit: I noticed you misspelled “braking”, lol.
@WillHessGameDev Жыл бұрын
I totally agree that the actual definition of the normal force is more accurate, but I feel like a lot of complete beginners would start freaking out if I said something more technical like perpendicular to the surface. That is definitely a better definition if you know how vectors work, but with friction on a flat surface, referring to a normal force as the force that counters gravity is sufficient in my opinion. But yeah it is a little misleading when talking about normal forces and normal vectors in general, because they don’t necessarily have to be caused by gravity in the first place. Thanks for watching and leaving the little correction!
@WillHessGameDev Жыл бұрын
Lol I am terrible at spelling so to only have 1 noticed spelling error isn’t too bad!
@ashishawasthi43506 ай бұрын
This kid is God sent to me …. Thanx buddy …. U r a genius … It’s exactly what I needed… thanx
@astrostarz Жыл бұрын
Awesome Content 🔥 THANK YOU SO MUCH!
@WillHessGameDev Жыл бұрын
Thanks for watching!
@benjaminleedy5 ай бұрын
I stumbled onto this video yesterday as I've been researching game physics for a physics-light helicopter game I'm working on. The engine I'm using, Godot, does a terrible job of simulating drag, but I didn't fully understand how I would apply your approach (Fd=-bV) to Godot. Is -b just a "best guess" value? I plan to do some experimentation and see what feels right, but my goal is to choose values and build a simulation that works with realistic properties applied to the helicopter assets I build AND to allow modders to add their own helicopters to the game without them having to do extensive math, just using a sane value for the mass, making sure the center of the node is the intended center of mass, and maaaybe having them calculate the center of pressure/drag and place a Node3D there. Okay, this is getting long and I apologize, but I really want something that's realistic yet accessible for players and modders alike. Any guidance you may provide is appreciated. My experience with physics is basically just intuitive (playing KSP) and struggling to help my son with high school physics. lol
@WillHessGameDev5 ай бұрын
Yeah that -bv for drag isn’t the most accurate way of doing it, if you can and are trying to make things ultra realistic you’d probably want to use the more complex equation. It’s a bit more cumbersome and you’d need the cross sectional area to make it as accurate as possible. The b can be calculated from your best guess at the objects terminal velocity. Sorry it wasn’t a great answer but drag is very complicated to do 100% realistically
@benjaminleedy5 ай бұрын
@@WillHessGameDev No, you're good. You could do another video much longer than this one just about calculating drag. I have a few ideas about how I might approach the problem by using a shader to get the reference area and working backwards from maximum airspeed to work out the drag coefficient. It's not a perfect solution, but once I have some numbers that are more or less working for me I can do some testing and at least make something that doesn't break the illusion for the player. Thank you, BTW, for this video. Really helpful stuff.
@WillHessGameDev5 ай бұрын
As much as I love physics, a super long video just on drag would likely not perform well. I’m thinking about making more of a video series with all the main parts of this video as their own separate video, and showing implementations in unreal and godot as well, so for the drag video, I could go into a bit more detail. However it will not be anywhere near the length of this video lol. Thanks for watching!
@benjaminleedy5 ай бұрын
@@WillHessGameDev that's a great idea. I hope it's well received. I certainly wasn't suggesting you should make a super long video on drag, lol. Just saying that's what it would take to discuss it in depth. I'm no KZbinr, but once I have a serviceable solution I might write something up on GitHub in hopes that it may help someone else.
@fewbronzegames5 ай бұрын
thanks a ton for this, it's very helpful for learning topics
@mogr488 Жыл бұрын
Recommended this video to my friends.
@WillHessGameDev Жыл бұрын
Thank you!!!
@dragonninja9908Ай бұрын
Brother u made me like physics again
@TyricSatyric6 ай бұрын
29:47 that's probably because of the shape, if you throw a sheet of steel and a sheet of paper they won't fall at the same speed because of the air AND the shape, but 2 balls will need a much greater distance to be able to see a diference Either way if there is no air everything just falls at the same time
@juodapimpiumusikas9495 Жыл бұрын
4:32 wouldn't the balls hit each other before they hit the ground, since because of the ball mass of 100 000 000 kg, it would accelerate the ball of 1kg, which is ~30cm away from the heavy ball (their centers), it would accelerate at 7cm per second per second, which would mean that if they fall for atleast 2.5 seconds, the distance between them would shrink to 0. Though it still doesnt change the point that they would hit the ground at the same time, so this is kinda useless.
@WillHessGameDev Жыл бұрын
I just used big numbers and small numbers to demonstrate the fact that the balls fall together. It was kinda a silly example and a dumb excuse to talk about the balls of a long dead scientist…
@Random_Variableee6 ай бұрын
Hey can u also make a video on a ultimate guide on maths for game development centered around unity like u made in this one. It would really help
@WillHessGameDev6 ай бұрын
Definitely! With the success this video has gotten I’d totally be down to do that. I have my next few videos already planned out so maybe in a few months. Thanks for the idea!
@Sofia-rh7ji Жыл бұрын
With your section on Friction, while what you said is entirely accurate, I would like to point out that constant friction, despite being the most accurate representation, will often feel unresponsive for the player or anything that would be alive, which is why I will typically add other "friction" constants that scale linearly and quadratically to your velocity to make it feel more responsive to the player controller and the movement systems for other "living" entities. And while your drag section is definitely interesting, it isn't actually that computationally expensive to represent the drag much more accurately, so, while it makes sense to represent it like that for most games, I typically will make my physics systems work off of -bv^2 for acceleration because it drives me crazy when I know that I implemented something innaccurately. Also, if you're implementing your own collision processing, it's actually a lot simpler than you would think, with varying elasticity essentially just being an interpolation between perfectly elastic, and completely inelastic collision. Completely inelastic collision can just be represented as taking the total momentum and dividing it by total mass to get the mass of both objects, and, though slightly more complicated, perfectly elastic collision can be simplified down to a few rules and isn't too hard to implement, even in 3 dimensions. And one thing which I think you should have mentioned would be the way in which rotational velocity is represented, because too many times I have seen friends directly modify the rotational velocity and get really weird results. So, for people interested in directly modifying rotation velocity, know that the direction of the vector represents the axis that it spins about, ie. a rotational velocity of would rotate about the x-axis, and the magnitude represents speed, so a rotational velocity would spin twice as fast. Importantly, however, this DOES NOT mean that a rotational velocity of would spin about the y-axis and x-axis simultaneously, instead, it would rotate between the two axes, which is how you can get weird gyroscopic procession when you mess with the rotational velocity vector directly. For those confused with how this works, I would personally recommend just interacting with whatever is equivalent to the AddTorque method in whatever physics engine you use.
@Sofia-rh7ji Жыл бұрын
By the way, if you have rotation, it doesn't actually make the collision system that much more complicated, and, for a temporary fix immediately after implementing rotation to your physics engine, you can just take the velocity deltas and use those to find the impulses, and then apply them locally so that you can process those in whatever function you have to process forces that aren't in-line with the center of mass. Keyword here for this method is "temporary," though, as this is not accurate, and can make inelastic collision seem more elastic than it is.
@WillHessGameDev Жыл бұрын
Wow that was very insightful! Thank you for leaving this. The thing with drag is that the -bv is how unity handles it and coding my own solution and explaining it in the video would definitely turn some people off so I decided to stick with how unity did it!
@imacmill Жыл бұрын
Probably mentioned in the comments, and maybe something you clarified somewhere deeper into the video, but acceleration is more correctly defined as a change in velocity and/or direction. So you could be traveling at constant velocity in a circle (constant angular velocity), but you are accelerating.
@WillHessGameDev Жыл бұрын
Yes that is 100% true, but I don’t think anything was incorrect about my definition. I believe I defined it as the change in velocity over the change in time. Velocity is a vector quantity so it has both direction and magnitude. I’m the case where the object is traveling in a straight line, direction stays constant and the magnitude changes, but in a circular path, an object traveling with a constant speed will accelerate towards the center of the circle. This is called centripetal acceleration and is a whole other topic I didn’t mention in the video, but the tldr of circular motion is that a=v^2/r. If I said acceleration was the change in speed over the change in time, then that would be wrong because it defies circular motion. I thought all of this stuff was too confusing to discuss in the video and make people click off because they were too confused, but yeah.
@imacmill Жыл бұрын
@@WillHessGameDev Apologies, you are correct.
@WillHessGameDev Жыл бұрын
Lol no need to apologize, you are also correct. The beauty of physics is that there are some things that are just needlessly confusing where we can be talking about the same thing and not even realize lol
@RitterderRedlichkeit Жыл бұрын
very good but I wish you would have talked about verlet RK4 and Triangle collisions
@WillHessGameDev Жыл бұрын
Thanks for watching. I'm gonna be honest IDK what that stuff is so that's why it wasn't in the vid
@ScorgRusАй бұрын
46:50 Don't know what you meant, but radians are not 'a fraction of pi'. Pi itself is in radians, and a radian is a unit of measure.
@irishbruse Жыл бұрын
Dude sounds like Michael Reeves if he hit puberty
@WillHessGameDev Жыл бұрын
Thanks… I think…
@fjohnson-o4t Жыл бұрын
Great video, subed ^^
@WillHessGameDev Жыл бұрын
Thank you!!!
@KennyFully Жыл бұрын
Nice! Thank you for this!
@WillHessGameDev Жыл бұрын
No problem!
@dillonramadhar93 Жыл бұрын
would you recommend any books because I want to learn more about these topics
@WillHessGameDev Жыл бұрын
I leaned physics from an ap physics class in high school. We used the serway jewett 9th edition I believe but I wouldn’t recommend that one just because of the sheer amount of other stuff in there. It’s really good but if you are just into the Newtonian mechanics (what this video was about) then getting that textbook is crazy overkill because it goes into electromagnetism, thermodynamics relativity and probably other parts of physics that I’m forgetting about. It’s also calculus based which if you understand the calculus involved then the concepts make much more intuitive sense but I could definitely see someone who isn’t well versed in calc getting very confused with some of the problems and explanations in that textbook. It’s really up to you but look for something with Newtonian / classical mechanics and with practice problems because doing problems is a great way to make sure you understand the concepts. Sorry I didn’t have a specific recommendation but I hope that helped!
@christopherfrancique991216 күн бұрын
thanks bro, so clear
@animenmusic1611 ай бұрын
I don't know anything about game development except the physics. Just wanted to ask is fluid mechanics also needed for it?
@WillHessGameDev11 ай бұрын
Depends on what you are doing. Fluid mechanics aren’t something I know much about. I might be wrong about this but I think the concepts of fluid mechanics come from vector calc making everything a lot more complicated. If you are making a fluid simulation or something like that game where’s my water, then you’d probably have to know a bit of fluid mechanics but for creating stuff like oceans fluid mechanics is most likely not needed. It’s usually some sort of sine function offsetting vertices in a plane to create waves and then scrolling some normal maps, so not much real life physics. Sometimes making stuff look good enough is better than spending a long time getting things true to real life.
@animenmusic1611 ай бұрын
@@WillHessGameDev no, you are not wrong. Concepts of vector calculas are needed for Fluid kinetics and dynamics.
@uwoowoayaya4 ай бұрын
28:15 Is incorrect. The force of drag is not directly proportional to the velocity. It's directly proportional to the square of the velocity.
@WillHessGameDev4 ай бұрын
At 27:46 I talked about the drag equation, including velocity being squared. After that I talked about how the resistive force model dumbs everything down with the b and things not being physically accurate, just the key ideas of higher velocity = more drag. Unity uses the resistive force approach to drag which is why I showed that section the way it was
@5DPixel7 күн бұрын
Thanks, I’m making a game engine in Vulkan
@panjak3236 ай бұрын
I still remember how lost I was when learning this crap in Physics in Uni. Now it seems trivial, when applying it in practice.
@frankrivera1010 Жыл бұрын
Well done. A great tutorial.
@WillHessGameDev Жыл бұрын
Thank you!
@DanielMatéGonzález Жыл бұрын
how tf did you already do so many projects although you are so young 10/10
@WillHessGameDev Жыл бұрын
Thank you so much!!
@rlf1989 Жыл бұрын
Great video! Thanks a lot
@WillHessGameDev Жыл бұрын
Glad you liked it!
@codexed-i Жыл бұрын
You are awesome❗ Keep up the good work❗
@WillHessGameDev Жыл бұрын
Thank you ❗️
@wj11jam78 Жыл бұрын
personally, I start by setting a few parameters, creating a dense ball of game objects, and allowing them to expand rapidly. Then I just wait a few billion years, and I get a free physics engine.
@WillHessGameDev Жыл бұрын
That’s a pretty good idea, keep me posted in a few billion years to see how it turns out!
@draken2037 Жыл бұрын
thanks brother this video is like a life saver
@WillHessGameDev Жыл бұрын
You're welcome! Thanks for watching!
@PlanetJeroen Жыл бұрын
fuck me .. either I wasnt ready, or my teacher wasnt, way back when I was in school. Thanks for this easy to understand explainer.
@WillHessGameDev Жыл бұрын
No problem! Thanks for watching!
@EnjoyCocaColaLight Жыл бұрын
isBraking Not isBreaking. It's not breaking (falling apart), it's braking (equalising velocity)
@WillHessGameDev Жыл бұрын
English is hard :(
@EnjoyCocaColaLight Жыл бұрын
@@WillHessGameDev Is okay. Now you know and can fix so in the future if you need a bool to check if something is destroyed you won't have ambiguity. #1 genus moed
@jinchoung Жыл бұрын
hey do you have any insight into why most physics simulations - whether it's unreal, unity, blender, maya or houdini look FLOATY and slow motion when proper values are used for stuff like mass and gravity? like EVERY hard body collision demo - even your examples (sorry) - i swear it all looks slow and wrong and there's got to be some overarching reason why that is.....
@WillHessGameDev Жыл бұрын
In real life, nothing is actually a rigid body. A rigid body is just a convenient way to better understand what we want to understand. When things collide they squish and there’s this thing called the coefficient or restitution (I think (I am not an expert on this part)) that comes into play. This little bit of real life stuff makes the calculations needlessly complex. Also in the simulation everything happens instantly. What I mean by that is that if two objects collide, their momentums will instantly change, and in real life that is impossible (stuff just happens very quickly). That’s my best guess but idk if it is what’s actually going on.
@jinchoung Жыл бұрын
@@WillHessGameDev i don't think those would result in the movement looking slower though. if anything, those factors would result in simulations looking FASTER. but in almost everything with real world values entered, simulations end up looking slow mo - in your example, the body getting hit by impulse doesn't fall as fast as a real world body would. in order to get a sack of potatoes to drop like a sack of potatoes in a sim, i have to jack up either the mass or the gravity to several orders of magnitude higher in order for it to look right. this has bugged me for as long as i've been doing cgi and i want answers! but thanks for fielding the question. the search continues.
@user-sl6gn1ss8p Жыл бұрын
@@jinchoung I think the falling thing is more down to perception. Even as Super Mario Bros on the NES used a higher "gravity" for the falling phase of a jump, to look and feel tighter. There's no reason a free fall would actually be slower in a (decent) simulation, so long as sizes, distances and acceleration are consistent. What I mean is, if you put a ruler and a clock in your virtual world and measure the fall, it should match the real thing very well (so long as drag and stuff is minimal). So the difference is more perceptual, maybe because of how we translate images and sizes on images vs on the screen or something. Also, in games we often want thing to go up way higher than they normally would, but we don't necessarily want them to take that much longer to fall, so there's all that I guess?
@Maksimka-vc8fw Жыл бұрын
Great job, appreciate it.
@WillHessGameDev Жыл бұрын
Thanks for watching!
@gameofpj3286 Жыл бұрын
I'd say this video is really good when you're using a game engine. But the title is a tiiny bit misleading (in my opinion), because I thought this would be more about physics (engines) from scratch and not just using something existing. But still for what it actually is, a good video!
@WillHessGameDev Жыл бұрын
Thanks for the feedback. I don’t really understand the point of making a physics engine from scratch if I’m being honest. There are so many amazing tools already out there, and unless you are a massive triple a studio, I don’t see why you would need to make your own. If it was the case where you are just curious about that stuff and you are just messing around, expecting a 1 hour KZbin video to clear it up is not very realistic. Thanks again for watching!
@ZihadJoy10 ай бұрын
good thing we were taught this in high school
@popsters_ Жыл бұрын
upthrust could also be something nice to add if you do anything like this again
@WillHessGameDev Жыл бұрын
Good to know!
@Carhill Жыл бұрын
Big shout-out to Galileo and his balls.
@WillHessGameDev Жыл бұрын
Exactly people always credit Galileo but they forget to credit his balls too! Justice for Galileo’s balls!
@lowlevelgamedev93302 ай бұрын
Best video there is 💪
@vadim_shashin3 ай бұрын
Making my little physics engine for a little 2d game with a very low knowledge about physics 😂 Super accessible but I guess I need to watch this several times 😅
@creaturesfromtheether53102 ай бұрын
Holly math batman. I'll just stay working at the Dairy Queen
@mathematicalmachinery7934 Жыл бұрын
38:13 floating point error
@mathematicalmachinery7934 Жыл бұрын
It’s the same reason that 0.1+0.2=0.30000000004. I used to have to deal with this all the time
@mathematicalmachinery7934 Жыл бұрын
To be more precise, what happens is the ball will go lower than the platform, then be snapped back up just a bit to correct for that floating point error, which adds a bit of energy. Specifically mgh, where m is the mass of the object, g is the local gravitational force, and h is the amount that got snapped back up.
@mathematicalmachinery7934 Жыл бұрын
What I usually do to fix this is either a) ignore it b) calculate the added gravitational potential energy and remove it from the kinetic energy
@WillHessGameDev Жыл бұрын
Ohhhh yeah I forgot about that one. Thanks for clarifying!