Idea 2016 landing points from scenario

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
We have older addons that run fine, but they lack 2016 style landing points.
Also script vessels still don't' support them...

So what if we could apply them from a scenario ?

I'm thinking about having a phantom vessel that reads the necessary parameters and applies them to the target vessels when the scenario runs.

By parameters I mean something like:
VesselNameA PT1 PT2 PT3
VesselNameB PT1 PT2 PT3

What do you think ?
Is there any problem I'm not thinking about ?
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
Hi there,

I studied touchdown points a lot while developing MS2015.

I noticed that if we just use the points the default values for stiffness and damping often brings to instability or unexpected behaviour.

if it's just an issue of setting touchdown points to old vessel my first suggestion is a very simple plugin.

it can use a simple text configuration file as database for the points and then simply use the clbkNewVessel function so when the vessel is created it applies the correct touchdown points to the vessel.

It is indeed very simple so if you want I can give it a look and write it, it's gonna take 1 hour no more.

it can read either the vessel name or the classname of the vessel so if you want to change points to a specific vessel you can, but if you want to have the same points for all the vessels of that class you can as well.

Example of the text file:
Code:
[Atlantis]
N = 3
POINT_1 = 0 2.57 10
POINT_2 = 0 -2.57 10
POINT_3 = -3.5 -2.57 -1

[Deltaglider]
N = 4
POINT_1 = -8.5 -0.3 -7.05 1e7 1e5 3.0
POINT_2 = 8.5 -0.3 -7.05 1e7 1e5 3.0
POINT_3 = -8.5 -0.4 -3 1e7 1e5 3.0
POINT_4 = -8.5 -0.4 -3 1e7 1e5 3.0

(I used some random points and values). So for the DG you'll have 4 points with defined stiffness, damping and friction, while for the Atlantis the plugin will calculate them by itself using the equation of the damped harmonic oscillator (I have them ready)

and then the plugin will just look like in schematic non code
Code:
void clbkNewVessel(OBJHANDLE h_vessel){
  if classname of h_vessel == 1 of the element in the database
  Apply the touchdown points

else if name of h_vessel == 1 of the element in the database
Apply the touchdown points
return;
}

That's it, very easy.

If this is enough I can do it, just let me know

---------- Post added at 19:23 ---------- Previous post was at 16:42 ----------

a much,.... MUCH, easier way would be for the plugin to just have a folder in the config folder with a different file for each classname / vessel name... so Deltaglider.cfg inside the folder will just be:
Code:
N = 4
POINT_1 = -8.5 -0.3 -7.05 1e7 1e5 3.0
POINT_2 = 8.5 -0.3 -7.05 1e7 1e5 3.0
POINT_3 = -8.5 -0.4 -3 1e7 1e5 3.0
POINT_4 = -8.5 -0.4 -3 1e7 1e5 3.0

and that's it.

the unique file can be useful but requires extrawork to make it, and now I can't apply to that.

---------- Post added at 23:37 ---------- Previous post was at 19:23 ----------

Have a look here, it seems to work

I'll give explanations tomorrow, now I have to go!

http://www.intech-srl.eu/fred/TD_Pts_Updater.zip

---------- Post added 16th Jan 2019 at 15:04 ---------- Previous post was 15th Jan 2019 at 23:37 ----------

So as promised some explanations:
1) this simple plugin allows to set Touchdown points via cfg file
2) it works for specific vessel's names or for specific vessel's classes. So if for example you want to have specific touchdown points for a Deltaglider that in your scenario will be called GL01, you'll have to create the GL01.cfg inside the config/TD_Pts_Updater/ folder while if you want all the Deltagliders to have your specific touchdown points you'll have to create the Deltaglider.cfg file in the same folder
3) it won't work properly for vessels who set Touchdown points during simulations by themselves (the DG for example changes its TD points while lowering and raising the gear), but there is nothing that can be don for that.
4) you probably will not see any changes for already landed vessels until you move them either by their engines or (suggested) via scenario editor. This is because in the scenario also the arot and alt parameters and saved and used to restore the state, so if it seems to you that nothing changed, try first to move the vessels.
5) the parameters in the cfg are:
Code:
N = X ;number of points
POINT_X = aa bb cc dd ee ff gg ;point number x characteristics:
aa bb cc are the x y and z points of the touchdown point
dd is the stiffness of the point
ee is the damping of the point
ff is the mu coefficient of friction of the point
gg is the mu longitudinal coefficient (used only for the first 3 points)

if less than 3 points are defined the plugin will not do anything since 3 is the minimum that can be defined
if the first point does not have stiffness or damping defined (or they are simply 0) then the plugin will use the harmonic damped oscillator equations to find them for all the points using the vessel mass.
The use of the vessel mass is why in the code you see the initial check for existing vessel in scenario done after 10 frames, in the first frame the mass returned by GetMass() is 0, so instead of using the clbkSimulationStart I just put the check after 10 frames but it doesn't make much difference.

It is a quick and dirty module, so don't take it as gold, just test it and if you like it and does what it should then we could refine it a bit.

Hope it is useful,
:cheers:
 

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,917
Reaction score
212
Points
138
Location
Cape
Can it do SC3 .ini vessels ?
 

jacquesmomo

Addon Developer
Addon Developer
Joined
Jun 14, 2008
Messages
613
Reaction score
453
Points
78
Location
FRANCE
Website
francophone.dansteph.com
hello Fred

A big thank you for this module which seems very interesting, and which will certainly allow me to make some updates for some of my vessels or projects ....

(At this moment I am still updating the ELA3 zone of Kourou (french Guyana).

I will test your module as soon as I will have time and I'll tell you :tiphat:

Jacques
:cheers:

Can it do SC3 .ini vessels ?
As we can add a cfg file with SC3 and SC4 I think (and I hope) it is possible.... I'll will try....
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
Can it do SC3 .ini vessels ?

I haven't tested it but I think yes: since it works also with vessel's names you can just create a cfg file with the name of the SC3 vessel and it should set its touchdown points accordingly. Please make the test and let me know if it works.

---------- Post added at 20:27 ---------- Previous post was at 20:25 ----------

hello Fred
A big thank you for this module which seems very interesting, and which will certainly allow me to make some updates for some of my vessels or projects ....

As said I maid quite quickly so I don't know if it works perfectly. But if it does its job and users say that it is useful we can always implement it and make it better.
 

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,917
Reaction score
212
Points
138
Location
Cape
I use this for the file name and it says, it is not a valid file name.

DM_1/DM_1capsule
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
I use this for the file name and it says, it is not a valid file name.

DM_1/DM_1capsule

Yeah I think that windows does not like the / in the filename. Is there any way to avoid the use of it? What s the name of the sc3 ini file?
 

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,917
Reaction score
212
Points
138
Location
Cape
DM_1capsule
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
ok, so a small update since I remember that with SC3 a lot of ships have slashes in their names.

I can't force window to accept slashes in the filename, so instead of use "/", just save the names with 3 underscores "___".

DM1/DM1_capsule becomes DM1___DM1_capsule.cfg

here's the download link for the new version (it's the same link anyway, I just overwrote the file).

http://www.intech-srl.eu/fred/TD_Pts_Updater.zip
 

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,917
Reaction score
212
Points
138
Location
Cape
The slash denotes a subfolder in the spacecraft folder.
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
The slash denotes a subfolder in the spacecraft folder.

Yes, that s why you name the vessel with the slash. For this plugin you have to create a cfg file with the name of the vessel and the name of the file cannot contain slashes because window does not accept them, so you just use 3 underscores instead.
 

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,917
Reaction score
212
Points
138
Location
Cape
How do you make a .cfg file point to a spacecraft .ini ? Never done it believe it or not. :embarrassed:
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
How do you make a .cfg file point to a spacecraft .ini ? Never done it believe it or not. :embarrassed:

nono, you don't have to point anything, that's much easier than what you are thinking about. The module I attached does everthing for you. for the DM1/DM1_capsule vessel just do this:

go to orbiter/config/TD_Pts_Updater folder
create e a new text file and name it "DM1___DM1_capsule.cfg"
open it and write the touchdown points data (to see how there is a deltaglider.cfg example that sets the point for making it a tail sitter some 30 meters above ground...).

Finish, it's just a matter of creating an text file in the right folder, and name it with the name of your vessel.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Fred, many thanks for this!
:cheers:
:probe:

I'm testing it with spacecraft.dll vessels and it works!

The only problem is that it never dampens completely.
But it's very close to that.
I'm leaving the calculations up to the plugin, I have no clue what values to use.
 
Last edited:

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,917
Reaction score
212
Points
138
Location
Cape
I have a SC3 vehicle, and the touchdown points don't change no matter what numbers I put in.

Code:
N = 3
POINT_1 = (-8.667,-5.0,-60) 
POINT_2 = (0 ,10 ,-60)
POINT_3 = (8.667,-5.0,-60)
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
The syntax is simpler.
Here's something I just tested for 2001's Aries Ib


Code:
; N = number of points, 
; POINT_X = x y z stiffness damping mu mu_lng 
;see orbiter api guide for further details
N = 3
POINT_1 =  0 -10  0.57
POINT_2 = -20 10  0.57
POINT_3 =  20 10  0.57
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
I'm leaving the calculations up to the plugin, I have no clue what values to use.

I'm not on my computer now, but if I remember correctly the plugin prints out the values it uses in orbiter.log, so users have a reference starting point
 

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,917
Reaction score
212
Points
138
Location
Cape
I try this:

Code:
N = 3
POINT_1 =  0 -1.00 1.58
POINT_2 =  -1.17 -0.40 -1.59    
POINT_3 =   1.17 -0.40 -1.59

Get this no matter what.
 

Attachments

  • TPJasonCarrier.jpg
    TPJasonCarrier.jpg
    62.3 KB · Views: 25
Top