Sign in to follow this  
NotASenator

An Overview of SimConnect

Recommended Posts

Ok, disclaimer first: This is just a rundown of what I've found myself or what I heard/saw at Mike Z's presentation at the AVSIM conference. It's in no way complete or official, and it doesn't represent anything other than my understanding of the API.I'm structuring it in a FAQ/Question and Answer format, so that people can ask more questions in this thread and we can keep things consolidated.What is SimConnect?To put it simply, SimConnect is an interface between third party applications and Flight Simulator. This interface allows these add-ons to talk to FSX, allowing developers to create all sorts of functionality. To be a bit more technical, it's a SDK that allows for the creation of C/C++/.NET programs or DLLs. It works on a client/server asynchronous format. What can it do?A lot. A whole lot. I could make a list, but it would be very long, and just the things that my young mind could come up with. But on a very generic level: Camera controls (like padlocking), AI control, failures, weather, instruments, multiplayer, flight tracking, flight recording, manual or automatic control of AI objects, data mining, virtual co-pilots, hardware interfaces, fly-by-wire systems, and the list goes on. What do I have to do to make SimConnect add-ons to work?All you need is FSX. It will work out of the box.How do I get the SDK?If you have the beta, you already have it. The documentation is in your FSX directory, under /SDK/Core Utilities Kit/SimConnect. When the game launches, it will be included with the Deluxe Edition, on Disk 1. It's a separate install, so if you don't plan on doing any development, you don't have to put it on your drive.Do I need anything else?Well, if you want to program SimConnect Add-ons, you'll need Visual Studio, Visual Studio Express 2005 C++ or C#. If you are writing or running C# managed add-ons, you'll need the .NET framework installed, but I'm pretty sure it installs with FSX. Also, there are a number of dependencies on FSX in the SDK, so you'll want to install the sim first, then the SDK.Is there documentation?What you'll see of the SDK is pretty much all documentation. It uses a HTML format that you just view in your browser, and all the function calls, datatypes and samples are linked for really easy navigation.What is a Client/Server and Asynchronous setup?This is a little bit different than the way things have been done before. In the past, you could send a request through to FS and instantly get a response. A lot of systems are getting away from that for a number of reasons, and SimConnect is one of them. But to the definitions. With a client/server architecture, FSX is the server, your program (and other programs) are the clients, and they talk to the server (and to each other) through the SimConnect interface. Asynchronous means that the client sends a request, and waits for a response. The client program then has an event handler that tells it what to do with the information when it gets the response. This gives you a good deal of freedom in a number of ways, for example, it's very easy to subscribe to events in FSX, i.e. keystrokes, gear down, whatever, and have a function or process get called as soon as the event happens. Secondly, in asynchronous programming, you can keep going with your program even if the data hasn't been returned. Let's give an example. Say you right a program to run a TCAS system in a plane, perhaps multiplayer ready. It does it by getting a list of all of the airplanes in the area, getting data about them and transferring it to the TCAS gauge on your plane. While it is going through the program, it gets to my plane, as I am also connected to this multiplayer server, but my girlfriend is on her computer downloading hundreds of MB of pdf instructions for creating wire jewelry and my internet has slowed to a crawl. So I'm lagging, and the TCAS side program is not getting a response from my system. Well, in normal synchronous programming, you'd have to set a timeout or something, and the program would sit and wait and wait and wait until it timed out before it could do anything else. In this case, it sends the request to get data about my plane, and moves on to the next guy. When the data comes back (or doesn't) about my plane, it does whatever it needs to do with it, and the program has already moved forward without lag.(There's an obvious flaw with that example, which is even if I was lagging, my plane would still exist in the multiplayer space and you could tap the data about it, it just wouldn't be changing or wouldn't be smooth until the lag was corrected, assuming it doesn't smooth it out automatically. But the example illustrates the point, even if it's not technically precise) Why is SimConnect a good thing?There's a couple of reasons, and it should be noted that this is all my personal opinion. First off, it's the standard. A good number of systems use well documented APIs for add-on or plugin architecture. Think Google, DirectX, etc. It allows for standarized processes, cross-compatibility, easy updates and new functionality, and most of all, for us, it means it's very easy for the community to work together to learn the system.Secondly, the learning curve has just fallen off the charts. I'm relatively new to the community around here, and I've never delved into the mysteries of FS development. However, like a good number of other people out there, I know a programming language (in this case, C#) and I can jump right in and have a program doing something in the sim in minutes. SimConnect is going to open the game to a lot of new people.And opening the game is going to be big, because it is going to bring more choices, more options for us to choose from. Right now, there are certain add-ons that are the only game in town. Granted, most of them do their job really really well, there may be some parts of the program you'd like to see different, and this is going to give you a better chance of that happening.And finally, the other benefit is extensibility and compatibility. Over time, the SimConnect API will be updated, not just to fix bugs, but to add functionality suggested by the community of developers. Microsoft will be looking at this forum as well as a "Developer's Corner" that they will be hosting to find the things that we need to better create add-ons, and will be doing what they can to update the SDK. I heard somewhere along the line that they are aiming for quarterly updates.How will updates work?SimConnect will use what is called a "side by side" method for updates. This is very similar to the .NET framework, for those of you who have updated it over time. There is already a versioning system in place, so when you download the SimConnect update, it will place a new file right next to the old one. So, if for some reason, a particular function changes, and an add-on doesn't work with a new version, it can (and will, by default, I believe) fall back on the old SimConnect file to still work. This should pass along to future versions of Flight Simulator. With their backwards compatibility stance, we should see a whole lot of SimConnect add-ons working with very little updating in FS-Next/11/Whatever. By having a single framework for functionality, we ensure that there is only one path to making future versions of flight sim compatible with older versions.What about FSUIPC?Still there, still probably needed by a whole bunch of stuff, still updated. Let's just be clear about one thing, Pete Dowson is absolute piles of awesome, and he has done for FS what SimConnect or something similar should have done a long long time ago. He's pretty much made the add-on market what it is, and he's still going. The most obvious effect I see on this is that everyone doesn't have to completely rewrite their entire add-on to work with SimConnect, which means prompt delivery of FSX-ready updates to your favorite add-ons (I would hope).But this is not the FSUIPC forum. I know that we are all curious, I know that SimConnect is, as of this moment, unproven, and I know we all want to know what Pete has up his sleeve for the future, but Mr. Dowson has been good enough to run his own forum for FSUIPC. It is located at the following link, and I would hope that everyone would be good enough to post your questions regarding his programs and modules over there, so that he doesn't have to spend forever looking for questions:http://forums.simflight.com/viewforum.php?f=54What about {INSERT ADD-ON NAME HERE}?Pretty much same answer, slightly modified. The vibrance of the add-on community is what brought me here, and I want to know as much as the next guy, but this is specifically for discussion of building with the SDK. Most devs have their own forums or other places to get news about what's going on, and most posts on the topic here would just be speculation. As stated before, I can't imagine anything that an add-on is currently doing that can't be done in SimConnect, so I trust that we'll see plenty of good stuff going forward.Who am I?I understand that I'm not really established in this community, so I'll take a minute to let you guys know who you are talking to. My name is Brian, I live in Alexandria, VA, USA. I'm a 26 year old system administrator and web programmer, and I have been programming little video games in C++ and DirectX for about eight years now. Currently, I am working on a default AI replacement for FSX using SimConnect in managed mode. The codename of the project is Icarus, and I hope to implement all of the things that people have been asking for from the AI in Flight Simulator.Now, after all of that, if you have questions, let me know in this thread and I'll try to get them answered for you.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Thank you, Brian. Mikewww.mikesflightdeck.comwww.mikesflightdeckbooks.com

Share this post


Link to post
Share on other sites

No problem.I've been really amazed at how forward Microsoft has been in communicating and being accessible to developers, even ones that aren't established, like myself. So I figure it's our duty to move that forward by sharing as much as we can with each other.Also, it says HTML use enabled next to my reply box here, but it doesn't seem that my bold tags are working.

Share this post


Link to post
Share on other sites

Great post. I agree the Simconnect SDK is great!Looking forward to Icarus. Need a beta tester? :)Hope you can incorporate SIDs/STARs.Speech to text (ie using SAPI) is also a good option. Many high quality voices available from Cepstral (www.cepstral.com)With dual core now becoming common place I dont see any performance problems.What do you think?Dont go down the RC4 route with prerecorded WAV files. Too hard! Just support text to speech.

Share this post


Link to post
Share on other sites

Hi,One thing I'm curious about:If one would write gauges (thus running inside FS), can that be done also with managed code (C#) or is that still only possible with C/C++ ?

Share this post


Link to post
Share on other sites

One question, when I use FSUIPC in my application to interface with FS9, all users of the application need to install FSUIPC (free version). If I now switch to SimConnect, will they also need to install SimConnect?

Share this post


Link to post
Share on other sites

>One question, when I use FSUIPC in my application to>interface with FS9, all users of the application need to>install FSUIPC (free version). If I now switch to SimConnect,>will they also need to install SimConnect?>>SimConnect is built in to FSX, so they don't have to install anything but the simulator. They may have to get the update from the FSX website if you are using a newer version than they have.They only have to install anything extra if they want to work on their own development.

Share this post


Link to post
Share on other sites

>Also, it says HTML use enabled next to my reply box here, but>it doesn't seem that my bold tags are working.Hi Brian... use square brackets for bolding text... or italicizing text... ;)

Share this post


Link to post
Share on other sites

Thanks, I figured it was like that, I just didn't see any reference to it on the reply box.My newbie-ness is showing.

Share this post


Link to post
Share on other sites

> Thanks, I figured it was like that, I just didn't see any > reference to it on the reply box.>> My newbie-ness is showing.Sure there is. ;)See the [a href=http://forums.avsim.net/dcboard.php?az=faq]FAQ[/a] link above? :) Click it and scroll down to the User How-To FAQ and click on [a href=http://forums.avsim.net/dcboard.php?az=faq&t_id=uh_faq&q_id=15]How do I use HTML tags in my messages?[/a]I'll save you the time of looking.Instead of angle brackets <> use square brackets [] in your message. The administrator has the option of disabling html tags for the board.BTW, just posting this just to poke fun. :) I made the same mistake on my first attempt at an HTML post. ;)On a more serious note, SimConnect is gonna be awesome to use. I can see some great things coming down the pipe. :) Thanks for the extensive post, Brian.

Share this post


Link to post
Share on other sites

I took a look at Cepstral, they certainly have some good voices, but those licenses can be expensive. I'd probably have to start with one and then add updates over time.And, yes, eventually I will need beta testers, and you will be on the list. At the moment, I'm just happy that I can put planes in the sim and make them do what I want them to do (pretty much).The big part is all the logic that the controllers will take on. Yes, I plan on supporting SIDs/STARs. There's a lot more, but this isn't my own personal advertising space, so I'll just plug my development blog that I'm putting up tonight in my sig, and cover my whole evil plan there.The question is, though, since it relates to development:Why not prerecorded voices? Is it just the time requirement to produce them?

Share this post


Link to post
Share on other sites

Hey, he who can't laugh at himself leaves the job to somebody else, right?Do you think there would be interest in a simple tutorial running down the creation of a basic SimConnect project?

Share this post


Link to post
Share on other sites

>Do you think there would be interest in a simple tutorial>running down the creation of a basic SimConnect project?Yes please!! :-)

Share this post


Link to post
Share on other sites

Wow, pretty neat (Cepsral)! Could this be used to more easily record new voices for ATC?

Share this post


Link to post
Share on other sites

Ah, yes....I used Cepstral to record the first wav file for my first FSX mission. Sexy Stewardess: "Hello, Captain. You are SO sexy! Coffee, Tea or Me?"Soon after the plane crashes. I haven't been able to get it to record passenger screams yet.

Share this post


Link to post
Share on other sites

>Wow, pretty neat (Cepsral)! Could this be used to more easily>record new voices for ATC? Well, they are all TTS files, so I don't know how well that would work for the default ATC. And they cost quite the pretty penny.

Share this post


Link to post
Share on other sites

Oh yes! The interest is there!Mikewww.mikesflightdeck.comwww.mikesflightdeckbooks.com

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this