Problem Problem With atmospheric parameters.

Apokliptico

New member
Joined
Feb 11, 2009
Messages
31
Reaction score
0
Points
0
Location
Behind The firewall
Hi! Well, i wanted to change the atmospheric parameters in the .cfg file of Mars (I have the Mars 2060 addon installed), to add more atmospheric density and pressure. I changed it everywhere, and when I start orbiter, in the "Objects" menu, it says that the changes have been made. But when I go to mars, I realise that the atmosphere is still in 600 pa and the density 0.02! Why is that? How can I change it??

Thanks a lot...
 

Tommy

Well-known member
Joined
Aug 14, 2008
Messages
2,019
Reaction score
86
Points
48
Location
Here and now
I'm not sure about that particular add-on Mars, but it may have atmospheric values hardcoded into a .dll. I'd check and see if there's a "Mars.dll" or something like that. It may also have a different .cfg, perhaps in a "modules/2060/planets" folder or something like that.
 

Apokliptico

New member
Joined
Feb 11, 2009
Messages
31
Reaction score
0
Points
0
Location
Behind The firewall
Okay, but the problem is not with the mars 2060 addon, I found the mars.dll how can i edit it so I can finnaly have my 40 Kpa atmosphere in mars??? Can I recompile it from its original source?
 

Tommy

Well-known member
Joined
Aug 14, 2008
Messages
2,019
Reaction score
86
Points
48
Location
Here and now
Can I recompile it from its original source?

Yes, providing that you have the original source code, and know enough about programming to figure out what to change.

Unfortunately, I'm not at home, so I can't download that add-on and see what all it changes. Check one of the scenarios (in a text editor) that came with it and see what the System line shows (near the top of the scenario file). If it says something like "System - Sol2060" then the config file that it's using for mars may be in a different subfolder of the config directory.

If no-one else can help, I may get a chance to check into this more tomorrow.
 

Apokliptico

New member
Joined
Feb 11, 2009
Messages
31
Reaction score
0
Points
0
Location
Behind The firewall
I repeat, the Mars 2060 addon only changes the textures, the mars.dll is the original file. How can I recompile it? where is the source? I know c++
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
I repeat, the Mars 2060 addon only changes the textures, the mars.dll is the original file. How can I recompile it? where is the source? I know c++
The code is not available, AFAIK, being part of the Orbiter core. If you get the Orbiter SDK though, you can make your own planet. The document API_Guide.pdf (in the SDK) even tells what parameters are used for Mars.

To compile addons for Orbiter you will need MS Visual C++. There is a free version available that will do the trick and a guide for setting it up:
http://www.orbiterwiki.org/wiki/Free_Compiler_Setup
 

Apokliptico

New member
Joined
Feb 11, 2009
Messages
31
Reaction score
0
Points
0
Location
Behind The firewall
I tried to make my own with my VC++ 6.0 but I couldn't, its just too hard, I'll try later with dev C++...

Is there any example code of a planet? so I can see how it's done...
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
I tried to make my own with my VC++ 6.0 but I couldn't, its just too hard, I'll try later with dev C++...

Is there any example code of a planet? so I can see how it's done...
You will need Visual C++, otherwise Orbiter will not be able to load your object from the DLL file. This is because Orbiter was compiled with Visual C++ and all compilers use different name mangling.
 

willy88

Tinkerer
Addon Developer
GFX Staff
Joined
Nov 19, 2007
Messages
856
Reaction score
3
Points
18
Location
The Cosmos
If my limited knowledge to how Orbiter works is correct, it is impossible to hardcode a planet into a DLL. The Mars 2060 add-on probably uses a different solar system or something.
 

tl8

Addon Developer
Addon Developer
Tutorial Publisher
Joined
Oct 16, 2007
Messages
3,645
Reaction score
25
Points
88
Location
Gold Coast QLD
If my limited knowledge to how Orbiter works is correct, it is impossible to hardcode a planet into a DLL. The Mars 2060 add-on probably uses a different solar system or something.

No you can hardcode a planet into a DLL

Trust me ;)
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
If my limited knowledge to how Orbiter works is correct, it is impossible to hardcode a planet into a DLL. The Mars 2060 add-on probably uses a different solar system or something.
I'm looking at the API docs and they include a whole section on writing planet DLLs, so I think it would be OK to try ;)
 

Apokliptico

New member
Joined
Feb 11, 2009
Messages
31
Reaction score
0
Points
0
Location
Behind The firewall
Quote:
Originally Posted by Apokliptico
I tried to make my own with my VC++ 6.0 but I couldn't, its just too hard, I'll try later with dev C++...

Is there any example code of a planet? so I can see how it's done...


You will need Visual C++, otherwise Orbiter will not be able to load your object from the DLL file. This is because Orbiter was compiled with Visual C++ and all compilers use different name mangling.

That's becouse VC++ sucks in compatibility, it doesn't use code::blocks or anything, but is very useful so it doesn't matter... Oh, and Mars 2060 for the third time, uses the same dll becouse it only changes the textures!.

If my limited knowledge to how Orbiter works is correct, it is impossible to hardcode a planet into a DLL. The Mars 2060 add-on probably uses a different solar system or something.

It's not impossibile... in fact, i think is quite easy if you know some inverse engineering and hard core asm programming (which i don't).
Quote:
Originally Posted by willy88
If my limited knowledge to how Orbiter works is correct, it is impossible to hardcode a planet into a DLL. The Mars 2060 add-on probably uses a different solar system or something.

No you can hardcode a planet into a DLL

Trust me ;)

How about you tell us how it's done?

Quote:
Originally Posted by willy88
If my limited knowledge to how Orbiter works is correct, it is impossible to hardcode a planet into a DLL. The Mars 2060 add-on probably uses a different solar system or something.

I'm looking at the API docs and they include a whole section on writing planet DLLs, so I think it would be OK to try ;)

I've already tried unsuccesfully, maybe I should try with VC++ 2005, but I just can't understand what should I code in each function, is there any good tutorial? maybe some example code??

Thanks!
APOKLIPTICO
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
That's becouse VC++ sucks in compatibility, it doesn't use code::blocks or anything, but is very useful so it doesn't matter...
This is nothing to do with VC++ sucking (or not), or Microsoft not complying with some standard. It is because of the lack of a name mangling standard. All compilers use different name mangling schemes, check it out:
http://en.wikipedia.org/wiki/Name_mangling#How_different_compilers_mangle_the_same_functions

Different compilers will produce incompatible DLLs if they are exporting C++ code. The only way around this is to export everything as C (by using extern "C") but this complicates the API because C doesn't support cool C++ stuff like classes and function overloading. You could ask the good Doc (aka Martin Schweiger) to rewrite the API to get around this but I wouldn't expect a sympathetic ear. Personally, there are other features I would prefer him to work on.

Oh, and Mars 2060 for the third time, uses the same dll becouse it only changes the textures!.
I know, I read that the first two times, hence my suggestion that you write your own Mars.dll ;). If you want to change Mars' atmospheric model, the only route is to write your own code and substitute it for the default dll.

It's not impossibile... in fact, i think is quite easy if you know some inverse engineering and hard core asm programming (which i don't).
You would need that if you wanted to reverse engineer (not inverse, which would be quite something else) the default Mars.dll but I really think it would be easier to write your own in C++. Those I know who know reverse engineering would rather avoid it if they can.

How about you tell us how it's done?
I can't but it looks like the API docs can. I don't think anyone has produced a tutorial or anything for coding a planet (I can't find one, anyway).

I've already tried unsuccesfully, maybe I should try with VC++ 2005
This should be your first step, see my comments above.

but I just can't understand what should I code in each function, is there any good tutorial? maybe some example code?
None that I know of. Do you have any specific questions?
 

Apokliptico

New member
Joined
Feb 11, 2009
Messages
31
Reaction score
0
Points
0
Location
Behind The firewall
Okay, i've resolved all of the problems by editing the includes from orbitersdk, but one:

It keeps saying "`DLLCKBK' does not name a type "

On the line:
Code:
DLLCKBK CELBODY *InitInstance (OBJHANDLE hBody)
Why? what should I do?

PD: Ohh! I found it!! there's a mistake in the API_Guide document DLLCKBK it should be DLLCLBK

Okay, i made it! it compiled, but now what should I do? can someone plz post an example source of a planet???

PD 2: Has anyone made a planet from scratch ever?? Becouse the ephemeris functions are extremely difficult to understand, I don't have a clue how can I code them...
Can anyone help me plz?
 
Last edited:

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
Anyone???
I can't help you if you want to use the VSOP87.dll that the Orbiter planet modules use for their ephemeris calculations - I can't find any documentation on the interface for that DLL.

Why don't you leave the ephemeris calculations out of the module altogether and use Orbiter's state propagation instead (see EllipticOrbit and HasElements parameters in Orbiter.pdf), either dynamic or analytic? Just don't declare bEphemeris, clbkEphemeris and clbkFastEphemeris in your planet's class and put the orbital elements in the cfg file (you can find those here: http://nssdc.gsfc.nasa.gov/planetary/factsheet/marsfact.html).

If you really want to do your own ephemeris calculations, cjp & I have been working on a project called the Kepler Orbital Simulation Toolkit (KOST). This won't provide you any better calculations than Orbiter's own analytic state propagation though, since it uses the same technique. KOST is not ready for release just yet, but it is close.

If perturbations to Mars' orbit are really important to you, you could make your calculations based on VSOP87 data. You can get VSOP87 data here:
ftp://ftp.imcce.fr/pub/ephem/planets/vsop87/
 

Apokliptico

New member
Joined
Feb 11, 2009
Messages
31
Reaction score
0
Points
0
Location
Behind The firewall
You're right!!, nooo I don't care about mars orbit perturbations, I just wanna change the atmosphere parameters...

Okay, it compiled just fine, but orbiter keeps crashing...

PD: I think the problem is something else, I think is time to remove all the garbage on orbiter and reinstall it...

PD2: Solved the crash problem, a faulty cfg file. But now I have another crash problem, when I try to set the course with attitude MFD to mars, the game crashes... Are you sure I can leave those three functions undeclared?

PD3: It worked!! after all of this trouble, i've finnaly made it work.

Thanks a lot for all your help!
 
Last edited:
Top