#Flight Simulation#Programming#GoLang

SimConnect in Go: Because Sometimes You Need Your Flight Sim API with a Side of Gopher

You know that feeling when you're knee-deep in building a Microsoft Flight Simulator addon and realize you need to talk to SimConnect? But then you look at your tech stack and it's all Go, and suddenly you're facing the classic "square peg, round hole" situation. Well, let me introduce you to something that'll make your life easier: a proper SimConnect wrapper in Go.

By Martin Hrášek July 3, 2025 6 min read

Let me tell you a story. A few months back, I found myself in this exact situation. I had this brilliant idea for an MSFS addon (don't we all?), and my entire backend was already humming along nicely in Go. The thought of rewriting everything in C++ just to talk to SimConnect made me want to throw my keyboard out the window. That's when I decided to build this SimConnect wrapper.

What's the Big Deal with SimConnect Anyway?

For those new to the flight sim development world, SimConnect is basically the API that lets you talk to Microsoft Flight Simulator. Want to know your aircraft's altitude? SimConnect. Need to spawn an AI aircraft? SimConnect. Want to make the weather go completely bonkers? You guessed it – SimConnect.

The problem is, SimConnect was designed with C++ in mind. The design of a SimConnect add-on involves writing a client to communicate with a server running within Microsoft Flight Simulator 2024. While Out-of-process add-on components for Microsoft Flight Simulator can be written in C, C++, or - if the managed API calls are being used - any .NET language such as C#.net or VB.net., Go wasn't exactly on the guest list.

But here's the thing – Go is fantastic for building robust, concurrent applications. It's got goroutines, channels, and a simplicity that makes you actually enjoy writing code. So why should we be forced to abandon it just because we want to build flight sim addons?

Enter the Go SimConnect Wrapper

This library takes all the complexity of SimConnect's C++ API and wraps it up in a nice, Go-friendly package. Think of it as a translator between your elegant Go code and SimConnect's... let's call it "traditionally designed" API.

Here's what makes this wrapper special:

1. Cross-Platform Development (Sort Of)

One of the coolest things about this wrapper is that cross-compiles from macos/linux, no other dependencies required. Yes, you read that right. You can develop your MSFS addon on your MacBook at the coffee shop and compile it for Windows. Try doing that with a traditional C++ SimConnect application!

The library produces a single binary with no other files or configuration required. No DLL hell, no missing dependencies, just one executable that works. It's like the promise of Java, but actually delivered.

2. Idiomatic Go API

Instead of dealing with callbacks, handles, and all the C++ ceremony, you get a clean Go API. Want to connect to the sim? It's as simple as:

instance, err := simconnect.NewSimConnect("MyAwesomeAddon")
if err != nil {
    // Handle error like a responsible developer
    panic(err)
}

// Get some data
report, err := instance.GetReport()
if err != nil {
    panic(err)
}

fmt.Printf("Current altitude: %f feet\n", report.Altitude)

No weird pointer arithmetic, no manual memory management, just clean, readable Go code.

3. High-Level Abstractions

The wrapper doesn't just translate the API one-to-one. It provides higher-level abstractions that make common tasks easier. Need to spawn an AI aircraft? Load a flight plan? Set up event subscriptions? There are convenience methods for all of that.

For example, creating an AI aircraft is as straightforward as:

objectID, err := instance.LoadParkedATCAircraft(
    "Airbus A320",           // Aircraft type
    "N12345",               // Tail number
    "KLAX",                 // Airport ICAO
    1,                      // Request ID
)

Compare that to the traditional SimConnect approach where you'd be juggling multiple API calls, data definitions, and callback registrations. Yeah, I'll take the Go version, thank you very much.

Real-World Use Cases

So what can you actually build with this? Here are some ideas that have been rattling around in my head:

Flight Data Recorder

Build a service that records all your flight data to a database. Since it's Go, you can easily integrate with any database, send data to the cloud, or even stream it in real-time to a web dashboard. The concurrency model makes handling multiple data streams a breeze.

AI Traffic Manager

Create sophisticated AI traffic patterns that go beyond what the sim provides out of the box. With Go's excellent HTTP client, you could even pull real-world flight data and recreate actual traffic patterns.

External Instructor Station

Build a tablet-based instructor station that can control weather, failures, and flight parameters. Go's built-in HTTP server makes creating a web interface trivial.

Integration Hub

This is where Go really shines. You could build a service that bridges MSFS with other systems – home automation, streaming software, external hardware. Imagine your room lights dimming as you climb through FL100, or your stream automatically switching cameras based on flight phase.

MSFS 2024: The Plot Thickens

Now, here's where things get really interesting. There is no big breaking change that needs a lot of work to be compatible with Microsoft Flight Simulator 2024. This is fantastic news for anyone using this Go wrapper – your addons should continue working with the new sim.

However, Unfortunately, I'm (quite severely) affected by on of the only breaking change in the new SDK. Since SIMCONNECT_DATA_FACILITY_AIRPORT has been updated to support longer idents, many function that I rely on will only work for one sim. This is something to keep in mind if you're working with airport data, but it's a relatively minor issue in the grand scheme of things.

What I'm really excited about are the new possibilities MSFS 2024 brings. The enhanced simulation capabilities, better performance, and new features open up a whole new world for addon developers. And with this Go wrapper, you'll be ready to take advantage of all of it without having to rewrite your entire codebase.

What's Coming Next?

I've been working on some exciting addons for MSFS 2024 that leverage this Go wrapper. Without giving too much away (a developer's got to have some secrets), let's just say they involve:

  • Real-time data synchronization with external services
  • Advanced flight planning capabilities that go beyond what's built into the sim
  • Integration with popular streaming platforms
  • Some machine learning experiments that might just blow your mind

These addons are taking advantage of Go's strengths – concurrent processing, easy HTTP handling, and clean code structure. They'll be released as soon as MSFS 2024 stabilizes a bit more (we all know how launch periods go).

Getting Started

Want to give it a try? Getting started is dead simple:

go get github.com/mrlm-net/simconnect

Then import it in your code:

import "github.com/mrlm-net/simconnect"

The repository includes examples to get you started, from basic data retrieval to more complex scenarios like managing AI aircraft.

The Bottom Line

Look, I get it. Using Go for flight sim development might seem unconventional. But sometimes the unconventional path leads to the most interesting destinations. This wrapper opens up SimConnect development to the Go community, and more importantly, it makes building MSFS addons actually enjoyable.

You get all the benefits of Go – simple syntax, great tooling, easy concurrency, cross-compilation – while still having full access to SimConnect's capabilities. It's like having your cake and eating it too, except the cake is a flight simulator addon and you're eating it with a gopher-shaped spoon.

So whether you're building your first MSFS addon or you're a seasoned developer looking for a better way to work with SimConnect, give this wrapper a shot. Who knows? You might just find yourself enjoying flight sim development more than actually flying in the sim. And with MSFS 2024 on the horizon, there's never been a better time to start building.

Now if you'll excuse me, I need to get back to testing my latest addon. These AI aircraft won't spawn themselves... or will they? That's actually not a bad idea for the next feature...

Martin Hrášek

Martin Hrášek

Software Developer • Aviation geek