New Idea for a plugin. Looking for suggestions

Hello MSFS Community!

I’m a software developer with passion for both coding and flight simulation. While my professional background is primarily in web application development (using Python and Java for backend, and Angular for frontend), I’m entirely new to the world of MSFS and game plugin development.

I’ve been using MSFS not just for the joy of flying but also to scout locations for road trips.
This inspired me with an exciting idea:
a plugin that allows users to display GPS (GPX/KML) paths directly on the terrain in real-time, similar to a 3D Google Maps direction line, instead of just on the VFR map/GPS interface. The goal is to easily follow a path without having to constantly check a map/navlogs.

To better give an idea of the result that I expect:

This is how Google Earth displays a path:

And the familiar Goole Maps directions’s path:

Or ideally, make it as visible as the line in the tutorials screenshot

How I envision this plugin working:

  • Inside the game or from an external window, the user loads a .gpx (or .kml) file.
  • The user starts a flight.
  • They see a line corresponding to the .gpx they uploaded directly on the terrain.
  • A nice-to-have feature would be the ability to remove or change the GPS track even during flight.

How would you implement this? Any advice you can offer? Is even possible to do this?

Keep in mind that I probably will start simple with a POC and that see where to go from there :slight_smile:

Some of my considerations:

I was wondering if SimConnect is necessary for my use-case. From what I’ve seen, it seems mainly used for interacting with the aircraft rather than the scenery. It seems that adding elements to the scenery might just require importing a fex “xml” file, so perhaps my code could generate all the necessary files without directly interacting with SimConnect. I might be totaly mistaken on this.

If I need to use SimConnect, which language would you recommend? I’d prefer Python, Java, or JavaScript, but I’m open to learning C# if it simplifies things on the long run.

For Python, I found some SimConnect wrappers:

These might be enough for my purpose since I don’t need to interact with the aircraft. However, I’m concerned that these wrappers may not be updated in the future and get out of sync with the sdk’s API’s.

Another consideration is that I’d like to publish this add-on and make it easily installable for everyone (perhaps with an .exe file?). Integrating a Python wrapper might complicate this process.

Thanks everybody, I’ll keep you posted :slight_smile:

Hey, nice idea there :smiley:

for my own use I have little utility in my toolbox that takes a kml and convert into scenery,
quite useful to review my hiking trips

here’s a quick sample

For something working at runtime, I guess Simcconect could be a way, it has a function called SimConnect_AICreateSimulatedObject that may be useful (I always wanted to play with SimConnect but never dig into it, I’m a noob vb.net coder, to hard to understand!)
Just keep in mind that placing hundreds of simobjects will quickly make the objects invisible (there is an hard limit of 1000 or so): i mean hundreds because the game allow to set alt/lon/alt and pitch/bank/heading + SCALE (global) for each objects, so for your implementation you will likely need to subdivide each coordinates segment into smaller one (equally spaced) and place an object at each point
(scaling according to distance is not an option because I can guarantee you won’t like the result!)

1 Like

@mamuDesign your solution is very cool :smiley: That’s basically what I meant with

might just require importing a fex “xml” file, so perhaps my code could generate all the necessary files without directly interacting with SimConnect.

Can I find this “utility” of yours on some marketplace or do you mind sharing the code or roughly explaining how you achieved that?

Of course something at runtime is better and I hope to try out SimConnect soon!

PS: I accidentally found your youtube channel while researching on this topic. Full of useful sutff :slight_smile:

not exactly, but something similar we have in ALBATROSS racing app for gliders - custom objects (checkpoint gate) injected by SimConnect script at required location and altitude https://msfs.touching.cloud/wp-content/uploads/2021/02/alb.jpg

another solution will be use visual effects - track will be flat visually (like ribbon) but this is much easier than 3D model bones manipulations. Simconnect inject custom model with effect attached, move it through the path and then freeze. as result pilot will see track of this object.

I would recommend C# as it quite close to the Java.

1 Like

On my side, I have parsed the kml coordinates obtaining an array, split it
And for each(n) coord paar I compute left and right coords from the point (array[n])
Then compute left and right of next point(array[n+1])
This gives you the vertex for each Polygon,
Then is simply writing a placement .xml, adding , with obtained above
You can also compute the point to point bearing for each segment to rotate the texture of the polygon
If you jump in my Discord I can share the app

1 Like

I got my first proof of concept working. I ended up reading a gpx file and for every point, I placed a… firetruck :joy:

See the red dots of the emergency lights in the screenshot below.
I was able to place 4500 objects (200km) without noticing any problems.

I placed them using the AICreateSimulatedObject("ASO_Firetruck01", ...
I chose the “ASO_Firetruck01” because it’s an object that comes ready to use in the sim and it’s quite visible.

The next steps:

  • try to place a non-ai object (since I do not need ai/movement)
  • try to place a custom object
  • try the solution proposed by @thealx with visual effects even if at this moment I do have not clear how to implement it :smiley:

This is a more complete snippet:

var waypoints = ReadWaypointsFromGpx("positions.xml");


            int objectId = 0;

            foreach (var waypoint in waypoints)
            {

                SIMCONNECT_DATA_INITPOSITION initPosition = new SIMCONNECT_DATA_INITPOSITION
                {
                    Latitude = waypoint.Latitude,
                    Longitude = waypoint.Longitude,
                    Altitude = waypoint.Altitude,
                    Pitch = 0.0f,
                    Bank = 0.0f,
                    Heading = 0.0f,
                    OnGround = 1,
                    Airspeed = 0
                };


                m_oSimConnect.AICreateSimulatedObject("ASO_Firetruck01", initPosition, SIMCONNECT_DATA_SET_FLAG.DEFAULT);
                objectId++;

                Console.WriteLine("Created object  " + objectId + " at " + waypoint.Latitude + ", " + waypoint.Longitude + ", " + waypoint.Altitude);
            }

I will share the full code once I have something better :relieved:

I also tried windmill for more visibility, the result is quite hilarious

EDIT:
Only adding a windmill every 500m improves the experience :laughing: