Search Unity

Physics [RELEASED] Silantro Flight Simulator

Discussion in 'Tools In Progress' started by Oyedoyin1, Mar 20, 2018.

?

Which is better in terms of "user-friendliness" and "performance"

Poll closed Aug 13, 2018.
  1. 1 giant script

    0 vote(s)
    0.0%
  2. Multiple smaller scripts

    15 vote(s)
    100.0%
  1. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    Hello,

    There really isn't anything in the system configured to "only work" with a specific type of renderer. I tried to make the graphics/rendering side of things as basic as possible (That's why there isn't a special environment or something like that...just simple planes and cubes)

    Another reason I did this is being able to move between Unity versions as much as possible, I write most of the code in Unity 2019.3 but I still have some aircraft samples bound to Unity 2017...so I can just copy in the new code and fly the samples without having to worry about graphics compatibility :)

    The end-user is free to determine which direction they want to take the visual aspect, the demo meshes also use the standard renderer materials which can be easily upgraded to a more complex render system if need be.

    The only thing that might have issues with renderer upgrades is the engine smoke effect, which is a simple particle effect that can either be removed or replaced with one suited for the selected renderer
     
  2. NathanJeeves

    NathanJeeves

    Joined:
    Jul 6, 2015
    Posts:
    27
    Hi there,
    In your example scenes I get this issue:


    BoxColliders does not support negative scale or size.
    The effective box size has been forced positive and is likely to give unexpected collision geometry

    I dont know what to do about this. I am using Unity 2021.12.f
     
  3. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    You can ignore it for the meantime.

    I use the sign of the transform X axis to determine its position, if it's positive then it's on the right side while negative is left.

    This is important to determine how the control surfaces are meant to rotate without having the user worry about it. The only side effect is that warning because under standard conditions, you're not supposed to have a negative scale in Math.

    So Unity gets the Abs scale value but keeps the individual signed variables... Which is a win win for everybody.

    I have a Dot product based solution, but I'm probably going to write a new model anyways.
     
  4. NathanJeeves

    NathanJeeves

    Joined:
    Jul 6, 2015
    Posts:
    27
    That would be fine but the helicopter doesnt take off it just shakes on the ground. This is in all the example scenes
     
  5. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    Wow, that's a very specific problem. Can you send a short video to my email?
     
  6. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    I NEED!!! the "Repsol plane" of the video with the physics.

    :(;)
     
    Oyedoyin1 and Erisbv like this.
  7. Abdulmajeed01

    Abdulmajeed01

    Joined:
    Aug 11, 2020
    Posts:
    19
    Hi
    How to use controllers in mobile?
    "MobileAircraftControls" does not have Engine on/off button as in Android demo.
    Thank you
     
  8. Supergrubman

    Supergrubman

    Joined:
    Jan 2, 2014
    Posts:
    20
    Is the VR version included in the Package or do I need to email you to get it?
     
  9. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    Hi,

    You just have to change the input mode to "Mobile" or "Custom" on the controller body


    Then use a custom script to send your mobile inputs to the aircraft. I've attached a sample custom script you can experiment with.
    You can call functions such as "Engine On/Off" etc as normal button functions from the aircraft body e.g



    You can email me if you have other questions
     
  10. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    I think I just got your email (similar question), please send an email if you haven't
     
  11. TheGamery

    TheGamery

    Joined:
    Oct 14, 2013
    Posts:
    94
    Using Unity 2021.2.4f1, none of the controls work, getting this error in play mode:

    Code (CSharp):
    1. Input needs to be configured. Go to Oyedoyin/Miscellaneous/Setup Input
    2. UnityEngine.Debug:LogError (object)
    3. SilantroController:CheckInputCofig (bool) (at Assets/Silantro Simulator/Fixed Wing/Scripts/Core/SilantroController.cs:718)
    4. SilantroController:InitializeAircraft () (at Assets/Silantro Simulator/Fixed Wing/Scripts/Core/SilantroController.cs:307)
    5. SilantroController:Start () (at Assets/Silantro Simulator/Fixed Wing/Scripts/Core/SilantroController.cs:183)
    After pressing Setup Input option I get:

    Code (CSharp):
    1. Failed to apply input manager bindings.
    2. UnityEngine.Debug:LogError (object)
    3. InputEditor:InitializeQuick () (at Assets/Silantro Simulator/Fixed Wing/Scripts/Editor/Input/InputEditor.cs:72)
    4.  
    If 2021.2 isn't supported yet do you recommend a particular version of Unity that's fully compatible?
     
  12. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    The issue has been fixed in v3.0.3.1

     
    Last edited: Dec 11, 2021
    TheGamery likes this.
  13. cloakedunity

    cloakedunity

    Joined:
    May 3, 2017
    Posts:
    4
    One minor issue:
    SilantroGearSystem.cs, line 427:
    Code (CSharp):
    1. if (wheelSystem[0].collider != null && wheelSystem[1].collider != null && groundRoll != null)
    It is hardcoded to use two wheels. However, there are airplanes that have only one gear (some gliders for instance). Any chance to check for an index out of bound before throwing an exception?

    Also, how do you avoid any errors occuring when not using any armament? I.e., the following line throws when pressing 'Q' or 'E' (Yaw):

    SilantroArmament.cs, line 76:
    Code (CSharp):
    1. currentWeapon = availableWeapons[selectedWeapon];
    Is there any way to turn off armament completely?
     
  14. cloakedunity

    cloakedunity

    Joined:
    May 3, 2017
    Posts:
    4
    Another thing I would like to ask: How do you increase the responsiveness of the input system? I am struggling at making quick turns in a flight. It affects all surfaces (ailerons, rudder, stabilizer), at least on a keyboard.

    A quick example of what I am facing. This shows the left aileron from behind. It includes two issues

    1) I first bank right, then release the key. I expect the aileron to go back to its original position much quicker (at least same speed as forward). The same is repeated for the other side
    2) At 17 seconds I bank right then quickly bank left. The aileron first goes back into its original position before going to the other side. I expected this to be much smoother and quicker. It just feels wrong in-flight. It should be only one motion, from down directly to up, not stopping in the center.

    Notice this is not a fly-by-wire aircraft, so inputs should feel much more direct.
     
    Last edited: Dec 31, 2021
  15. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    Wow, I completely forgot about single wheel gliders. '

    But the only place where that check is performed is when the wheel contact sound needs to be played.
    1. You can either remove it altogether
    or
    2. Remove the "wheelSystem[1]" variable.

    For the weapons stuff, you can just delete the "hardpoints" (or whatever game object the Armament script is attached to) completely.
    The weapons system is not a core function/component.
     
  16. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    Yes, you can do this from the Edit/Project Settings/Input Manager

    Scroll down to the keyboard axes section


    Expand the dropdown for the key you want to set


    You want to change these two properties
    1. Gravity: This is a measure of how fast the input value goes back to the default position i.e 0. So a higher value means the surface will "snap" back quicker when you release the key.

    2. Sensitivity: This is a measure of how fast the input value goes to the maximum position i.e 1 to -1, higher means you move to the maximum faster.

    You can also adjust the actuation speed of the surface from its editor, this is for better finetuning when you get your inputs right
     
  17. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    Environment VR Test



     
  18. cloakedunity

    cloakedunity

    Joined:
    May 3, 2017
    Posts:
    4
    Awesome, thank you for your help! And I wish you a happy new year :)
     
    Oyedoyin1 likes this.
  19. jensklein1

    jensklein1

    Joined:
    Jan 11, 2022
    Posts:
    12
    Hi Oyedoyin - do any of the rotary dials or knobs in the cockpit function? Like to program the autopilot for example? Also, do you have VR sample scenes you provide to users? I’m just asking up-front because I’m purchasing your asset next week. Thank you!
     
  20. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    Yes, you can configure the dials and buttons to display/command what you want. They both have dedicated components to set them up. No knobs yet tho.

    1. Dial

    2. Button


    The demo projects are also available, just send me a request email to get either or both of them
    1. Steam:

    2. Oculus:
     
  21. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    I hope I get enough replies on this :D

    Anyone tried out the HP reverb 2 in Unity?
     
  22. jensklein1

    jensklein1

    Joined:
    Jan 11, 2022
    Posts:
    12
    Awesome — I did sent you an email today - and. We did purchase the asset today too:). I’ll be writing a review on the asset store by end of week. Really nice work:)
     
    Oyedoyin1 likes this.
  23. jensklein1

    jensklein1

    Joined:
    Jan 11, 2022
    Posts:
    12
  24. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    v3.5 WIP: Advanced Wing design:

    You will now be able to configure each subdivision (now cell) of the aerofoil individually and make more complex wing shapes and designs
    Properties like the taper, span, dihedral and sweep of the cell can be adjusted








    You can also adjust the shape of each cell control to make it fit better and be more accurate



     
    EgonSpenglerFP likes this.
  25. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    v3.5 WIP: SAS Tests



    You can enable rate, attitude and attitude rate controls on each axis. The logic has also been simplified to use proportional gains with basic filters, this will only require singular gain values and time constant.

    Pitch Axis


    Roll Axis
     
  26. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    v3.5 WIP: Lateral Autopilot Test



    You can now select between Attitude (Bank) hold, Turn Rate Hold, Heading Hold and Turn Radius hold modes.

    Once the core rate PID controller is properly tuned, you can use single variable proportional controllers for the outer layer controllers



     
  27. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    v3.5 WIP: VR Controls Test



    The core VR inputs and controls will now be processed with OpenXR integration
     
    seansteezy and EgonSpenglerFP like this.
  28. blacksun666

    blacksun666

    Joined:
    Dec 17, 2015
    Posts:
    214
    "You will now be able to configure each subdivision (now cell) of the aerofoil individually and make more complex wing shapes and designs
    Properties like the taper, span, dihedral and sweep of the cell can be adjusted"

    Is it possible to change these in realtime at runtime?
     
  29. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    Not by default and I'm not sure it will later.

    With the old system, each aerofoil has to be redrawn from scratch every time step which was very unnecessary and performance intensive (you can even see the spikes in deep profiler)

    Now, what I do is draw the aerofoil on start and store the 4 cardinal points of each cell as local vectors. Then each timestep, convert the points to world positions and use them for the required calculations.
    Instead of performing 80+ vector analysis, now it's just 4 per step.

    You can add the AnalyseCell function into the fixed update loop to recalculate the shape, but is it really worth it?
     
  30. blacksun666

    blacksun666

    Joined:
    Dec 17, 2015
    Posts:
    214
    I was just wondering if this could be used for non-rigid wings. Ideally you'd want to change the airfoil shape of the flexible wing too, but was hoping to get close by changing the twist, taper, span, dihedral and sweep of each cell.
    A couple of examples spring to mind, glider wings flexing under lift, hang glider wings, bird wings and paragliders.
     
    Oyedoyin1 likes this.
  31. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
  32. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
  33. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    v3.5 WIP: Advanced Wing design:




    Cell Sample

     
    EgonSpenglerFP likes this.
  34. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    v3.5 WIP: Updated Documentation

     
    EgonSpenglerFP likes this.
  35. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    v3.5 WIP: Integrated Floating Origin solution

     
    EgonSpenglerFP likes this.
  36. Ward101

    Ward101

    Joined:
    Mar 22, 2016
    Posts:
    52
    Hi! I found this great product Asset by chance ... I´ll try it soon.
    I don´t have a Reverb, but will test it (for fixed wings and helos) on Quest2, Vive Pro 2 and on Varjo XR-3.
    We tested the them on MS2020 and X-Plane 11. By far the Varjo gave an unbelievable experience for flight sims.
    We were looking to integrate a flight engine on Unity (for our own developments).
    Will give you feedback soon.

    Any estimate for v3.5 release?

    Thanks!
    Eduardo
     
    EgonSpenglerFP likes this.
  37. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    Soon :)

    I should be done with the beta this week, just have to finish the VR components and test them tomorrow.
     
    EgonSpenglerFP and Ward101 like this.
  38. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
  39. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
  40. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    Helicopter Autopilot Demo showing Heading, Speed and Altitude hold with climb rate limiter

     
  41. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    If you have either or both of the assets and you want to beta test the update over the next week, please send me an email.
     
    EgonSpenglerFP likes this.
  42. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
  43. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
  44. Stormwynd

    Stormwynd

    Joined:
    Mar 29, 2022
    Posts:
    4
    Did setup change in 3.5, because I do not have a "Oyedoyin/Fixed Wing/Miscellaneous/Setup Input" path.

    There is a "Setup Input" under Common, but it doesnt appear to do anything.
     
  45. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    Yes, I've consolidated the scripts that are shared between the assets into the "Common" namespace. So things like input setup, base controls, core e.t.c are all under that namespace.

    The notification you'll get when the input is configured will be under info logs and you might have that muted, you can go to Window/General/Console (or Ctrl + Shift + C) after clicking the Setup Input option to find the message.

    You can also go to Edit/Project Setting/Input Manager to see the newly created input keys.

    Sidenote to everyone, new setup tutorials and the first patch with VR demos coming next week :D
     
    EgonSpenglerFP likes this.
  46. Stormwynd

    Stormwynd

    Joined:
    Mar 29, 2022
    Posts:
    4
    Thanks! I had checked Input manager but I didn't see the min menu under "Axes", my eyesight isnt what it used to be.
     
    Oyedoyin1 likes this.
  47. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    New Tutorials









     
  48. Abdulmajeed01

    Abdulmajeed01

    Joined:
    Aug 11, 2020
    Posts:
    19
    Hi,
    I use the demo scenes, and when I change the plane position and start the game it will return to the original position, is there something like fix point? How to disable it and choose the desired position?

    In a previous version I was able to choose any position to start.

    Thank you,
     
  49. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    Yes, the new Origin shift (baked in floating origin solution) is turned on by default. It's to help prevent distortion and shaking when you cover large distances.

    If you scroll down on the controller component you find the switch to disable it.
     
  50. Oyedoyin1

    Oyedoyin1

    Joined:
    Oct 30, 2016
    Posts:
    915
    VR demos are now available

    Tutorials on how to set them up
    1:

    2.
     
    dmenefee likes this.