Man, this is super cool! I never thought about the unrealistic physics in other video games, and I respect the time and effort you've taken to create this passion project Definitely looking forward to your next upload!
@supm8te751 Жыл бұрын
your passion burns throughout the whole video. Im making a mech game that involves air combat(might extend to space battles) and fighter jet target systems and your in depth explaination really helps me understand more about the essence these games strive to recreate, thank you and subscribed.
@NDSno1 Жыл бұрын
I;m amazed by the amount of effort you put in the presentation to explain the physics in detail, which non other video on KZbin about flight physics for game dev has done. Great job. You deserve a lot more sub and view
@TheNerd4842 жыл бұрын
17:06 The reason you use the cross product is because the g vector is perpendicular to both the velocity vector of the aircraft and the rotation vector of the turn that craft is making. Due to the fact that the rotation vector is always perpendicular to the velocity vector in most maneuvers, the magnitude of the g load is equal to the product of the magnitudes of the velocity and rotation vectors, hence why the math works out like that. I hope that makes sense
@picklechin2716 Жыл бұрын
You call me nerdy for playing dcs, yet here you are coding.
@amaranth61743 ай бұрын
@@KZbinrUser000 most of the time yes... do people apply themselves to get into that 'career field'?, nope
@trod1465 күн бұрын
Way to hear what you want and make up things no one said. He said DCS is too nerdy for what he's looking for in a game. If you feel like that makes you yourself a nerd, that's on you and no one is calling you a nerd for playing DCS but you.
@dkkavanagh173 күн бұрын
@@trod146it’s a joke
@claxvii177th62 жыл бұрын
THE PHYSICS SUBSTEP IS GENIUS!!! SOLVED MY PROBLEM ON A INDIVIDUAL SURFACE SIMUATION!
@itodobien13963 ай бұрын
Wow... I was just looking for a cool HUD for a learning project I am doing... Ended up getting a class in flight physics... Amazing work and even more amazing you shared it all with everyone. Thank you
@RyanLee-up9ej Жыл бұрын
This is so easy to follow. You did a great job keeping the material clear and concise. Great work!
@dreamisover98132 жыл бұрын
Found this from reddit. Your tutorial blog posts are awesome!
@sdsdfdu4437 Жыл бұрын
This is incredible. Thank you so much for releasing the source code
@OmPuter2 жыл бұрын
you are my professor.... idk why you did this and made it open source, bravo! many many respect!
@yah31362 жыл бұрын
Thank you so much for such detailed but clear presentation.
@M4ssExtinction Жыл бұрын
As a game developer I'm impressed on how you did this!
@cgpilk2 жыл бұрын
Awesome! So well explained, thanks!
@fuzzybloodpc9291 Жыл бұрын
20:54 Average Delta wing
@AlgorithmicHearts Жыл бұрын
One thing Ive been looking in flight sims is the feature to create dynamic campaigns. Sure having a good model is the main thing but what you need it for is also important
@sayochikun32882 жыл бұрын
Visuals are very helpful and quick. Nice
@EeveeMae Жыл бұрын
Thank you man, I have been trying to make a flying simulator for so long, this tutorial is so helpful.
@narvi22 жыл бұрын
Great video! Looking forward for the next part.
@lukarausch79072 жыл бұрын
Loved the video. You have big potential boy
@jagc37632 жыл бұрын
I'm amazed! Thank you for this piece of art!
@imDanoush Жыл бұрын
Very interesting introductory video with awesome animations! gg.
@baxterclagmoar93334 ай бұрын
This is one of the best resources - however, after following the tutorial and spending hours looking through the source code, I cannot figure out how the inputs are actually called. I understand you're using the new unity input system, however, the two primary scripts "Plane" and "PlayerController" seem to never actually reference the function "OnRollPitchInput" or "SetThrottleInput" - am I missing something?
@galsmith2098 Жыл бұрын
Just found this series. Looks amazing! Can I program it to work with a keyboard and a mouse (like war thunder for example)? I don't have a lot of coding experience(only scratch), how hard will programing it like this be? Is there any chance you will make a short video about it?😬 Thanks!
@HarshitRana576 ай бұрын
amazing video, very well explained thank you for this
@GonziHere2 жыл бұрын
Firstly, absolutely great tutorial. Love it. I've calculated drag in the full formula way. It's easy, because you have several of those numbers as constants, so you can precalculate them (I did it on the paper, basically) and you'll have realistic calculation in the end. (the part of it is the drag area which has findable values of say 0.3 times the area, which you can calculate per axis). You can use real engine force, real drag coefficients, real lift values of a given plane and it will fly comparably... (as in, it's not a sim, but it kinda acts like one). My jet could achieve the real max speeds, climbs etc. with an error of a few percents without me tweaking anything. You are going the hand tweak route, which will need much more tweaking as compared to tweaking the "real" values a bit (from my experience).
@GonziHere2 жыл бұрын
Seeing your rotations - I was simulating it more realistically and then I've implemented Fly By Wire on top of it (player rolls, plane also pitches, so FBW compensates the pitch). You could try that, it was a fun thing to try to implement and I've personally enjoyed the end result, where the plane can be twitchy and self correcting. It was what made it feel "physical".
@akshatmaurya3964 Жыл бұрын
@@GonziHere how did you go about implementing Fly By Wire in unity? seems interesting to try
@brodakarat63402 жыл бұрын
I kinda wanna make all the forces apply at the appropriate positions instead of always at center of mass, the program a flight stability assist computer and this can be damaged by bullets or electrical failure
@jaybabcock9123 Жыл бұрын
best line of the whole video: "Dont ask me why, because I discovered it by accident"
@larrysouthern5098 Жыл бұрын
I've wanted to do this for a long time. THANKS 🐦
@larryneagu11802 жыл бұрын
This is one of the best approachings to putting together flight in unity. It's still slightly too realistic - at first - but it's an awesome way to build gameplay around flying skills. I've been playing with this for a few days now - I ran into a weird bug I cannot trace the source off. After a couple of seconds or more, I lose all lift in all surfaces - with gizmos visible I can see them just getting smaller fast and disappearing. I use the stock airfoils with reduced lift and drag for (75 and 35 respectively). This can be a very successful asset store template with minimal additions: 1) multiple targets, 2) rotor planes (biplane and mono) 3) slightly more arcade controls 4) sound support. I would be more than happy to provide whatever art you need to help you put this up on the asset store (or just upgrade the git project). edit - resetting the collision box on the plane to its original scale/values solved the problem.
@RUDERUDYTUTORIALS Жыл бұрын
This is really awesome tutorial video great work man.
@michaelalaku15362 жыл бұрын
thanks for the tutorial, it was really helpful. I am new to Unity3D and C# and I wish to learn more from you.
@vast6342 жыл бұрын
Very nice overview on the calculated forces and flight mechanics in general. Maybe you can add keyboard+mouse control to your demo too.
@chad-wyck4 ай бұрын
Really great video, makes me want to whip out an old compute shader I wrote that uses a low resolution transparent normal render (rendered from the current ortho perspective of the wind) for calculating the per pixel forces and torques. I decided I ultimately needed someone who really knew their planes and shit to have it match a traditionally aggregate simulated formula. Thoughts?
@TheBuccaneerIsHot3 ай бұрын
All you need to do is make the turn force depend on how much the control surfaces are deflected
@GabrielxC Жыл бұрын
How did you made the camera?
@r4c732 Жыл бұрын
Sheeesh, nice video man! Learned a lot from this, btw I have a question.. At low speeds the aircraft tends to preserve momentum from it's previous direction when turning, how do I prevent this from happening? I just can't seem to figure it out
@Vazgriz Жыл бұрын
That's intended behavior. At low speeds, the plane creates less lift, so when you turn, the velocity will take more time to align with the new direction you're facing
@BlackM3sh2 жыл бұрын
19:06 Absolute perfection!
@GonziHere2 жыл бұрын
Yeah, I've totally lost it there :D :D :D
@albertomodrono4320 Жыл бұрын
Great video. The result is stunning!! I have one little question. The definition angle of attack wouldnt be the angular difference between the velocity and the nose of the plane, instead of the angle between y and z components of velocity right away??
@MinhLuong10067 ай бұрын
Can you do tutorial videos about the tank you uploaded on KZbin?
@ARandomHumanBein Жыл бұрын
You should try out IL-2, it's a WW2 flight simulator that is basically in between War Thunder and DCS in terms of Complexity and Realism
@RogueBeatsARG8 ай бұрын
THIS IS WHAT I NEED, a More Realistic Physics, Ace Combat, people think doing Cobras on AC is fun but doing a Cobra in a more realistic game is satisfiying as fuck
@panickal6 ай бұрын
I can't figure out how to have cobra in it and also have realistic nose pulling dogfights
@ it is… but still, regarding physics and cobra maneuver game request…. This one is an option. Also, there is no harm in giving it a try (less than 1GB)
@ThE3ngineerАй бұрын
@@RogueBeatsARG Try DCS Su-27 Su-33 or Nuclear Option’s Ifrit or Revoker
@markaron93562 жыл бұрын
I like how the plane just turns into smoke
@ABaumstumpf Жыл бұрын
AceCombat and Project Wingman both have more involved physics than what you have shown here. They just have the weapons and AI configured to make it easy, but energy, stall, induced drag - they have all of that. I loved to play around the time of AC3-ACX and you could absolutely ignore tactics but if you do consider your mission target, the aircraft you have, its configuration and loadout and fly according it makes a big difference. Some aircrafts there had abysmal low speed acceleration and high induced drag for yaw. So if you keep some height, don't turn too hard and stay at cruise speed the aircraft feels a lot more nible and getting a solid lockon becomes way easier.
@karambiatosАй бұрын
Why did you decide to talk out of your ass? Neither of those games have drag or induced drag, or anything of the sort. They are more like cars that fly they use much simpler fake formulas to achieve things.
@-PilotClip-28 күн бұрын
how do I actually put the code together though?
@DjblackgameBlackgamers10 ай бұрын
I'm trying to remake this on UE5 but nothing works on UE someone can help?
@zantherhayes7229 Жыл бұрын
Over G fighters was a solid midline between sim and arcade
@AterNyctos6 ай бұрын
Simply amazing!
@RecHorrors Жыл бұрын
Thanks man! But my one problem is that none of the inputs work even when I plug in my controller
@justhanging2569 Жыл бұрын
Great video, commenting for the algorithm!
@FullMetal-Tech Жыл бұрын
Ah you don't know about the beloved flight sim series back in the days of DOS and win 98, the Jane's combat simulations series like USAF or Fighters anthology.
@Firebend119 ай бұрын
0:42 dcs also has insane storage space for my tiny ass laptop
@michalkmet8351 Жыл бұрын
1st sentence got me dieing - I like to play flight sims as Ace combat and project wingman 💀💀💀
@Firebend119 ай бұрын
8:32 how do you add specific keybinds for the throttle?
@ILLYRIANLEADER2 ай бұрын
where do i put the code...
@newsystem3667 Жыл бұрын
How did you avoid gimbal lock?
@fishercawkey Жыл бұрын
Superb work on this!
@MSPhysicsForFun Жыл бұрын
super great I will try in MSPhysics too.
@GreekRussian36710 ай бұрын
Im having the problem that I was going to change the input to mouse and keyboard, and I changed it all in the "PlayerInput", but it does not work, I tried to debug it but nothings working. Is it using a different input system? help.
@TheDreamFx2 жыл бұрын
Great Video! I think you could maybe have shortend the implimentation and formular derivation part. Since it think most of it is straight forward. Thanks for the nice project. I'm interested where it's headed :)
@daxylikecatz7050 Жыл бұрын
Bro... The flap are inverted normally if you want to create a up lift you make the flap point down
@bennguyen1313 Жыл бұрын
Would love to hear your thoughts on a 2D-game that re-creates a cockpit screen. For example, in the game DCS:AH-64D there is a weapons MPD (multi-purpose-display) where you can select missiles and code them for the target. The game would take user-input, update the screen, and issue a sound. Would Unity be the preferred tool?
@darkveneno61552 жыл бұрын
You can make it so that the pilot can endure higher G-Force for a short amount of time.
@ChucksSEADnDEAD2 жыл бұрын
You could get Rho based on player altitude by using the perfect gas law.
@badbeardbill9956 Жыл бұрын
Nah, you need both temperature and pressure for that. Can just use a lookup table or a basic scale height equation though
@panickal6 ай бұрын
What kind of settings are needed to have slow, realistic turning for scissors etc AND cobras and kvochur bell maneuvers? Edit: It seems the G limiter is what prevents a cobra maneuver, for which you need to get 90 AoA and keep altitude almost the same. Let's say G pitch limit is 10. The maneuver can't happen, you just turn upwards, seems to be the case at all speeds. But if the g limit was let's say 20, the Gs pulled in the cobra don't even reach 10. It's just that if the limit was 10 it wouldn't be allowed. Does that make sense?
@swastikdas9687 Жыл бұрын
how to download!!
@taktischesgenie3312 жыл бұрын
Hey if you like tiny combat arena you should check out Strike Fighters 2
@thoufiqjabbarsilton58936 ай бұрын
Can the code be used for the fbx extension?
@smollime1172 жыл бұрын
vert underrated
@bedirhansakaoglu87672 жыл бұрын
Hey man quick question, why did you multiply the local velocity on the y axis by negative one while calculating the angle of attack? Great work by the way!
@Vazgriz2 жыл бұрын
I wanted AngleOfAttack to be positive when the nose direction is "above" the velocity direction. If I just used the velocity.y component directly, the AOA would be opposite of what I wanted. This problem could also be solved by pulling the negative outside of the function ( -Mathf.Atan2(...) ). Basically, the math behind Atan2 would make the value negative, so I need to multiply by -1 somewhere
@generalindominus2722 Жыл бұрын
I dont understand why Utilities is without context but I don't see you declare it in the codes
@Vazgriz Жыл бұрын
The Utilities class is defined in Utilities.cs in the Github repo. It contains some math functions that are fairly simple and used in multiple places in the code.
@MrZtapp11 ай бұрын
Great tut, thanks.
@daxmiller267011 ай бұрын
is this able to translate to unreal engine ?
@epich30710 ай бұрын
where were this tutorial when I needed?
@TheOfficalCorrieR210 ай бұрын
@Vazgriz How do I land the plane? it keeps crashing.
@grangerhighschoolvirtualre70702 жыл бұрын
Awesome! Can you use the pc keyboard to play this in Unity?
@Vazgriz2 жыл бұрын
No. Only gamepad control is implemented. You can of course download the project and implement it yourself.
@larryneagu11802 жыл бұрын
I bought a controller just for this. The experience is so much better.
@tyen2231 Жыл бұрын
@@Vazgriz can you help me implement keyboard input
@higgzy80012 жыл бұрын
I got a problem, none of the controls work
@PC_YouTube_Channel2 жыл бұрын
I'm surprised you hand-tuned the coefficient of drag curve with AoA. It seems like it would be easier and more realistic to estimate the cross-sectional area of the plane with AoA (say, linearly interpolate between the nose-om area and the belly-on area) then you would just have to tune a single scalar and the dependence of AoA should be very realistic without any more calculations than you're already doing.
@Vazgriz2 жыл бұрын
The coefficient of drag uses an animation curve based on air speed. The Scale6 function does sort of blend between nose-on drag and belly-on drag. However it specifies the drag coefficient directly instead of calculating based on area. The game designer could do those calculations offline and simply plug in the numbers.
@yahiagaming7053 Жыл бұрын
The code is all red maybe it’s because I’m using C# I thought that was what you were using 😅
@yahiagaming7053 Жыл бұрын
and what coding language is this ❤
@a.s.b. Жыл бұрын
would you mind if i used code from this in a game i am making? it will be free if i post it anywhere.
@Vazgriz Жыл бұрын
The github repo is MIT licensed. So there are very few restrictions and I don't mind.
@CYON4D Жыл бұрын
Great work.
@Nurfishlol Жыл бұрын
Bro if left wing is going up its going to right but ur plane is left
@iamarugin2 жыл бұрын
The engine's name is Unity not Unity3d
@torusx85642 жыл бұрын
Thank you
@R1kyzzzz Жыл бұрын
Killer. Keep going bro
@pygarg267 ай бұрын
Amazing
@Aventis_Aerospace Жыл бұрын
Ive tried making my own jet and i copy the code and do what it said and theres a bunch of error messages, i think it needs a bunch of floats added to make it work but i still dont know what to add where. please could you make a follow up video walking us through every process
@skyblox-eo5se Жыл бұрын
Make a thrust Vectoring plane plzzz
@fearwade_Official Жыл бұрын
Is it possible to do this in unreal engine or is it only for unity?
@Vazgriz Жыл бұрын
All of the principles of flight can be translated to any game engine. The C# code cannot be used in Unreal of course.
@fearwade_Official Жыл бұрын
Oh that makes sense, Would you be able to make a tutorial like this on unreal engine Cause i dont know how to make a G Limiter like you did aswell as physics being made well@@Vazgriz
@naronga68572 жыл бұрын
Could this be expanded to a space sim kinda game? Having a seamless transition from space to atmosfere fligh, like kerbal or a more realistic star citizen? Or would this solution feel too arcady for a more simulation like game?
@bubchudlar5629 Жыл бұрын
I'm trying to follow along, but I can't figure out how to implement inputs for the throttle, which makes it impossible to test if the thrust and inertia stuff is working. What part of the github repository should I be looking in?
@warfrogsstudio11 ай бұрын
One downside though, I seem to be able to go straight up, and after around 3 minutes of climbing I'm still going at 85% of my max speed and it's not going any lower In reality you could not climb completely vertically for an infinite amount of time, you would lose a lot of velocity very fast
@sapphiregaming4360 Жыл бұрын
How did you make the animation curve for Cl vs alpha? Need a bit help with that. Please guide me with the steps.
@Vazgriz Жыл бұрын
I used airfoiltools.com to find the data for the F-15's wing (which is a symmetrical wing). Then I plotted the data in Excel.
@mrpotato819610 ай бұрын
The Scale6 function is a really nice idea, I can see myself using it for other things too :) *For those whose plane refuses to leave the ground:* My plane refused to get off the ground since aoa = 0 hence CL = 0 and lift = 0, so I had to add an angle of incidence (set by user in degrees, converted to radians) to the angle of attack, this will also make the simulation more realistic since most planes have their wings rotated slightly backwards This is a really nice video explaining angle of incidence: kzbin.info/www/bejne/d4bQfWujfrqrr8U
@blezzleSR20 Жыл бұрын
if you think of the grind as fun playime, not agonizing grinding, war thunder is quite fun
@joshuasteward667210 ай бұрын
When turning, shouldn't the nose of the craft experience a force pushing it back towards the direction of movement? Currently it seems as if when I nose up and then let off the controls, the nose "sticks" where I left it, whereas it seems as if other flight games model how air resistance exerts a force on the plane so that it turns back in the direction it is headed. I'm probably not explaining it super well, but I was wondering how to implement this in my own project.
@Vazgriz10 ай бұрын
You're right, there should be a force like that. That's the stability force that real planes experience. A simple way to model it is by applying a torque that multiplies with AOA. I did not include it in my simulation for simplicity. The way the plane behaves is like a plane with neutral stability (holds nose attitude). A more realistic behavior would be to have positive stability (nose pulled towards velocity vector).
@Daddyidkwhy Жыл бұрын
Hi the f15 does not show up for some reason i dont know why but can someone help me? And wich version is he using
@Vazgriz Жыл бұрын
You need to download the files using git LFS, otherwise the project will be corrupted. This project was made with Unity 2021.3.10f1
@Daddyidkwhy Жыл бұрын
@@Vazgriz Ok thanks
@Daddyidkwhy Жыл бұрын
@@Vazgriz Zip or Other thing
@reverse189510 ай бұрын
does this still work? I tried downloading the project but the prefabs dont work and same with the terrain
@Vazgriz10 ай бұрын
Did you download it with Git LFS?
@reverse189510 ай бұрын
@@Vazgriz no i didn't how do i do that edit: Nevermind i got it
@travisco132 жыл бұрын
I fell in love with you
@greggory7655 Жыл бұрын
Note: "AngleOfAttackYaw" is more professionally called Angle Of Slip. Hope this helps!