February 5, 200620 yr Hello,I am trying to write a simple application that should connect to Flight Simulator multiplayer session and feed position of one ore more aircraft to it.I am a newbee to DirectPlay. I am trying to act according to the DX 7 SDK and FS2002 MP SDK. At this point I am stuck trying to get the flight simulator session with EnumSessions(). I am using one of the examples from DX SDK as a starting point. Two instances of this app are able to connect to each other. The problem is they don't list flight sim session in the enumeration, although I think I've got the correct GUID.Can there be an issue with network ports? The flight sim mentions port 23456 in its multiplayer dialog. Do I need to specify this or some other port when initializing ServiceProvider?Is there anyone around who could help me? Any working examples that connect to MS Flight Simulator?Regards,Alexei
February 6, 200620 yr On the second thought, I am not sure, which DPlay interface I should use. I am working with FS2004, while the Multiplayer SDK is written for FS2002. It states that DX 7 (i.e. DPlay 4 interface) is to be used. Is there any chance FS2004 works with newer DPlay interfaces?
February 9, 200620 yr Well, I made a little progress since my first post. It turns out that I need DirectPlay8 Interface (included in DirectX 9.0) to connect to FS2004. At least EnumHosts() from DPlay8 returns the MSFS session, while EnumSessions() from DPlay4 didn't work. However, now I am stuck again: when I call Connect() it returns "host rejected connection". When I examine the message MSGID_CONNECT_COMPLETE I don't find there any hint as to why it was rejected.Actually, up to this stage the only items specific to FS were its GUID and port number. All steps in creating a DPlay connection are generic. But now I'm lost, since I have no multiplayer SDK for FS2004 and the SDK for FS2002 seems to be very incomplete and at least partly unapplicable to FS2004.I wonder, is there really no SDK for FS2004 multiplayer interface? How all existing multiplayer addons (like VATSIM software, FSHost, and others) were made?? Where the developers got all the info??? :-hmmmRegards, Alexei.P.S. At the time of writing this I have already found the FS2004 Multiplayer SDK. Don't know why it is not present on the official M$ site. Well, now I've got something to work with...
February 17, 200620 yr Not sure what you are doing with MP - but you might want to check out the FSVPI.com interface (Flight Simulator Virtual Pilot Interface). It is easy to use - but is also payware for users.Another option is FSInn - which I am currently beginning to explore as an alternative having heard good things about their progress.Senior Captain, Pier Glass Aviation
February 22, 200620 yr Thanks for the answer and the advice. I will rather explain what are my intentions with MP. What I am doing is trying to connect an external simulation to MSFS. That is, I have my own flight dynamics model, I solve equations of motion in my application and feed the aircraft position and attitude to MSFS in real time, whereas MSFS serves only for visualization of the flight. Actually, I know a couple of ways to do this for the case of a single aircraft: either using FSUIPC or the Flight Video feature of the FS (as described in Netpipes SDK).At present I need to drive several aircraft from my external application, and I don't see any other way to achieve this, but to use Multiplayer interface. So you see that any MP client software that needs FS on both sides of the session is of no use to me. Moreover, I don't need all the extra features like ATC, weather, radars etc. FSVPI is very close to what I need; however, it also does plenty of extra stuff, like allowing what they call "several levels of software" for controlling the aircraft and guessing how the aircraft should move based on aircraft.cfg or some other data. FSVPI would also restrict me to sending 4 position updates a second, whereas the MP interface itself should allow more frequent updates. There should be no problem with sending 10 or so updates per second as I am going to have no more than 2-3 players, all on a LAN or even on a local machine.Using the MP SDK for FS2004 (I still wonder why it was not to be found on the Microsoft website) I have been able to make some more progress. After all the guessing that had to do (bearing in mind the quality of the SDK), I am finally able to connect to the MP session and receive messages from the FS. My problem at present is that MULTIPLAYER_PACKET_ID codes as defined in the SDK seem to be incorrect. The contents of the packets I receive from the FS doesn't match their IDs and the packets I send are apparently misinterpreted by the FS because of the wrong IDs; consequently the FS does not recognizes my player as a "Player" (contrary to "Observer").Originally, I had no intention of implementing the features of MP host, since I planned that the session would be hosted from the real FS and my app would connect as a peer. One way to discover the correct messages is to pose my app as a host, make the FS join the session and see what messages it sends me. However, I will much appreciate if anybody can save me this work. I am not sure this is only a matter of incorrect MULTIPLAYER_PACKET_ID, but if anybody can confirm that the IDs in the SDK are incorrect and has the correct definition, that would be of great help.Alexei
March 6, 200620 yr Ah, and here you have rightly hit the nail on the head. M$ is so secretive they can't see the tremendous growth their sim could have if they would just open up their software. They keep us developers in the dark - even mislead us - make someone peek and poke every byte to figure out what each does. What a WASTE of time. what wonders we could accomplish if we could *collaborate* with MS. it is not to be when dealing with the juggernaut.I understand what you are saying. Unfortunately, I don't have time to get into the gory details of FS. FSVPI suits my needs, thankfully!You might check FSInn folks... I'm just starting my investigation as to what they might be able to offer. I do know that they use "AI" aircraft somehow "tricking" the interface so they control more aircraft and at faster update rates.Good luck!Senior Captain, Pier Glass Aviation
April 8, 200620 yr A little update - FSInn appears to be "one pilot:one_sim:one IP address". So out of the box I cannot make my sim pretend to be a FSInn since I have many "pilots:oneIP address".Senior Captain, Pier Glass Aviation
May 11, 200620 yr Well, actually I have managed to get multiple players in FSInn - all you have to do is assign a different socket to each platform.However, getting the correct platform to show up is totally another thing. Apparently VATSIM has put a strangle on all 3rd party developers by forcing the FSInn/Squawkbox guys to pull their source code off the internet. (Why else is it missing????)I know that FSInn uses a repository and how the aircraft ids are created. But the code to actually transmit that ID is missing. Perhaps a packet sniffer will help to find out what message is actually being transmitted, since it doesn't seem to be going through the FSD.Senior Captain, Pier Glass Aviation
May 31, 200620 yr Well I did put a packet sniffer on the ports and discovered, that, sure enough, FS2004/FSInn talks directly with MCDU.org to obtain the aircraft ids. (These ids are also available in your own registry). However, how that info is passed on to the rest of the world still eludes me. I hate to redo the wheel, but I am getting no response from the MCDU folks...Senior Captain, Pier Glass Aviation
Create an account or sign in to comment