Emesary: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
Line 76: Line 76:
* https://forum.flightgear.org/viewtopic.php?f=27&t=29355&p=282755#p282431  
* https://forum.flightgear.org/viewtopic.php?f=27&t=29355&p=282755#p282431  
== Related ==
== Related ==
* http://chateau-logic.com/content/emesary-multiplayer-bridge-flightgear
* http://chateau-logic.com/content/emesary-nasal-implementation-flightgear
* http://emesary.codeplex.com/
* http://emesary.codeplex.com/
* https://emesary.codeplex.com/documentation
* https://emesary.codeplex.com/documentation
* http://chateau-logic.com/content/emesary-efficient-inter-object-communication-using-interfaces-and-inheritance
* http://chateau-logic.com/content/emesary-efficient-inter-object-communication-using-interfaces-and-inheritance

Revision as of 22:27, 25 April 2016

This article is a stub. You can help the wiki by expanding it.


Background

Right now the replay system only records and replays your "own" aircraft flight dynamics. It would be a significant change/addition and somewhat non-trivial to capture all the data for all the AI objects and replay them as well. We'd have to decide if the recording and playback mechanism should be part of the AI object or something external that grabs the data and then somehow can force the AI object back through it's original path during playback. [1]

A similar problem arises when you have a multi viewer environment where you want to interact with the carrier or when you watch AI traffic across the views ..

In this case each viewer has its own carrier AI traffic. That means the can move independently. The same applies to multiplayer mode.

We need some generic code which is able to track SGSubsystems including their child subsystems and transfer their relevant states over the network. The same interface could be used to store replay replay logs. [2]

Intro

Richard has finished porting his Emesary system to Nasal.

There is a set of notes at [1] that explains the whole thing with a worked example (ACLS).

Emesary is a simple and efficient class based interobject communcation system to allow decoupled disparate parts of a system to function together without knowing about each. It allows decoupling and removal of dependencies by using notifications to cause actions or to query values.

This is in Richard's git repository in his commit, together with the changes to the AI carriers to add ACLS (carrier ILS): https://sourceforge.net/u/r-harrison/fgdata/ci/54165c213f03638a4cb02c848c4f2b234c537f66/

There are many possible applications for Emesary within the system, it solves the problem of how to connect generic instruments to aircraft that have different implementations and properties that need to be used. I've been looking at how to abstract out the interface to the MFD and NavDisplay.

Richard has plans to extend this to be able to transmit over mp (probably layered ontop of mp-broadcast). It would also probably work quite well with the HLA FOM to give us a way for models to communicate with other models.[1]

  1. Richard Harrison (Apr 1st, 2016). [Flightgear-devel] Message passing interface for Nasal.

Multiplayer bridge

Richard has now got the Emesary multiplayer bridge working ref: http://chateau-logic.com/content/emesary-multiplayer-bridge-flightgear [1]

Code is in the branch of fgdata: https://sourceforge.net/u/r-harrison/fgdata/ci/next-emesary-mp-bridge/tree/

  • Nasal/emesary.nas
  • Nasal/emesary_mp_bridge.nas
  • Nasal/notifications.nas

The multiplayer bridge allows notifications to be routed over MP. The model creates an incoming bridge specifying the notifications that are to be received and the bridge will messages from multiplayer models. The elegance of the bridge is that neither the sender nor the receiver need to know about each other; all notifications just appear in the recipient method where they can be handled. Each aircraft would have one (or more recipients) and just handle the incoming message.

  1. Richard Harrison (Apr 25th, 2016). Re: [Flightgear-devel] Message passing interface for Nasal.

Use Cases

Examples

Collection of examples discussed on the forum.

MP Traffic feeds (injection)

Related