@@YoAndyZou Unless the aircraft is specifically designed as a lifting body (see Martin X-24), the fuselage probably generates somewhere in the region of 10% of total lift. This is more of a figure for general aviation and commercial aircraft, though. Fighter aircraft are probably an exception to this, I'm not sure. I would imagine something like the SU-57 or F-22 generate a non-trivial amount of lift from their fuselages. They're both quite flat and have almost blended-wing body designs.
That's true. If we define lift as just the vertical component, it would be much more accurate (and cheap) if you just place a few surfaces along the body and calculate their normals from one direction to approximate the body shape. This creates newtonian drag and lift. I use a similar approach, but instead each part is a block and i check all 3 axis ensuring that it "just works" no matter how i build it, and it's because currently i'm building blocky planes.
This is fantastic content, well done and thank you! The visualisation of everything really helps explain things, especially with the 3brown1blue colour scheme. The code is very much appreciated, as that's the main way I understand maths.
This is the best, most robust, and useful summary I've ever seen on writing aircraft physics for games. I'm especially impressed at the solution to physics substepping, as it's something that I actually struggle with on my own game.
Looks like I’m a bit later than everyone else, but I also saw your reddit post, and I have to say, I am more than impressed with the quality! Keep it up!
I've been looking for a video explaining aero simulation for ages. Amazing job, the visuals and detailed breakdown make this complex problem easy to understand. A+ quality content, I look forward to future videos like this!
i was expecting code stuff but greeted with well explained physics and the maths behind it, much better than what i've been thought before in school. excellent tutorial
Thank you very much for the excellent video! even more by opening the resulting code. I was looking for more adventures about physical calculations and their contributions to a more enjoyable gameplay and your channel seems to be excellent!
Your videos are excellent, and am sure take a _lot_ of time. Not only did you make a great easy to understand video and explanation, but also the detailed math and source code are also there. Subscribing just in case there are ever any more.
Based on your aircraft physics , I built a Kamikaze (Suicide) UAV simulation in Unity, and I'm continuing to develop on it. Excellent work, and many thanks for sharing it.
I wish as well that More air games continue to have Options for More Engaging Physics that can be Applied for Any Platform, just like Realistic Driving Physics games
wow i been bashing my head for this problem for a while.... you start off wanting a tutorial in your language, you end up willing to read the JBSim manual .... it's really hard to penetrate the academic angle here so this is a valuable video very good thanks
Wow your videos have insane content quality. I like how you go further into the math, even though I don't quite understand all of it (especially the ocean IFFT video). But I'm glad you presented it so clearly which gives me a direction to how to tackle these problems. Thanks!
Dude, your video is so well made, thank you ! Vehicle physics are a very niche subject, but still you made a high quality video on it ! True dedication
WOW - this is great, everything you say is true and all approximations are reasonable. Such accuracy is rare on youtube. I have some background in this. I have been a software engineer for teams that program both military flight sims and aircraft route planners. I also have a masters degree in mech engr. and have read & studied many books on both practical and theoretical aerodynamics. I have been playing star citizen and unlike DCS it obvious Star Citizen simulation does not follow a methodology such as you describe. The STAR CITIZEN space craft have top speeds which is not correct and there atmospheric flight model is adhoc. This has made me consider writing my own flight/space sim in UE5 or at least giving some constructive feed back to the star citizen community. I will reference your video. Also I keep thinking how simple it is to do correctly and modern hardware can easily handle this. For a long time I have been thinking of how simple the force & moment part of a flight sim is. YOUR video shows how simple the equations are. One other thought I had was to calculate tables for CL, CD and CM based on Cos (or Sin) Squared......... that saves the simulation from doing trig. & square roots when getting alpha and beta from the position & orientation vectors. Also if you want to extend the aerodynamics for sideslip we can use the same methodology where angle of attack (alpha) is the angle between the aircraft axis and the plane perpendicular to the the lift vector. In the plane perpendicular to the lift vector, Angle of sideslip (Beta) is the angle between the aircraft and the velocity vector when we look from the aircraft down along the lift vector. (I think that is the convention for alpha & beta with side slip but I it am working from memory). If we want space craft with orbital velocity we use Earth centered coordinates and change the grav vector slowly with time. we can also change the grav constant in a bigger time step since this changes slowly. Star citizen space craft change the mass negligibly with fuel burned so dv/dt = F/m is good enough. (vs the change in momentum form of F=ma when mass is changing rapidly.) The more I think about this the more I conclude for multiple planets there are only a few constants that control such a simulation: atmospheric density, atmospheric viscosity (if we model Reynolds effects) planet mass, planet radius ............. also long ago i accurately derived models for earths atmosphere with the ideal gas law. Temperature is directly proportional to the altitude but the constant of proportionality changes three times on earth. (where temp decreases, does not change or increases linearly with altitude). at these altitudes we can make a simple density function where density = Ka + Kb log (altitude) and the K's change where the temperature function K's changed. (the density funtion i derived long ago so my memory could be incorrect but it is a simple function based on a few constants). Or we can density tables. Either way A/C fly the same in any atmosphere based on a few constants for the purpose of a flight/space sim. Also you did not touch on this but we need to calculate the Moment of Inertia matrices for our Rotations. One other thing is I have read a lot on doing the rotations with quaternions not Euler angles. We can convert the state quaternions back to Euler angles, latitude, longitude and altitude at a slower time step (3 to 5 times a sec) for our instrumentation on the aircraft. I think Unity and UE5 support quaternion based rotations. If they are doing this properly those engines should be using the SSE matrix instructions & multiple cores to do this efficiently. The problem with a non physics based simulation is it based on game design decisions on the flight algorithm. Any time one changes anything every thing can blow up. If it is based on physics the only errors we should get are numerical tuning. Again great video, you condensed a bunch of aerodynamics into stuff a lay person can understand. EDIT: I looked up alpha and beta definitions and I had it slightly backwards on which is defined 1st alpha or Beta. The correct definition is Tan(alpha) = u/w and Sin(Beta) = v/Velocity, where u v w are is the Velocity vector in aircraft coordinates. See control.asu.edu/Classes/MMAE441/Aircraft/441Lecture2.pdf. Also the relation for density as function is altitude is something I derived over 10 years ago. Other things to add are ground effects which removes drag due to lift and increases lift. I think there is an approximation for when this is applied and it is at x wingspans above the ground. A quick google search found www.faa.gov/regulations_policies/handbooks_manuals/aviation/phak/media/07_phak_ch5.pdf as a guide for ground effects although the discussion was quantitively. Some thing in my memory wants to use 2 wings spans as an approximation.... but something way back in my memory. Also I looked at your github page and saw the unity engine is handling the Rotational Inertia. I also saw you said drag was 50% high so you added 50% thrust. I was wondering if the way the simulation used predicted_force_update to add 50% force at a smaller time step contributed to this. I have not seen the code but maybe approximate normalizing the predicted would fix this. I would expect your forces to lower than real life because you may not have modeled all fuselage drag. Parasitic drag also was omitted which in aircraft drag book keeping there is both drag due to lift and the remaining drag is parasitic drag which is independent of angle of attack or sideslip. it is basically the drag due to skin friction alone. Again Great Video and it was nice to see you backed up your video with some actual code on github.
TH-cam is now recommending your channel but it looks abandoned, this makes me really sad, you explain things really well without going into unnecessary details!
im confused, you produce such quality content and you only have 150 subs 0.0 I have no doubt that you're channel will blow up soon to the position it deserves to be !
As a fan of Ace Combat and of flight sims, and as a programmer who really likes Unity, this video is a gold mine. It does seem that something is wrong with your repository though, it simply redirects me to an error page. Not that it matters, I should be writing my own code anyways. Edit : Nevermind that part about the error page, all of Github is doing that today. I can't even access my own code!
Thank you very much for this tutorial! The thing that got me the most interested though is how did you make those white trails on the tip of the wings? I cannot get anywhere close to similar results Anybody knows??
I'll admit that for years I'm trying to find some sort of tutorial for this, since I write in Unity as a hobby. It was very thorough, and you managed to compress it to a 12 minutes beautiful video. My intention is even a lot more simpler, and I'm trying to create a 2D flight game. Do you have any tips on how can I take this project towards the 2D direction?
I think for a 2D game you'll be better off with unrealistic arcade contoller that suits your gameplay. For example you can model the airplane as a single piece with lift and drag angle of attack curves tuned by hand, or don't bother with forces at all. Either way my code won't help much, but the general principles laid down in the video might!
Amazing Video, Really needed something like this but can you follow up on the reynolds number and mach number part, as I am near a complete loss on that section.
Flight games that I've played that have Respectable physics are: Airforce Delta series/Aero WingsSeries/ AceCombat 3, 04, X and 06 respectively, War Thunder, flight Apps for Mobile: Simple Planes, Carrier Landings HD ! These are some that have Sensible feel of Flight Physics
I have not tried it yet but I feel like the starting formulas are enough for my game, and for finding the area in contact, I will just make a raycast that turns according to the planes velocity (in front facing toward the wing, kinda like this ------RAY---> ------RAY---> ------RAY---> I will make many rays going up and I will find how many of them hit the wing, then I will just multiply (Amount of rays hit) into wing length Hope others who wanna avoid that formula use this 🤣 and great video, the amount of knowledge, watching yt aerodynamics vids, reading unity documentations, not touching grass....
@@2kDVI 3-4 iterations over the past year, got something pretty similar to war thunder now :) So this is where it all started, attempting to make semi-realistic airplane physics was my second project ever 💀 ofc I took breaks and worked on other projects but as a guy who loved planes this was always on the top of my head until I got something that satisfied me 2 months back
This is a great video and has a really nice explanation. But are you ever gonna update the project to be able to incorporate spanwise flow so that you could have delta wings as an example.
do i study airplane physics right now? im just searching for a way to implement great airplane physics for a game and wasnt looking for to study it haha, but its a great video with lots of information. keep going!
my erudition is in audio rate modeling, i was surprised by the use of position delta as velocity in the XPBD method, if that's not common in physics sim (best explained in the video "09 Getting ready to simulate the world with XPBD"), might work better that way, or just oversample 128x :) thanks for the concise, focused presentation!! :O
I wish I'd known about this sooner! Would have been great for when I was trying to make flying physics for this game I'm on. What about rotor wings? Helicopters, I mean.
This is exactly what I was looking for. You have an excellent method of explaining concepts. Question: Is your approach flexible enough to apply to cars? Hmm... I guess cars themselves kind of act as one big airfoil, ideally not producing lift, and if they do, toss a spoiler on the back. Essentially, I'm trying to achieve a good "feel" for when my car launches into the air. Currently, it just kinda spins about as if it's in a vacuum which feels "off."
I don't see why not. Your approach sounds like it could work. But unless you are giving the player some sort of input to change orientation or angle of attack then I don't see the benefit of dedicating so much time to a feature that probably won't make much of an impact on the end-product? Maybe just hand-tune some fake "drag" forces depending on the angle of attack of the car, taking into account only air speed. That's what I would do if arcade physics would suffice.
@@phxcppdvlazi Ha, I am in fact allowing the players to manipulate their cars mid-air. My problem is I can't give them too much control, otherwise they can just cancel out any tumbling effects immediately, but too little control has the opposite problem. I figured air physics would help me find a middle ground. And yeah, you're right, it is arcade style and simpler is better. Sometimes it's hard to tell if I'm doing something because it benefits the game or it's just the excuse I use to indulge in yet another learning experiment. In this case, it turned out to be another learning experiment, haha.
I'm making a bird flight simulator, and I ended up using a very similar approach to you before I even saw the video! I've been experiencing the dreaded jitter like at 8:54 if I maneuver too fast, and I think the substep is a super elegant solution. However, my wing is broken into a lot of thin segments (around 20 per side), so I'm worried that recalculating the forces on each one will tank the performance. I guess the only way to find out is to benchmark it. If that turns out to be unfeasible, do you know of any other ways I can prevent it from jittering?
Hello, I wish I learned that sooner. Finding the right coefficients was quite a hard task... Also well done with your solution to fixeddeltatime. There's still a lot to cover, things like aircraft controls, I tried a war thunder style mouse tracker using pid's, it's still very unstable even after a year of work. You should try to cover the engine propeller topic, which is far from intuitive but worth the time
This is sabastian league level stuff. Im trying to make a controller for a game and for me this is confusing as hell. nice vid though. maybe one day i'll understand you haha
Hey, I have a problem where It's really hard to balance all the surfaces to actually get the plane to take off and fly normaly, also if it works and I turn the game starts acting weird like with the turning.
Another cheap approach to stabilising the forces - filter them. In Aircrafts it is rather uncommon for the forces to rapidly change within a tenth of a second so it is fine to assume the forces acting on the airframe at this frame are similar to the forces of the last frame. That can be as simple as storing the calculated forces, and every frame adding the newly calculated one and then dividing by 2. Cheap, simple, can give amazing results with nearly 0 memory and computational cost.
The only question in the video you only cover a propeller being what cause the forwarded movement. What would change if it was a jet plane out side of the forwarded movement being in the back of the plane then the front?
As I say in the video, I didn't really try to model thrust source, be that propeller or jet engine. I just applied a force directed forwerd to the rigidbody. So for a model this simple there is no difference.
@@Irategamefan well in theory it would work some what different in space due to the gravaty and wind and air displacement differance from on planet and space
I have a question, at 7:59 the angle of attack calculated is in radians. Why do we not convert it to degrees? Don't lift coefficients use the angle in degrees for calculations? I would like to understand why. Thank you.
Anyone know a more step by step tutorial? I've been looking at your video, and while it's given me a good starting point, I still don't really get how to implement it :(
th-cam.com/video/e91QA4WfL5Q/w-d-xo.html This video shows how to implement a simple plane and explains the main parts of the code. Careful though, the source code he gives has been updated but the principles explained are still the same.
Hello, I loved your project, it will help me in my studies, today I play fsx steam edition and I loved the cessna 172, rs, let me ask, is there a way to generate maps, based on google maps, google earth, and join this project? if so, could you teach?
Assuming this is proper realistic which it seems to be, could this work with helicopters as well seeing airfoil physics are the same? Or would i have to make adjustments since the speed of the airfoil is based on its own rotational speed and not just the speed of the vehicle?
Very late reply, but in theory it should work, provided that you account for the motion of the rotor blades and other adjustments. It might have issues in certain cases however, and you can probably get a more realistic result with fewer calculations (e.g. by utilising the symmetry of the blades). Helicopters are more strongly affected by the displacement of air that they themselves create, especially when hovering near the ground for example.
@@Hwyadylaw hmm, fair enough, i think i need to find a good middle ground, i can prolly adjust the lift calculatiom by just simplifying to the movement of the helicopter + rotation of the rotor disk
A fantastic video and accompanying source code. So helpful! Thank you. I' going to look at converting this to Godot 4. Unless someone else has already done the work?
I know you might not see this comment, but would you be able to do something like this for in UE5? If not could you maybe point me towards some help to reproduce this in UE5? I'm still new and coding isn't my forte but im learning, slowly. Thank you.
I found your post on Reddit. This video's quality is of insane quality and you did a really great job putting the whole thing together!
Thank you very much! I tried really hard and I'm happy you liked it!
One thing to remember is that the body of an aircraft creates lift too, so airplanes won't feel quite right without aerodynamic surfaces on the body.
How much lift does it contribute? I would have guessed it'd be somewhat negligible compared to the wings
@@YoAndyZou Unless the aircraft is specifically designed as a lifting body (see Martin X-24), the fuselage probably generates somewhere in the region of 10% of total lift. This is more of a figure for general aviation and commercial aircraft, though. Fighter aircraft are probably an exception to this, I'm not sure. I would imagine something like the SU-57 or F-22 generate a non-trivial amount of lift from their fuselages. They're both quite flat and have almost blended-wing body designs.
@@amilkyboi Maybe not lift, but i think aerodynamics of the body contribute to pitch and yaw stability
That's true. If we define lift as just the vertical component, it would be much more accurate (and cheap) if you just place a few surfaces along the body and calculate their normals from one direction to approximate the body shape. This creates newtonian drag and lift. I use a similar approach, but instead each part is a block and i check all 3 axis ensuring that it "just works" no matter how i build it, and it's because currently i'm building blocky planes.
This channel is so underrated. Hope you will blow up soon. You deserve it.
It will surely be a matter of time
Then you should share this video on your social media channels to support your "hope"
This is fantastic content, well done and thank you!
The visualisation of everything really helps explain things, especially with the 3brown1blue colour scheme.
The code is very much appreciated, as that's the main way I understand maths.
Thanks for watching! Glad you liked it!
@YuoTvbe my bad, thanks!
This is the best, most robust, and useful summary I've ever seen on writing aircraft physics for games. I'm especially impressed at the solution to physics substepping, as it's something that I actually struggle with on my own game.
Thank you! Glad to be helpful.
Looks like I’m a bit later than everyone else, but I also saw your reddit post, and I have to say, I am more than impressed with the quality! Keep it up!
Woah... this video is exactly what I needed to start development of a game I’ve been dreaming about for years.
Thank you so much !
I've been looking for a video explaining aero simulation for ages. Amazing job, the visuals and detailed breakdown make this complex problem easy to understand. A+ quality content, I look forward to future videos like this!
i was expecting code stuff but greeted with well explained physics and the maths behind it, much better than what i've been thought before in school. excellent tutorial
Thank you very much for the excellent video! even more by opening the resulting code.
I was looking for more adventures about physical calculations and their contributions to a more enjoyable gameplay and your channel seems to be excellent!
Thank you! I'm planning to do more gamedev physics stuff in future videos!
Your videos are excellent, and am sure take a _lot_ of time. Not only did you make a great easy to understand video and explanation, but also the detailed math and source code are also there. Subscribing just in case there are ever any more.
Thank you! There will be a video in December.
Really hope you continue with this kind of content because you are doing a fantastic job, thank you!
Based on your aircraft physics , I built a Kamikaze (Suicide) UAV simulation in Unity, and I'm continuing to develop on it. Excellent work, and many thanks for sharing it.
This is amazing! The video quality is worthy for a 100k subs channel!
But is this video worthy for you to share it on your social media channels? Can you make an impact, not noise?
I wish as well that More air games continue to have Options for More Engaging Physics that can be Applied for Any Platform, just like Realistic Driving Physics games
Meu deus, foi tão dificil achar um conteúdo assim. Obrigado, mais um inscrito e ansioso por mais videos!! :D
One of the best things I have seen on TH-cam. Great job!
Perfect! nice work.
Thank's a lot!
wow i been bashing my head for this problem for a while.... you start off wanting a tutorial in your language, you end up willing to read the JBSim manual .... it's really hard to penetrate the academic angle here so this is a valuable video
very good thanks
Quality video and perfect for people who are not satisfied with over-simplified implementations!
I am feel like creasy!! waiting for the continuation of this topic in another video!!
😁
🙏
the code is super clean, wow what a nice work! and it works better than all paid solution on the assetstore, its really accurate.
these videos are incredibly high quality, and its a shame you never continued your youtube journey
This is pure gold. I'd love to smash a donate button!
Wow your videos have insane content quality. I like how you go further into the math, even though I don't quite understand all of it (especially the ocean IFFT video). But I'm glad you presented it so clearly which gives me a direction to how to tackle these problems. Thanks!
Dude, your video is so well made, thank you ! Vehicle physics are a very niche subject, but still you made a high quality video on it ! True dedication
Not niche at all
Such a compact, elegant, informative video, abusolutely amazing!!!
WOW - this is great, everything you say is true and all approximations are reasonable. Such accuracy is rare on youtube. I have some background in this. I have been a software engineer for teams that program both military flight sims and aircraft route planners. I also have a masters degree in mech engr. and have read & studied many books on both practical and theoretical aerodynamics.
I have been playing star citizen and unlike DCS it obvious Star Citizen simulation does not follow a methodology such as you describe. The STAR CITIZEN space craft have top speeds which is not correct and there atmospheric flight model is adhoc. This has made me consider writing my own flight/space sim in UE5 or at least giving some constructive feed back to the star citizen community. I will reference your video. Also I keep thinking how simple it is to do correctly and modern hardware can easily handle this. For a long time I have been thinking of how simple the force & moment part of a flight sim is. YOUR video shows how simple the equations are. One other thought I had was to calculate tables for CL, CD and CM based on Cos (or Sin) Squared......... that saves the simulation from doing trig. & square roots when getting alpha and beta from the position & orientation vectors.
Also if you want to extend the aerodynamics for sideslip we can use the same methodology where angle of attack (alpha) is the angle between the aircraft axis and the plane perpendicular to the the lift vector. In the plane perpendicular to the lift vector, Angle of sideslip (Beta) is the angle between the aircraft and the velocity vector when we look from the aircraft down along the lift vector. (I think that is the convention for alpha & beta with side slip but I it am working from memory). If we want space craft with orbital velocity we use Earth centered coordinates and change the grav vector slowly with time. we can also change the grav constant in a bigger time step since this changes slowly. Star citizen space craft change the mass negligibly with fuel burned so dv/dt = F/m is good enough. (vs the change in momentum form of F=ma when mass is changing rapidly.) The more I think about this the more I conclude for multiple planets there are only a few constants that control such a simulation: atmospheric density, atmospheric viscosity (if we model Reynolds effects) planet mass, planet radius .............
also long ago i accurately derived models for earths atmosphere with the ideal gas law. Temperature is directly proportional to the altitude but the constant of proportionality changes three times on earth. (where temp decreases, does not change or increases linearly with altitude). at these altitudes we can make a simple density function where density = Ka + Kb log (altitude) and the K's change where the temperature function K's changed. (the density funtion i derived long ago so my memory could be incorrect but it is a simple function based on a few constants). Or we can density tables. Either way A/C fly the same in any atmosphere based on a few constants for the purpose of a flight/space sim.
Also you did not touch on this but we need to calculate the Moment of Inertia matrices for our Rotations. One other thing is I have read a lot on doing the rotations with quaternions not Euler angles. We can convert the state quaternions back to Euler angles, latitude, longitude and altitude at a slower time step (3 to 5 times a sec) for our instrumentation on the aircraft. I think Unity and UE5 support quaternion based rotations. If they are doing this properly those engines should be using the SSE matrix instructions & multiple cores to do this efficiently.
The problem with a non physics based simulation is it based on game design decisions on the flight algorithm. Any time one changes anything every thing can blow up. If it is based on physics the only errors we should get are numerical tuning.
Again great video, you condensed a bunch of aerodynamics into stuff a lay person can understand.
EDIT: I looked up alpha and beta definitions and I had it slightly backwards on which is defined 1st alpha or Beta. The correct definition is Tan(alpha) = u/w and Sin(Beta) = v/Velocity, where u v w are is the Velocity vector in aircraft coordinates. See control.asu.edu/Classes/MMAE441/Aircraft/441Lecture2.pdf. Also the relation for density as function is altitude is something I derived over 10 years ago. Other things to add are ground effects which removes drag due to lift and increases lift. I think there is an approximation for when this is applied and it is at x wingspans above the ground. A quick google search found www.faa.gov/regulations_policies/handbooks_manuals/aviation/phak/media/07_phak_ch5.pdf as a guide for ground effects although the discussion was quantitively. Some thing in my memory wants to use 2 wings spans as an approximation.... but something way back in my memory. Also I looked at your github page and saw the unity engine is handling the Rotational Inertia. I also saw you said drag was 50% high so you added 50% thrust. I was wondering if the way the simulation used predicted_force_update to add 50% force at a smaller time step contributed to this. I have not seen the code but maybe approximate normalizing the predicted would fix this. I would expect your forces to lower than real life because you may not have modeled all fuselage drag. Parasitic drag also was omitted which in aircraft drag book keeping there is both drag due to lift and the remaining drag is parasitic drag which is independent of angle of attack or sideslip. it is basically the drag due to skin friction alone. Again Great Video and it was nice to see you backed up your video with some actual code on github.
Thanks a bunch. I've been working on a bird "simulator" game and I've spent ages trying to figure out how to solve the jittering at low FPS
TH-cam is now recommending your channel but it looks abandoned, this makes me really sad, you explain things really well without going into unnecessary details!
im confused, you produce such quality content and you only have 150 subs 0.0
I have no doubt that you're channel will blow up soon to the position it deserves to be !
Then you should share this video on your social media channels. Make an impact, not bragging over subs counter.
As a fan of Ace Combat and of flight sims, and as a programmer who really likes Unity, this video is a gold mine. It does seem that something is wrong with your repository though, it simply redirects me to an error page. Not that it matters, I should be writing my own code anyways.
Edit : Nevermind that part about the error page, all of Github is doing that today. I can't even access my own code!
Bro... You made me sub in 2 minutes of this video. Looking forward to seeing your other posts!
This video is way too good for 17k views. I really hope more people see it!
If you "hope more people see it" why don't you share it on facebook and other social media?
Love your work man. The documentation of the process in making it is so fascinating
And bam. Warthunder.
Imagine the computing power needed for a true to real life aerodynamics sim to work. Simulating each air molecule
Nice, is that some geometric algebra I spy in there? Great video! Hope to see more :)
Thank you very much for this tutorial!
The thing that got me the most interested though is how did you make those white trails on the tip of the wings? I cannot get anywhere close to similar results
Anybody knows??
I'm assuming he's just using vfx. You can create a ribbon and spawn it at the desired location and then it follows the plane.
SUCH AN UNDERRATED CHANNEL!
Very good quality, learn a lot of things
Maybe for next video do it for car physics as a sim-arcade style
I'll admit that for years I'm trying to find some sort of tutorial for this, since I write in Unity as a hobby. It was very thorough, and you managed to compress it to a 12 minutes beautiful video.
My intention is even a lot more simpler, and I'm trying to create a 2D flight game.
Do you have any tips on how can I take this project towards the 2D direction?
I think for a 2D game you'll be better off with unrealistic arcade contoller that suits your gameplay. For example you can model the airplane as a single piece with lift and drag angle of attack curves tuned by hand, or don't bother with forces at all. Either way my code won't help much, but the general principles laid down in the video might!
@@JumpTrajectory Would this work for fighter jets?
Amazing Video, Really needed something like this but can you follow up on the reynolds number and mach number part, as I am near a complete loss on that section.
This is so nice and well explained
Thanks a lot
Excellent presentation and information.
Flight games that I've played that have Respectable physics are:
Airforce Delta series/Aero WingsSeries/ AceCombat 3, 04, X and 06 respectively, War Thunder,
flight Apps for Mobile: Simple Planes, Carrier Landings HD !
These are some that have Sensible feel of Flight Physics
You did a great job, loved your content!!!
Great video and super helpful!
Wow! Great video.
Thank you very much!
I have not tried it yet but I feel like the starting formulas are enough for my game, and for finding the area in contact, I will just make a raycast that turns according to the planes velocity (in front facing toward the wing, kinda like this
------RAY--->
------RAY--->
------RAY--->
I will make many rays going up and I will find how many of them hit the wing, then I will just multiply (Amount of rays hit) into wing length
Hope others who wanna avoid that formula use this 🤣
and great video, the amount of knowledge, watching yt aerodynamics vids, reading unity documentations, not touching grass....
so so so many problems with this that you won’t know until you start coding a system
@@2kDVI 3-4 iterations over the past year, got something pretty similar to war thunder now :)
So this is where it all started, attempting to make semi-realistic airplane physics was my second project ever 💀
ofc I took breaks and worked on other projects but as a guy who loved planes this was always on the top of my head until I got something that satisfied me 2 months back
@@mrpotato8196 same i’ve been trying to make aircraft physics for the last 2 months and i finally succeeded
i’ve made like 8 iterations
This is a great video and has a really nice explanation.
But are you ever gonna update the project to be able to incorporate spanwise flow so that you could have delta wings as an example.
This is what i'm looking for very informatif!
do i study airplane physics right now? im just searching for a way to implement great airplane physics for a game and wasnt looking for to study it haha, but its a great video with lots of information. keep going!
I would really like to see the final equation for Cd and Cl, that also takes Mach into account.
Have you ever thought about doing a video on rotary wing aircraft physics?
It would be nice to see the next video you are talking about at 4:45
Excellent Job!
my erudition is in audio rate modeling, i was surprised by the use of position delta as velocity in the XPBD method, if that's not common in physics sim (best explained in the video "09 Getting ready to simulate the world with XPBD"), might work better that way, or just oversample 128x :)
thanks for the concise, focused presentation!! :O
This is my favorite youtube video
I wish I'd known about this sooner! Would have been great for when I was trying to make flying physics for this game I'm on. What about rotor wings? Helicopters, I mean.
What an absolute gem
This is exactly what I was looking for. You have an excellent method of explaining concepts. Question: Is your approach flexible enough to apply to cars? Hmm... I guess cars themselves kind of act as one big airfoil, ideally not producing lift, and if they do, toss a spoiler on the back. Essentially, I'm trying to achieve a good "feel" for when my car launches into the air. Currently, it just kinda spins about as if it's in a vacuum which feels "off."
I don't see why not. Your approach sounds like it could work. But unless you are giving the player some sort of input to change orientation or angle of attack then I don't see the benefit of dedicating so much time to a feature that probably won't make much of an impact on the end-product? Maybe just hand-tune some fake "drag" forces depending on the angle of attack of the car, taking into account only air speed. That's what I would do if arcade physics would suffice.
@@phxcppdvlazi Ha, I am in fact allowing the players to manipulate their cars mid-air. My problem is I can't give them too much control, otherwise they can just cancel out any tumbling effects immediately, but too little control has the opposite problem. I figured air physics would help me find a middle ground. And yeah, you're right, it is arcade style and simpler is better.
Sometimes it's hard to tell if I'm doing something because it benefits the game or it's just the excuse I use to indulge in yet another learning experiment. In this case, it turned out to be another learning experiment, haha.
cars usually produce some down lift
Very good insight!
I'm making a bird flight simulator, and I ended up using a very similar approach to you before I even saw the video! I've been experiencing the dreaded jitter like at 8:54 if I maneuver too fast, and I think the substep is a super elegant solution.
However, my wing is broken into a lot of thin segments (around 20 per side), so I'm worried that recalculating the forces on each one will tank the performance. I guess the only way to find out is to benchmark it. If that turns out to be unfeasible, do you know of any other ways I can prevent it from jittering?
Hippity hoppity you code is now my property
Hello, I wish I learned that sooner. Finding the right coefficients was quite a hard task... Also well done with your solution to fixeddeltatime. There's still a lot to cover, things like aircraft controls, I tried a war thunder style mouse tracker using pid's, it's still very unstable even after a year of work. You should try to cover the engine propeller topic, which is far from intuitive but worth the time
Yeah, it would be nice to add propeller simulation. I'm most interested in propwash, but the engine stuff is also very interesting.
i have made this work in vr, you should upload more
Please do a followup video on Reynolds number ! I still struggle to understand this ^^;
you completely glanced over torque at 2:35
Thank you for this👍
Thanks!!! You are the best!
Damn you're like even a step above braintruffle in presentation!
Very nice!
Great job 👌
Why Are You So Smart You Made My Head Hurt!!!!!!!!
This is sabastian league level stuff. Im trying to make a controller for a game and for me this is confusing as hell. nice vid though. maybe one day i'll understand you haha
This video is great! Thanks for putting it all together! I am curious... what software are You using for making these math animations?
In this video I used manim github.com/ManimCommunity/manim
Congratulations. You've made the aviation part of War Thunder.
Hey, I have a problem where It's really hard to balance all the surfaces to actually get the plane to take off and fly normaly, also if it works and I turn the game starts acting weird like with the turning.
im getting a bug where the vehicle starts to jitter if I do a banking turn at high speeds. The jitter continues even if you stop the plane.
Another cheap approach to stabilising the forces - filter them. In Aircrafts it is rather uncommon for the forces to rapidly change within a tenth of a second so it is fine to assume the forces acting on the airframe at this frame are similar to the forces of the last frame.
That can be as simple as storing the calculated forces, and every frame adding the newly calculated one and then dividing by 2. Cheap, simple, can give amazing results with nearly 0 memory and computational cost.
What if my game includes the player being able to attempt flight with an arbitrary triangle mesh?
This is fucking gorgeous
The only question in the video you only cover a propeller being what cause the forwarded movement. What would change if it was a jet plane out side of the forwarded movement being in the back of the plane then the front?
As I say in the video, I didn't really try to model thrust source, be that propeller or jet engine. I just applied a force directed forwerd to the rigidbody. So for a model this simple there is no difference.
@@JumpTrajectory I was just wondering because I'm trying to make a system that works in space like Star Wars as a example.
@@Irategamefan well in theory it would work some what different in space due to the gravaty and wind and air displacement differance from on planet and space
@@Irategamefan Well, a semi-realistic airplane aerodynamics simulator is not a right call for Star Wars spaceship movement.
hello, could you teach how to put the cessna172 instrument panel like the flyght simulator? and how to configure a new plane as a boing for example?
Muraski po kozhe from outro
does the propeller also uses Calculate Aerodynamics Force
I have a question, at 7:59 the angle of attack calculated is in radians. Why do we not convert it to degrees? Don't lift coefficients use the angle in degrees for calculations? I would like to understand why. Thank you.
hey quick question sir how do i get the example cessna scene?
Superb
Anyone know a more step by step tutorial? I've been looking at your video, and while it's given me a good starting point, I still don't really get how to implement it :(
th-cam.com/video/e91QA4WfL5Q/w-d-xo.html
This video shows how to implement a simple plane and explains the main parts of the code.
Careful though, the source code he gives has been updated but the principles explained are still the same.
What does BiVector3 do?
Naisu.
Hello, I loved your project, it will help me in my studies, today I play fsx steam edition and I loved the cessna 172, rs, let me ask, is there a way to generate maps, based on google maps, google earth, and join this project? if so, could you teach?
Assuming this is proper realistic which it seems to be, could this work with helicopters as well seeing airfoil physics are the same? Or would i have to make adjustments since the speed of the airfoil is based on its own rotational speed and not just the speed of the vehicle?
Very late reply, but in theory it should work, provided that you account for the motion of the rotor blades and other adjustments. It might have issues in certain cases however, and you can probably get a more realistic result with fewer calculations (e.g. by utilising the symmetry of the blades). Helicopters are more strongly affected by the displacement of air that they themselves create, especially when hovering near the ground for example.
@@Hwyadylaw hmm, fair enough, i think i need to find a good middle ground, i can prolly adjust the lift calculatiom by just simplifying to the movement of the helicopter + rotation of the rotor disk
A fantastic video and accompanying source code. So helpful! Thank you. I' going to look at converting this to Godot 4. Unless someone else has already done the work?
I know you might not see this comment, but would you be able to do something like this for in UE5? If not could you maybe point me towards some help to reproduce this in UE5? I'm still new and coding isn't my forte but im learning, slowly.
Thank you.
Did you use 3BLUE1BROWN python library??
Yep
How to make fun and engaging aircraft game, realistic physics, exagerated plane performance
Amazing video !
Do you think that this script can be tweaked to be use in a power kite simulation ?
I am not familiar with power kite physics but I think that to an extent it can.