Jump to content
The simFlight Network Forums

Viewpoint variables


Recommended Posts

Hi

I noticed the viewpoint variables (0x5B0 and 0x5D2) recently. Now if they could be written to (SDK-17 doc says they're read-only) it should be fairly easy to create something like ActiveCamera.

Although what seems to be missing is a viewing angle in the vertical/pitch plane. Currently the SDK lists a 3D position (lat,lon, altitude) and a view direction which I presume is the direction in the horizontal plane.

I'd be interested in hearing if you find a way to make the variables "writeable".

Cheers

Link to comment
Share on other sites

I noticed the viewpoint variables (0x5B0 and 0x5D2) recently. Now if they could be written to (SDK-17 doc says they're read-only) ...

They are actually 'original' Global.DLL values, unmapped by FSUIPC, still in the same place over several FS releases. FSUIPC doesn't stop you writing to them, but I don't think that does you much good. Have you tried? Let me know if you can make it do anything.

... it should be fairly easy to create something like ActiveCamera.

True, though without hacking ActiveCamera I don't know how it does it. I'm not going to hack into someone else's program to provide methods to bypass their code. That's unethical as well as technically illegal.

Although what seems to be missing is a viewing angle in the vertical/pitch plane. Currently the SDK lists a 3D position (lat,lon, altitude) and a view direction which I presume is the direction in the horizontal plane.

It seems to be. I added these only because someone else told me about them.

I'd be interested in hearing if you find a way to make the variables "writeable".

Since ActiveCamera already does such a good job, I know not how, this isn't really an area I would dedicate time to. Sorry. Let's solve new problems, not try to reproduce other's solutions, eh? :wink:

BTW have you tried any of the "Eyepoint ..." controls FS offers? Don't they do anything useful?

Regards,

Pete

Link to comment
Share on other sites

FSUIPC doesn't stop you writing to them, but I don't think that does you much good. Have you tried? Let me know if you can make it do anything.

I tried (using FS2002) writing to viewpoint angle variable but it had no effect. On subsequent reads of the variable I would see the value I'd written, but there was no visual difference in FS2002.

I tried changing the view option in FS in case it only worked in certain views like virtual cockpit etc., but that made no difference.

So I guess either the write isn't working, or maybe there is some other variable that has to be written to first to enable the view changes?

Since ActiveCamera already does such a good job, I know not how, this isn't really an area I would dedicate time to. Sorry. Let's solve new problems, not try to reproduce other's solutions, eh?

If your platform (FSUIPC) supported this then yes it would enable other developers to produce direct competitors to ActiveCamera, but it would also open the possibility of some developer coming up with a new and innovative add-on using these variables :wink:

Cheers

Link to comment
Share on other sites

So I guess either the write isn't working, or maybe there is some other variable that has to be written to first to enable the view changes?

Unlikely. Most everything in FS nowadays is procedural -- I actually have to monitor the writes to many many things and use the written data in parameters to calls into assorted FS DLLs. The problem is finding the right place and the right parameters for each need. It is made extremely complicated also by the fact that much of the code is now Object-Oriented C++, not the original ASM + C of FS95/98, and many things are inherited or polymorphed or otherwise OO-ised, necessitating finding the right pointers to the right structures/tables beforehand in each case. Sometimes an apparently simply thing takes several calls to several hacked entries in several different DLLs. Ugh.

If your platform (FSUIPC) supported this then yes it would enable other developers to produce direct competitors to ActiveCamera, but it would also open the possibility of some developer coming up with a new and innovative add-on using these variables :wink:

Yes, but when there's so much else to do in any case, trying to solve the same problem someone else has solved already is wasteful and not enticing. The quickest way would be for me to find out how ActiveCamera does it, but that is against my principles as well as wrong. Sorry.

If the ActiveCamera author wants to volunteer the information "for the common good", then that is another matter. I can add stuff in that folks tell me about. That's how a lot of the stuff got in there in the first place, starting back in FS95 or even before.

Regards,

Pete

Link to comment
Share on other sites

Hi

I actually have to monitor the writes to many many things and use the written data in parameters to calls into assorted FS DLLs.

....

Sometimes an apparently simply thing takes several calls to several hacked entries in several different DLLs.

How do you figure out what FS DLLs to call into etc.? The only documentation I've come across from MS in terms of an SDK is for the gauges SDK.

Or is it just trial and error by looking at the exported functions and classes exposed by the various FS DLLs?

Cheers

Link to comment
Share on other sites

How do you figure out what FS DLLs to call into etc.?

Disassembly (I use IDA Pro and PE Explorer) and Debugging (Soft-Ice mainly, MSVC Debugger and WinDebug for some things). In other words what used to be called "hacking", though that term has now come to mean, more usually, breaking into Internet or other on-line resources. I don't do the latter at all. :)

It's hard work and takes a loooonnnngggg time! Thousands of hours goes into finding stuff in each release -- and it gets harder now they use C++ and COM a lot, the assembly code that produces is awfully convoluted. :roll:

Or is it just trial and error by looking at the exported functions and classes exposed by the various FS DLLs?

Not that easy. Much of the stuff I need isn't exported at all, even by the old FS5-type linkages which have always been the mainstay. I have to find not only the routines but also the correct "this" pointers to stuff into their "this" register (sometimes ECX, sometimes not!). Same with data -- in C++ there's not such a big distinction between data and code, it's all wrapped up tight in the protective black boxes they call "objects" these days. Ugh. :x

I am at heart and by history an Assembler level programmer. C is about as far away from the nuts and bolts as I like to get. The sort of code produced in the name of Object Orientation is totally alien to me and makes me shudder! :(

Regards,

Pete

Link to comment
Share on other sites

In other words what used to be called "hacking",

Or "reverse engineering" :wink:

I've done just enough disassembly to know how painful it can be :shock:

This is more than likely a FAQ, but does anyone know why MS don't provide an SDK offering access to the set of variables you support etc.?

Given the number of interesting MSFS add-ons using your fsuipc, e.g. Project Magenta etc. and even my upcoming add-ons :wink: you'd think MS would want to support and encourage such development by providing a full-featured SDK, rather than relying on you dissambling their stuff to provide a public sdk.

Cheers

Link to comment
Share on other sites

This is more than likely a FAQ, but does anyone know why MS don't provide an SDK offering access to the set of variables you support etc.?

Given the number of interesting MSFS add-ons using your fsuipc, e.g. Project Magenta etc. and even my upcoming add-ons :wink: you'd think MS would want to support and encourage such development by providing a full-featured SDK, rather than relying on you dissambling their stuff to provide a public sdk.

Right at the beginning of the FS2004 Beta phase, or even a bit before, if I remember correctly, MS did ask if I could produce a specification of what I needed, so they could produce a proper interface module. I was a bit taken aback, but quite pleased. So I responded with the Programmer's Guide I'd produced -- "look, these are all the things folks use at present. that's a start. But there will be more ...". They said, "... but we need an inclusive list". I said that there's no way it can be "inclusive" because there's always something else, some new application or need. I can't predict what that may be. You just have to look at the changes in the Programmer's Guide from version to version to see that -- when compared with what was available in FS98 it is astonishing what's been added.

Not only that, they said that even if we agreed on some specification of the data needed, it would be AFTER release date before they could even start to look at it, and after the revised SDKs they normally produce as well, most likely. So, at that rate, maybe we'd be lookng at something soon, maybe by Summer or Autumn this year.

I reckon that even if we'd agreed something, it would have had to be cancelled. The pressure on the MS team for ongoing developments is quite heavy, it's a small team, the SDKs are voluntary (not committed), and they will certainly have started working on FS2006 (?) by now -- it's Alpha testing will be starting in not so many months.

The best bet for something more successful would have been if they could have put me on a sort of "trusted outsider" status (with an NDA of course) and let me see the header files and internal interface details. Some of the team thought that would have been a good idea, but management would never has stood for it. Then, when I found I had to go semi-commercial (reluctantly forced by changed circumstances), that was most definitely not an option for them and presumably will never be again.

Regards,

Pete

Link to comment
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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.