June 27, 200421 yr Hi there!I'm new here and didn't read a lot of threads yet, so please forgive me if I'm waking up sleeping dogs here. I'm not an airplane pro either, I'm more or less playing FS2004 to learn about aviation, and for the fun of course :)Now, I have seen that there are some modules that can be integrated into FS2004 (like FSUIPC or however it's spelled). Those modules made me think of adding gameplay features to FS2004. Actually I have a pretty clear idea of what I want to add: I want a product stock for every airport. Okay, that's not very fancy for a start, but these features could give FS2004 a whole new dimension... You come to an airport, open up the module, select which products you want to load into your plane and then fly them to a destination airport that would like to buy those products. I've thought quite a lot about this and can imagine that it's possible to implement this including all the fancy stuff with money, changing product stock, changing prices and so on. Actually, I'd love to see this in a multiplayer version - not necessarily seeing all other players, but having shared product stock information, so if someone sells the kind of product you've loaded at the airport your flying to before you get there, the price they'll pay will drop and you won't earn as much, etc... What would be really nice would be a limitation on aircrafts, like starting out in a cessna and buying bigger ones when you've earned the money (the game server could hold the information and won't let you fly if you've loaded a different plane in the simulator).Well, I'm sure that it's not only me who'd like to see something like that for FS2004; However, I have a big problem. Not what you might think, I'm an experienced software developer (currently approaching my masters in computer science for those interested). The problem is: Where the heck has MS hidden the documentation?!? I found a small sample (not by MS) that shows how to write a simple module (start and stop functions), but I have no idea how I can access the flight sim data (like current location, etc) within this module... Is it the same as within a gauge? Or will I have to wait until MS releases this information?Anyone here who has experience with that kind of thing?Thanks for reading me :)Wintifax
June 27, 200421 yr This is a wonderful idea. I've been thinking in the same direction. If you would add "persons" to the list of cargo to transport, you could have some interesting missions from smaller airstrips where you wouldn't find industry. Also, fuel prices should be considered. I know www.airnav.com has a database of current prices, so maybe this could somehow be incorporated. In my idea of a game module, I would like to have persistent aircraft. What I mean is, you could hire an aircraft, and if you have enough money, you could buy one. You could then make it available to people who do not have enough money to buy one yet, but are willing to hire your aircraft. Ofcourse, after a certain amount of airtime, you'll need to service your aircraft. This idea, combined with the cargo movement, would be a really interesting idea.I am a programmer myself, but I mainly program unix stuff. I could create a server (I wrote the vatsim servers), that the game module uses to find out what cargo needs to be transported and possibly keep track of the users aircraft.
June 27, 200421 yr Yes! That's wonderful input! Fuel prices and Aircraft Rentals are a great idea. I was thinking of persistent aircrafts too, but I don't know how good that's possible within FS2004... The user has a lot of buttons and knobs to "cheat" (like on refueling and instrument failures), and I don't know if a module can catch all of those. Of course Persons would be a kind of cargo too, so virtual airlines can make up flight routes where there's usually a lot of passengers to fly and they'd have to actually adjust the plane for the weight that changes with the amount of passengers.And why just rent planes? What about hiring pilots... Virtual airlines would sure love this feature, hehe. Oh and yeah, I'm from the unix world too (well dos+unix.. console world), currently working on a game server for a tilebased mmorpg. It's not in a stage that I could show to others yet, tho. But I'm fine with writing windows DLLs, too. However, it would really rock if someone else could write the server, so I can concentrate on the module.... And then think about having this built into the vatsim servers... Real ATC, actual air traffic plus real cargo.I'd love it, hehe.Wintifax
June 27, 200421 yr Oh wow, I just found this thread on here:http://forums.avsim.net/dcboard.php?az=sho...id=17862&page=4varjupe referred the author to http://www.flightdecksoftware.com . They have FDSConnect there which enables other applications to read the FS2004 Memory and thus all the variable values. And the best thing: They've included an SDK showing the implementation of the whole thing, which means I'll have to start coding tomorrow, hehe.Greetings,Winti
June 28, 200421 yr Basically there are two ways to create an addon. The first one is a module (a dll file in the flightsim modules directory). This offers the closest integration with flight simulator. The second one is an external application that connect via fsuipc or fdsconnect. I don't know if you can read anything other than aircraft attitude/states. Maybe the second approach would be the best. You would need an extract of the flightsim airport database to map lat/lon into a ICAO airport code. I don't think you need to consider people playing unfair. You might do a small check for fuel jumps (increase or decrease by more than 1% per second could signal cheating). If a pilot crashes his plane, I would simply cancel the flight (too easy to rent someones aircraft and crash it). Rent prices should be adjustable. The best to do this would be a website where you can do maintenance. Let me know if you need any help, you can also mail me at [email protected]. I would love to create something like this.
June 28, 200421 yr Peter Dowson (FSUIPC) also has an SDK - http://www.schiratti.com/dowson.htmlW. Sieffert Bill Sieffert
June 29, 200421 yr Okay, yesterday I got to play a bit and created a small testmodule; It's a real pain in the arse to get the windows to show right and hook those menus in there, but I think I'm on a good way. Today/Tomorrow I'll do some research on the sim variables that I can access, but it looks like I should be able to access whatever a gauge can access... So more or less everything. It's not like there's any documentation for this, I have to extract the info from the gauge.h file that comes in the panels sdk, which really is an fs2k file that's been adapted to fs2k4. The two external solutions FSUIPC an FDSConnect are no option for me, the first because of being payware and the second because of limitation in functionality. So I'll see how it goes... If I find a convenienty way to access all the sim variables I might put together a header file for the future.Greetings,Christoph
June 29, 200421 yr Aah, yeah, I think I've found everything I need. I can read all simulator variables described in TokenVar.doc in the Panels SDK, which is just about everything one could want to know (even GPS waypoints, etc). Sadly there is no variable that holds "AtAirport" info, so I would know where the plane is. Of course theres longitude/latitude information and a DistanceToNextGPSWaypoint variable. The latter would be easy to use, but doesn't work without a flight plan, I guess. The builtin airport database doesn't seem to be accessible, although I'll investigate on this. GreetingsChristoph
June 29, 200421 yr I hope there is a list of closest airport available. Otherwhise, you'll need to extract a database from fs2004 with airport lat/lon codes. That would be CPU intensive. Also, I'm not sure what sort of networking is available from a fs module. If you want to be able to rent aircraft to others, the module will need to contact a server somewhere. The easiest way is to use http for that, but at least TCP/IP networking should be available.
June 29, 200421 yr About the network: A module is just a Windows DLL, so I can include whatever I want here. TCP or UDP are no problem, I'm quite familiar with those. I'm sure there's HTTP code somewhere in the windows libraries too, so that shouldn't be a problem either, as long as I can find the docs...A nearest airport list would really be nice, but so far I haven't found a way to obtain one, although there must be a way to get it, since the GPS panel can display one. I found someinteresting function names in the util.dll in the modules folder (comes with it) that might be helpful, but of course there's absolutely no documentation available for those (can't even find out the parameter types).Currently I think that it must be possible to get all this info via the gps_exports.dll since the GPS can display everything related to airports, but that one doesn't have an export table that I could read. There is a gps_info.h header file included in the panels sdk that seems helpful, but it doesn't have any nearest airport lists either. I don't think that the GPS pages are entirely drawn by FS itself, so there should be a way to get to this data, but as of now I've not yet found one. Tomorrow I got to write an exam, so I got to study some today, but I can start thorough research on this topic tomorrow afternoon.I've been thinking of a fallback solution too: When the user clicks some button, signalling that he wants to trade with the nearest "CargoPort" it just sends his long/lat values to the server, which then checks what's the nearest airport and if he's close enough (the server would have a lot more resources for checking against a database and could probably cache parts of the data).Of course before that the module would do sanity checks like Aircraft_on_ground?, speed=0?, break=on?, etc.Probably someone else already knows how to get a nearest apt list... those guys should drop me a line please :)GreetingsWinti
June 30, 200421 yr The ATC menu somehow gets a list of nearest airports when you select "closest airports". I don't think it gets this from the GPS, so maybe there is a function available to do this. As far as I know, the GPS's in fs2004 are gauges written in C++. They use a common library and somehow communicate with the scenery engine to extract airport/navaid data, but they do their drawing themselves. In fs2002, the GPS addon I bought came with an external initialisation program. I think this program extracted airport/navaid data for the GPS. I hope fs2004 has a better way to do this.I've also thought about submitting lat/lon to a server. To problem with this is that you won't be able to use third party scenery of airports that are not yet is the default fs2004. Also, the system becomes dependant on the server, so a network or sever failure completely disables it. A better approach would be to make the system work offline and make an "online" mode, to synchronize fuel prices and make aircraft renting possible. In Vatsim, we used a line based ascii protocol over TCP for perfomance. In this system, communications are more "message" based, i.e. there doesn't need to be frequent updating. Therefore http is probably best. Using stock Win32 calls, the OS will transparently use any proxy settings, and will therefore cause less trouble for firewalled users.
June 30, 200421 yr You're right, I didn't think about the ATC Window yet. So far I've found out that there really are symobls for all those functions in gps.dll, but those aren't accessible in any documented way, although I'm sure there is a way to get a hold of them. At the moment I think that the gps.dll simply registers named variables (variables that can be accessed via a string identifying them). FS2k4 has this facility and makes use of it, but I didn't find out what strings are being used for those variables yet (It must be some kind of combination of "fs9gps", "NearestAirportCurrentICAO" (theres a lot more) and probably some more identifiers.)What I found out too: The Panels and Gauges SDK 2004 is *exactly* the same as the one that came out for the 2002 version, except for the trafficinfo addition and the captions in the documents. I think that the problem is at this point: the gps_export.dll that came with 2002 didn't export those functions because they weren't there, now they are here but the gps_export wasn't updated to reflect those additional variables. I've been doing some disassembling and code fiddling, but so far I couldn't find a way, but I'm still on it. Btw, did the 2002 version have something like the nearest airport feature, or a gps at all?What you suggest about the data exchange over http - yeah, I think that's an easy solution that could be implemented quickly. I think it wouldn't be very secure against cheating, but on the other hand the flightsim community isn't really about cheating, so I guess it'll be something like that as a first version. One really nice thing about it would be that other webpages for account management (aircraft rentals, etc) can be added very nicely.About refueling/resetting, etc: I think it shouldn't be a problem to simply disable those menus while the module is active, same thing for the keyboard accelerators (shortcuts). Although, I'd really miss the world map dialog, because I use it frequently to look up ILS frequencies, even if I don't want to relocate my plane.Greetings,Winti
June 30, 200421 yr FS2002 had a GPS, but is was a crude implementation, more like a moving map. The closest airports ATC function was available. I don't think http is less secure than other protocols. They key to anticheating is letting the module do sanity checks. Lago's FSmaintenance used a similar strategy. They allowed the map view, but checked for a difference in lat/lon between the opening and the closing of the map view. That's how it should work: let module set the fuel level, then check regularly to see how fast the fuel levels change. Same goes for the lat/lon position. Check lat/lon every minute -> calc distance travelled since last check -> divide by 60 and check against the planes expected speed. Engine time is simply accumulated at the server: After a flight, the module sends the engine-on time to the server and the server adds it to the plane's status. This project looks better every minute!
June 30, 200421 yr You might be interested by FSCopilot, it does exactly what you want to do + extras and that for GNU/GPL free(ware).We didnt release the SDK yet. But the engine exist and has already being released with some running samples.We plan to do a Load manager and a RPG style FS engine, but we are currently busy at other projects.Rather than doing or redoing it things alone, you can join us, we are building a FSCopilot devs community, so why not give a try.Our home is here : http://www.mcdu.comAnd my email is : benjamin(at)mcdu.comRegardsPS: BTW a Release 1RC1 is available correcting bugs in some addons, adding Sound to Pushback and now featuring a full GPWS.
July 1, 200421 yr Yeah, you're right, those sanity checks are important and I think it's possible to tighten the thing pretty much that way. But it's still possible to send bogus data to the server with a little helper application - surely not a common thing to do in the flightsim community, but experience from other games has shown me that people do the worst things if it's for #1 in any ranking... But that's still a thing that shouldn't be important at the moment, can always think about that lateron.I've been doing more research on the GPS functions, but so far no success... I disassembled the FS9 dlls and had a look at them; I'm absolutely sure that it is possible to get to that data, either via named variables or a c++ interface. Currently I think it's the named variables, because I found a lot of strings (that don't point to a memory address/sub routine) in the gps.dll. Those are named like the things that I want access to (NearestAirport*, NearestAirspace*, ...). I've been trying to access them, but I don't have any big success with named variables at all, especially when accessing them by name instead of ID. I think the actual names for the variables are some combination, like "FS9GPS NearestAirportItemsMax" or sometihng, but so far no success. I wish MS would give out a hint in their SDKs, but all there is, is the old FS2002 access structure, which must have been unsufficient even then (probably it's really from fs2k...). Anyone know a MS-Games developer support email?Greetings,Winti
Create an account or sign in to comment