Howto:Disable Nasal entirely: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
 
Line 64: Line 64:


|objective-body=provide a startup option (boolean property) to disable the Nasal scripting engine in FlightGear to help with regression testing.
|objective-body=provide a startup option (boolean property) to disable the Nasal scripting engine in FlightGear to help with regression testing.
before Nasal can go, or even just alternatives be considered, people need to understand why FGPythonSys would suffer from the same restrictions.
HLA is all great and dandy, but for that to actually work and be beneficial, certain groundwork has to happen first - and that involves making Nasal entirely optional, so that we can get rid of the hard-coded assumption that Nasal is always up and running.
The next step is making subsystem initialiation incremental in its entirety - which also entails stopping to load all sorts of subsystem-specific Nasal scripts despite some subsystems having become optional these days (thanks to James reset/re-init work).
In other words, imagine a scenario where ATC-chatter is loaded but sound is not running/disabled, or the tanker scenario/script with AI disabled (and even moreso Bombable), or gui.nas loaded without PUI being active etc.
And like many people have stated previously, the extreme use of Nasal embedded in GUI dialogs has to stop, too - it's hugely chaotic and almost perverse, it is adding tons of problems, and making it next to impossile to come up with other UIs.
Equally, even the way people code avionics is problematic from the standpoint of wanting a simulation without Nasal in the main loop - as it doesn't scale, it also assumes that Nasal is always running in the main loop - so once/if people shuffle it out of the main loop, there would be all sorts of race conditions (=crashes) caused by such code.
The way Nasal is used in FlightGear is certainly very problematic, but before FGPythonSys (or other alternatives) can be considered, there are a handful of things that need to happen first, e.g.:
*  providing an option to disable Nasal entirely: [[Howto:Disable Nasal entirely]]
*  allow Nasal to be stopped/restarted and removed/re-added at runtime using the subsystemFactory/fgcommands
*  providing an option to initialize Nasal much earlier and better formalize subsystem/script dependencies: [[Initializing Nasal early]]
*  get rid of Nasal hacks commonly used in GUI dialogs and MFDs, i.e. introduce dedicated XML tags for common hacks (think widgets) and instead of having blobs of Nasal code, introduce fgcommands (possibly just mapped to Nasal code), so that other GUIs (think Phi/qt5) can support those files without them having to support Nasal
*  Integrating IPC/RPC functionality, so that Nasal interpreters can access other subsystem specific property trees without causing race conditions
*  Allow multiple instances of the scripting interpreter to be instantiated, so that these can run in different threads - e.g. with aircraft/scenery scripts running separately from GUI or weather/environmental scripts.
<ref>{{cite web
  |url    =  https://forum.flightgear.org/viewtopic.php?p=297699#p297699
  |title  =  <nowiki> Re: Nasal must go </nowiki>
  |author =  <nowiki> Hooray </nowiki>
  |date  =  Oct 29th, 2016
  |added  =  Oct 29th, 2016
  |script_version = 0.40
  }}</ref>
|background-body=
|background-body=
* Nasal performance
* Nasal performance

Navigation menu