A new Flight Simulator

Talking about the core development, vent steam ... censoring free but no guarantee, "they" will listen.
Richard
Posts: 114
Joined: Sun Sep 11, 2016 5:57 pm

Re: A new Flight Simulator

Postby Richard » Thu Mar 01, 2018 12:37 pm

I'll try to give you an unbiased answer.

So firstly I'll answer your original points:

You're wrong that FG isn't designed in a future proof way; it's modular and well architected and parts can be replaced. I'd be interested to know what you specifically think isn't 'future proof'. The fact that FG can have 2 completely different rendering engines, many different FDM, be extended easily by XML etc.... Probably the biggest constraint in developing FG is retaining compatibility with all of the models that are already out there. Drop this as a requirement and some significant changes could be made, but well you'd have nothing to fly around in. This is pretty much the same problem that plagues any well established piece of software.

  1. Yup
  2. Modularity is essential; dynamic plugins (.so / .dll) are much more complicated; if anything adopting OpenRTI or Open-DIS is probably a better idea.
  3. Very hard to achieve. OSG is pretty good at what it does. There are other options but the demands of a FlightSim are quite often way in excess of your typical game engine. Needs to be decided first.
  4. Better to abstract the GUI completely away from the simulation engine and allow multiple front ends, such as http.
  5. This is the hardest one of the lot; probably I'd go with shapefiles - OSGEarth uses these to great effect; but the biggest single performance problem FG is WS2.0 and missing LOD. Any terrain engine must have LOD designed in from the start.
  6. Not worth wasting time on; OSG can load from lots of different model formats - so largely the choice of model format depends on the rendering framework (3)
  7. possibly; but not really important.
  8. Probably not as using JSON doesn't achieve much over XML, JSON is harder to reliably validate and not as easy to enter.
  9. As a DSL Nasal is pretty good at what it does. There are many options you could choose from, DCS uses LUA. Python could work. I'd probably go for C# embedded.
  10. This is a double edged sword. If from the outset you support import of JSBSim FG models then you will probably end up driving development to support this and may end up driving the architecture towards the same way that FG is structured. You may not see this as ideal; I'd not worry about importing at all - anything new will benefit from models that are designed from the ground up to work with the new architecture.
  11. Software engineers or programmers often think that you can modularize aircraft because it looks to a software engineer that aircraft are full of the same parts. Anyone who's made a decent aircraft simulation will tell you that there is a degree of variance in even the basic instruments; but once you get onto avionics and aircraft systems it starts to differ massively; more so with recent aircraft (since the mid 1980's when they started to use black boxes extensively). IIRC simulating electrics and hyds was the main reason to implement Nasal in the first place.
    A more sensible approach is to build up a library of aircraft parts simulations by their model number; but this is a massive undertaking and requires a lot of tedious work which is why you often see a lot of cut and paste coding in the aircraft models; but this is nothing to do with the core capabilities as FG is already setup to allow modular instruments, parts of models etc. it’s just that most modellers don’t have the time to maintain this library.
  12. Multiplayer is a lot harder than it seems. Peter’s JoinFS looks very promising and I’ve heard good things, but it isn’t GPL or opensource. FG multiplayer is something that does need improving. I’ve already made two improvements to this (packet efficiency and Emesary) – but the next step is going to be the biggest improvement (and the most complicated so it might never get done); which is to enable p2p for aircraft that are ‘close’ (i.e. within say 3nm).
-------------------------
If I were to build my own Simulator then I'd probably not be worrying about most of your list; instead it would go something like this.

  1. Investigate, evaluate and choose a rendering platform. ref (3)above. The main thing I'd be worried about is how well it works at 36,000ft and at sea level. I'd be reviewing all of the usual rendering effects and overall quality and peformance, but at the same time part of this process would have to be to build terrain for limited region, I'd probably choose the Cote d'azur because there is decent DEM, OSM and it's an area that has both coastlines and mountains. I'd want to see how well it performed in cockpit, outside models, z-buffering etc. Shadows, PBR, lightpoints, atomspheric light scattering, 3d clouds, water effects, reflection, heat haze (etc.). Probably the rendering engine should be multithreaded and thread safe. Probably at least 200 hours effort to properly evaluate each possible rendering engine; plus probably 200 hours to a list of rendering engines to evaluate. I'm going to estimate this at 800 hours, i.e. evaluating 3 different engines[1].
  2. Having chosen a rendering platform I'd then concentrate on how to build the world scenery; importing airports, lights, OSM data, navaids etc. The goal would be to build a model of the entire world that was of good quality and performance that looked great and ran at more than 30fps everywhere. Probably 1000hours.
  3. Having now got a rendering engine; I'd next build the simulation engine. This needs to be modular (at the source level), multi-threaded and configurable both by the end user but also by the aircraft and scenery models. The rendering engine and simulation engine would be free running, so I'd have to solve that first. I'd probably go with conceptual compute nodes, each of which would be a thread and would be loaded up with a set of simulation modules. The compute nodes would be frame based; and strict start of frame synchronisation required. In this sense the simulation frame is separate from the rendering frame. The rendering is free-running and would therefore be interpolating the view position from the output of the simulation nodes. Probably 500 hours.
  4. Design and implement interaction between the rendering and the simulation for animations, ground interactions, etc. Probably 200 hours.
  5. Connect (3) to JSBSim. Build an aircraft model and get it working. This may require choosing a scripting engine and implementing it. Probably 500 hours.

At this point you'd have a basic simulation platform after spending 3000hours. You'd not even be close to what FG can currently do.
…maybe I’m too old and lack enthusiasm but having seen that starting from the ground up on a project will generally take two or three times longer than it would to improve an existing project.

The reasons for a massive redevelopment effort have to be more than the list you’ve posted, a lot of the architectural issues are simply not causing a real problem to most modellers, and Nasal is reasonbly easy to pickup - but it's interfacing with the aircraft model that is the hard part and that is not something the improves just because the language is better. Really the list boils down to improving performance and graphics – which is a fine goal, but ultimately the same problems that are the root cause of the graphics / scenery problems in FG will still be there; namely the lack of active modellers fixing up the world so that it looks great *and* that FG is already using most of the good sources of DEM, mapping data and terrain meshes, there simply isn’t that much better available (on a worldwide basis).

Personally I'd dispute that "...FG has become a Bloated software hard to run in low specs machines.." there are parts of the internals of FG that could do with optimising, but this oft quoted “bloated software” is almost a worthless statement – programmers don’t go around writing huge amount of code for no reasons; and what someone calls bloat someone else may well refer to as a neat feature. Generally FG is well structured although there is a lot of code to understand; it's reasonably memory and CPU efficient (although the lack of multithreading hurts performance, but multithreading in C++ is very far from being easy).

The big problem with optimising software for low spec machines is the amount of time it takes; and the rather vague “low end machines” is a constantly moving target that would need to be defined, e.g. i3 with integrated graphics. Almost certainly it becomes even more complex If you want to get the good graphics that medium to high end users expect and keep performance ok on lower end machines – because you may find that you need to restructure the terrain model to work with minimum shaders (i.e. 1). This sort of optimising may require a switch in rendering engine, or a rebuild of the interface to the rendering engine or rebuild of the scene models DB.

IMO most of the performance problems that you'll encounter with FG are related to the terrain mesh (WS2.0), together with poorly coded aircraft, using Canvas etc. The F-14 gives roughly 1.5 times faster fps, and that’s mainly the less detailed cockpit mesh and the lack of canvas displays. I’ve spent a fair amount of time trying to get better performance out of the F-15, and now the main thing left is to rebuild the entire cockpit as a single mesh with a single texture atlas which would take a lot of time for possibly little reward (as it might not even help much).

If FG ever gets WS3.0 then you can expect a significant performance improvement just because of the LOD and improved terrain meshes. You just need to look at the OSG stats to see where the performance is going to realise just how significant LOD in the scene model DB will be.

So personally I’m not really interested in doing this; if I was I’d probably already have started, instead I’m slowly working through a list of things that I think need improving in the current FG.

-------------------------------
[1] one of these would certainly be the opensource OpenIG by my friends over at Compro; as they understand how an image generator for a flight sim should work.

Richard
Posts: 114
Joined: Sun Sep 11, 2016 5:57 pm

Re: A new Flight Simulator

Postby Richard » Thu Mar 01, 2018 1:13 pm

OpenIG (1):
Image

------------
[1] probably with payware addons though.

User avatar
SHM
Posts: 1960
Joined: Mon Sep 14, 2015 3:32 pm
Location: India

Re: A new Flight Simulator

Postby SHM » Thu Mar 01, 2018 1:50 pm

As Richard told above I don't there is enough resources (man power) to make an open-source flightsim again from the ground up.

Richard wrote:[*] Multiplayer is a lot harder than it seems. Peter’s JoinFS looks very promising and I’ve heard good things, but it isn’t GPL or opensource.

I would be interested in FG and joinFS connectivity since I can fly with you guys again but when I talked to Peter it didn't look like it was coming anytime soon. :(
I use joinFS for our group flights and its a really nice network compared to other alternatives.

I've had some brief discussions with an FG developer. Unfortunately, it's not that easy for me to directly support FG with JoinFS, but there might be some other possibilities that will help to make it happen. However, it's unlikely to happen any time soon, I'm afraid as there's still plenty of higher priority things on the list.

Thanks for you interest,
Peter
FG Pilot (2011-2018)
Prepar3d (2015 - 2023)
MSFS2020 (2020 - )
Image

Richard
Posts: 114
Joined: Sun Sep 11, 2016 5:57 pm

Re: A new Flight Simulator

Postby Richard » Thu Mar 01, 2018 2:42 pm

SHM wrote:
I've had some brief discussions with an FG developer. ... Thanks for you interest, Peter


Yeah that was me. I offered to help code it - but that the result would have to be GPL - and I'm not sure if Peter would be willing to open up JoinFS. I'll write to him again when I've got enough time to think about it more.

Recently I found this https://github.com/ffs2/ffs2play - but haven't had time to investigate more. This might be a more viable solution however I've not had the time to investigate more (i.e. is it stable).

User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: A new Flight Simulator

Postby IAHM-COL » Thu Mar 01, 2018 3:07 pm

Thanks for a very thoughtful analysis Richard.

Exceptionally, we see the problem, the potential solutions, the potential roadblocks in sight quite very well aligned. With your exceptional skills, it would be great if we decide to go for this, to have your interest and cooperation at hand.

We all know FG exist. Different people here has different opinions on the current success of it as a modern looking, and capable simulator. I can tell you, my opinion: FG is really GREAT! But, to be part of that development team has proven impossible for some of us. That could be irrelevant, but it is not, if you have an idea of how something could change, but such change could be unfeasible to be implemented. Personally, I'd tried developing aircrafts for FG. I find it not intuitive from the developing style perspective. Dealing with XMLs and suffering NASAL per example is the very first roadblock there. Documentation is still poor, in many aspects lacking. So FG could do a lot. But knowing to do that lot... is a different box.

I would like to say I am proposing here "A new" FS. OK,. the elephant in the room: FG exists (GPL). Other elephants are not GPL, so less scary for the conception of the idea. But FlightSimulation in the GPL lacks alternatives. This is not very common in the OpenSource World. Vim/emacs/geany/notepad++ etc, per example. Or think net-browsers. The GPL market is a real market of options. But for FS, it boils down to FG, and its ways. And hoping those "ways" are everyone's style is though.

Onto your list:

Richard wrote:
  1. Yup

Yup. No gain otherwise.

Richard wrote:
  • Modularity is essential; dynamic plugins (.so / .dll) are much more complicated; if anything adopting OpenRTI or Open-DIS is probably a better idea.

  • Yup. I've said same.

    Richard wrote:
  • Very hard to achieve. OSG is pretty good at what it does. There are other options but the demands of a FlightSim are quite often way in excess of your typical game engine. Needs to be decided first.

  • I am not quite sure I get OSG as the end of the road. I am liking to explore alternatives here for the 3D rendering. I am liking Panda3D a lot. And for it being native to python too.

    Richard wrote:
  • Better to abstract the GUI completely away from the simulation engine and allow multiple front ends, such as http.

  • You are the software engineer. I bow here. What you had said sounds very correct to me here.

    Richard wrote:
  • This is the hardest one of the lot; probably I'd go with shapefiles - OSGEarth uses these to great effect; but the biggest single performance problem FG is WS2.0 and missing LOD. Any terrain engine must have LOD designed in from the start.

  • Shapefiles are an interesting avenue. Getting high-quality Shapefiles with Qgys is doable, but more for some earth parts than others. Using textured based renderings could be a way to. I'm wondering if one could get both married? I fully agree with LOD designing from the start.

    Richard wrote:
  • Not worth wasting time on; OSG can load from lots of different model formats - so largely the choice of model format depends on the rendering framework (3)

  • That if OSG is the choice. But you said. Rendering framework has lots of saying here. I say again, I am not disliking panda3D. The egg format seems a cool thing. It can actually get to export the animations from blender per example.

    Richard wrote:
  • possibly; but not really important.
  • JSBSim for the Win :D

    Richard wrote:
  • Probably not as using JSON doesn't achieve much over XML, JSON is harder to reliably validate and not as easy to enter.
  • Is this a emacs/vim philosophical stand point? I think JSON is easier to enter. More human like. Maybe just sticking with python namespaces, classes, and objects, is the real more logical thing to do?

    Richard wrote:
  • As a DSL Nasal is pretty good at what it does. There are many options you could choose from, DCS uses LUA. Python could work. I'd probably go for C# embedded.
  • NASAL? OH JEZZ! (LOL). If I could get us to philosophically abandon that Frankenstein day 1 I'll consider myself very convincing of a guy. Josh says, please keep it. Others think to make FG aircrafts run in the new thing we need to keep it. I say; Forget about FG aircraft running as is. Drop that Nasal bullshit. Get some real "DSL". I'd love for it to be python. Maybe if we are going to accept additional scriptings, C++ would get my vote.

    Richard wrote:
  • This is a double edged sword. If from the outset you support import of JSBSim FG models then you will probably end up driving development to support this and may end up driving the architecture towards the same way that FG is structured. You may not see this as ideal; I'd not worry about importing at all - anything new will benefit from models that are designed from the ground up to work with the new architecture.
  • 100% my agreement here. Not what others are thinking at the moment. There is this conundrum. I would love aircrafts to be developed differently. Others want that too, but want some level of from the start up FG-aircraft supporting. But again, as you said, <<then you will probably end up driving development to support this and may end up driving the architecture towards the same way that FG is structured.>>. Best summary for <<wasting time>> ever.

    Richard wrote:
  • Software engineers or programmers often think that you can modularize aircraft because it looks to a software engineer that aircraft are full of the same parts. Anyone who's made a decent aircraft simulation will tell you that there is a degree of variance in even the basic instruments; but once you get onto avionics and aircraft systems it starts to differ massively; more so with recent aircraft (since the mid 1980's when they started to use black boxes extensively). IIRC simulating electrics and hyds was the main reason to implement Nasal in the first place.
    A more sensible approach is to build up a library of aircraft parts simulations by their model number; but this is a massive undertaking and requires a lot of tedious work which is why you often see a lot of cut and paste coding in the aircraft models; but this is nothing to do with the core capabilities as FG is already setup to allow modular instruments, parts of models etc. it’s just that most modellers don’t have the time to maintain this library.

  • I'm not an aircraft developer. I am not a software developer. I still think most of the instruments in a panel can be done by classes, and inheritance. After that, every instrument gets exposed to the class routines, and can from there get coded its independent behaviors. Arent many needle based instruments bottom line a very similar beast after all?

    Richard wrote:
  • Multiplayer is a lot harder than it seems. Peter’s JoinFS looks very promising and I’ve heard good things, but it isn’t GPL or opensource. FG multiplayer is something that does need improving. I’ve already made two improvements to this (packet efficiency and Emesary) – but the next step is going to be the biggest improvement (and the most complicated so it might never get done); which is to enable p2p for aircraft that are ‘close’ (i.e. within say 3nm).
  • I had no clue what they are doing with FGMP. I plead to god is something good.
    https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

    R.M.S.
    If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?

    Octal450
    Posts: 2184
    Joined: Sun Oct 18, 2015 2:47 am

    Re: A new Flight Simulator

    Postby Octal450 » Thu Mar 01, 2018 3:52 pm

    Israel wrote:NASAL? OH JEZZ! (LOL). If I could get us to philosophically abandon that Frankenstein day 1 I'll consider myself very convincing of a guy. Josh says, please keep it. Others think to make FG aircrafts run in the new thing we need to keep it. I say; Forget about FG aircraft running as is. Drop that Nasal bullshit. Get some real "DSL". I'd love for it to be python. Maybe if we are going to accept additional scriptings, C++ would get my vote.

    Give me one reason Nasal is bullshit. It is a scripting language, and it is good at what it does. You have given no reasons whatsoever. You are just stating your opinion and giving no facts. I hated Nasal too until I got better at it. Please give me a reason.

    Kind Regards,
    Josh

    User avatar
    IAHM-COL
    Posts: 6455
    Joined: Sat Sep 12, 2015 3:43 pm
    Location: Homey, NV (KXTA) - U.S.A
    Contact:

    Re: A new Flight Simulator

    Postby IAHM-COL » Thu Mar 01, 2018 5:25 pm

    Hi Josh.
    I can't do that you are asking, because I couldn't make a python example work; since FG wont take it.
    But I hope we can work on a philosophical, not a technical standpoint for a minute.

    Let's take for example:
    https://github.com/FGMEMBERS/727-200/bl ... s-2rev.nas
    Your code here

    Code: Select all

    var toggleFastRevThrust = func {
       var eng1thr = getprop("/controls/engines/engine[0]/throttle-pos");
       var eng2thr = getprop("/controls/engines/engine[1]/throttle-pos");
       var eng3thr = getprop("/controls/engines/engine[2]/throttle-pos");
       if (eng1thr <= 0.05 and eng2thr <= 0.05 and eng3thr <= 0.05 and getprop("/controls/engines/engine[0]/reverser") == "0" and getprop("/controls/engines/engine[2]/reverser") == "0" and getprop("/gear/gear[1]/wow") == 1 and getprop("/gear/gear[2]/wow") == 1) {
          interpolate("/engines/engine[0]/reverser-pos-norm", 1, 1.4);
          interpolate("/engines/engine[2]/reverser-pos-norm", 1, 1.4);
          setprop("/controls/engines/engine[0]/reverser", 1);
          setprop("/controls/engines/engine[2]/reverser", 1);
          setprop("/controls/engines/engine[0]/throttle-rev", 0.5);
          setprop("/controls/engines/engine[2]/throttle-rev", 0.5);
          setprop("/fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", 3.14);
          setprop("/fdm/jsbsim/propulsion/engine[2]/reverser-angle-rad", 3.14);
       } else if ((getprop("/controls/engines/engine[0]/reverser") == "1" or getprop("/controls/engines/engine[2]/reverser") == "0") and getprop("/gear/gear[1]/wow") == 1 and getprop("/gear/gear[2]/wow") == 1) {
          setprop("/controls/engines/engine[0]/throttle-rev", 0);
          setprop("/controls/engines/engine[2]/throttle-rev", 0);
          interpolate("/engines/engine[0]/reverser-pos-norm", 0, 1.0);
          interpolate("/engines/engine[2]/reverser-pos-norm", 0, 1.0);
          setprop("/fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", 0);
          setprop("/fdm/jsbsim/propulsion/engine[2]/reverser-angle-rad", 0);
          setprop("/controls/engines/engine[0]/reverser", 0);
          setprop("/controls/engines/engine[2]/reverser", 0);
       }
    }


    how many setprops?

    I endear this would be nice if possible

    Code: Select all

    import engine from FS.propertyTree #would get the Engine class for the flight simulator.
                        #the class Engine would be ready for the mods.
                                                         
    Class 727engines(Engine):
       def __init__:
          enginesStack=[Engine() for engines in range(3)]
               #Now we created three engines in the stack for the initialization as a list
            def  toggleFastRevThrust(self):
                   for engine in enginesStack:
                            engine.reverser=1
                            engine.throtle-rev=0.5
                            engine.reverser-angle-rad=3.14

    ##Now we can create our stack and run the functions declared

    engines=727engines( ) 
    engines.toggleFastRevThrust( )


    Something of the like could be more reusable, and fun to code, IMHO
    https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

    R.M.S.
    If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?

    bomber
    Posts: 1379
    Joined: Mon Nov 30, 2015 3:40 pm

    Re: A new Flight Simulator

    Postby bomber » Thu Mar 01, 2018 6:56 pm

    Interesting topic.

    We've seen new flight sim start-ups such as 'next gen flight sim' start and fail for reasons that plague FG at its heart.

    Politics.

    You've only got to read the FG forum to see its negative effect.... And this forums existence is due to it.

    Any project that fails to recognise the differences between the core code and content is just doomed to repeat the same failings as FG.

    By all means use GPL for the core, but be more flexible for content and the sim will never be short of the highest quality content, which through it more core developers will be pulled in which will drive the development of core code.

    Building a content development environment that focuses on the skills needed for content and giving these people a voice within the direction that core code takes is also important, essential infact.

    Having a clear road map...

    Starting from scratch is I think a non starter however taking FG and forking it, keeping the core GPL but moving other parts of the sim and its community in a different direction is the way forward in my opinion.

    There's far too much fear and negativity surrounding a fork of FG in a new development direction
    "If anyone ever tells you anything about an aeroplane which is so bloody complicated you can't understand it, take it from me - it's all balls" - R J Mitchell

    Octal450
    Posts: 2184
    Joined: Sun Oct 18, 2015 2:47 am

    Re: A new Flight Simulator

    Postby Octal450 » Thu Mar 01, 2018 7:08 pm

    If I had coded the reverse thrust system in an object oriented way, it would take much less lines, but I choose not to when I wrote that file.

    Further, I don't see how Python is any better than Nasal in this scenario. In fact, looking over your code, your example won't work. (Used some Googling, and common sense to work it out, I don't know much Python)

    You've just shown me a different and inferior way to do it, which is a bad way way to port things.

    I really don't like Python.

    Kind Regards,
    Josh

    User avatar
    IAHM-COL
    Posts: 6455
    Joined: Sat Sep 12, 2015 3:43 pm
    Location: Homey, NV (KXTA) - U.S.A
    Contact:

    Re: A new Flight Simulator

    Postby IAHM-COL » Thu Mar 01, 2018 7:20 pm

    oh my good lord, Josh

    Of course it wouldn't work. I didn't code it with all attention to detail, because we both know FG will not get that code any good use.
    OTOH if you think that code was uglier that the nasal thingy there, ok: Beauty its in the eye of the beholder. Not only I think the python is prettier, simpler, neater, more functional, but also more expandable.

    Not gonna educate you now. For the time being I'm ok with your keeping your posture here.
    https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

    R.M.S.
    If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?


    Return to “Core Development”

    Who is online

    Users browsing this forum: No registered users and 1 guest