top of page
Search

Week 6: Fixes and a Change of Plans

  • Writer: Trevor Pierre
    Trevor Pierre
  • Jun 29, 2022
  • 3 min read


Last week I worked on implementing a few different warning systems and well as a stalling state. After receiving some feedback on a few of last week’s additions, I’ve went back and reworked a number of things, along with deciding to pivot from my original schedule. This week I ended up doing the following:


· Convert debug messages to proper HUD

· Finish TCAS

· Fix Stall

· Convert controls to use Delta-Time


The first and probably what took the most amount of time, was converting my debug messages. I find creating UI to be super tedious, but it was necessary for this project. It’s still not completely finished yet but I’ve done almost all the warnings and basic data. Here is an example showing them off:






And Here's what the layout looks like:





With the UI there seems to be a few bugs, one of the biggest being that whenever I add a new variable that gets exposed to Blueprints, my speed variable won’t be recognized by the editor, and it needs a complete rebuild of the code and reboot of the editor to fix it.


The next thing (and surprisingly the easiest) was finishing the implementation of TCAS (Traffic Collision Avoidance System). Once the sphere trace I have on my plane hits another “plane” object, my plane just does a calculation how far it is from the other “plane’s” origin and determine if it should show the climb or descend warning. Below is an example of both:








The most challenging part of this week’s work was reworking the stall and the control conversions. I got some feedback on both of these, so I thought it be best to fix them now, then sit on it for too long. The stall shown last week was pretty drastic and unrealistic, and the user inputs didn’t consider delta time, so they were all frame based.


The issue with the stall is how I calculate and apply lift to the plane. I use Lifting Line Theory to calculate the Lift Coefficient for the plane, but this formula doesn’t consider angles that go past the critical angle of attack (12-15 degrees). After generating this value then calculating lift, I apply the lift using Unreal’s AddForce() Method. The issue with that the application of that AddForce is that it isn’t applied in a vacuum, there’s still the effects of the other AddForces there that compound. So just setting the lift coefficient to 0 or adding a very small amount of lift to the plane won’t really work, and just inverting the lift, like last time, wouldn’t be realistic. So, after tinkering with it, I think I’ve developed a better version, though there’s always room for improvement.


The first thing I do if, and only once the stall starts is to reset the linear and angular velocities that are generated from the plane(This causes a noticeable pause that will be fixed in the future), then once that's done the Lift Coefficient is a fraction of its original calculation at that angle. But if our plane goes to max throttle it's still able to generate enough total lift the fly the plane. As the weeks go on, I'll keep iterating on this.


Here is an example of this new version:





Next was tackling including Delta Time, adding it to the movement calculations was easy, but I had to do an insane amount of tweaking to make it feel right. Here is the code showing that and a quick clip since it might be hard to notice the change:









Finally, the last thing I started working was a recommendation to include the simulation of wind!! Right now, it’s in a very early stage and not super accurate. So far, I’ve created this collision box that applies an editable wind force and direction to the plane.





Right now, the UI does change in response to this, though it’s not super accurate. Below is an example, with a super high force of wind to give a better visual effect:





This is still in its early stages of development, but I thought it would be cool to show off!!


I mentioned earlier that I decided to pivot from my original schedule. Basically, seeing that my time could be better utilized elsewhere, I’ve decided to cut the Instrument landing system completely as well as the flight maneuvers. That time will now be dedicated to finishing up some more of the 6 Pack UI as well as implemented more real-world things such as the previous mentioned wind, and change atmospheric pressure (I use a constant right now). Below is my revised schedule:





Next week I’ll have more updates on my Wind Implementation as well a refined version the stalling!!

 
 
 

Comments


bottom of page