Jump to content

[1.0] XT Landertron - Smart Retrorockets for Landers and Spaceplanes v0.08 Oct 10


XanderTek

Recommended Posts

All Landertrons assigned to a stage will be taken into account when figuring out when to fire. So 2 sets of 4 Landertrons will work just fine so long as they're all activated at once.

How big would you like to see them get? I was thinking about adding tweakscale compatibility.

Hi

Tweakscale sounds good :-)

I'm just in the process of testing the landertrons, when i activate them, 20 km above the mun (already in landing trajectory, horizontal m/s nearly 0), then they start firering right away. 18 km above the mun and my ms/ is just 20 m/s or so. Why do they not wait for the suicide burn ? Of course they run out before the surface any my Kerbals die.... Also they have so many thrust that they actually lift the lander again and my ap gets higher.....

Breaking Distance says: ca 200 m but it starts before that (yellow color)

Also: What does Endspeed in the menu mean ? is it the final landing speed after fireing the landertrons ?

Thanks for clearing that up :-D

Link to comment
Share on other sites

Correct, Endspeed is the speed you'll be going when you contact the ground. Most of the time you can just leave that at zero.

There's a bug that currently results in the landertrons getting confused if you build the lander in a different orientation than you end up landing it in. This often happens if you build the lander in the spaceplane hanger. Is it possible that's what you experienced? I'm working on a solution, but its been slow going. Or maybe something broke in 1.0. I haven't had a chance to check yet.

Link to comment
Share on other sites

Hi XanderTek,

Well i build the lander normal in the VAB, it is possible that i turned it clokwise but not upside down or anything. I did play in 0.9 (will wait till most of my mods are ported :)

The thing is, the engies did not turn blue, they just got straight to yellow and started firering 18km up but suicide burn point was at 10 km or so...

Thanks for looking into this, in the end i laded the lander with my backup engine :-) But Landertrons would be much cooler :-D

Link to comment
Share on other sites

Correct, Endspeed is the speed you'll be going when you contact the ground. Most of the time you can just leave that at zero.

There's a bug that currently results in the landertrons getting confused if you build the lander in a different orientation than you end up landing it in. This often happens if you build the lander in the spaceplane hanger. Is it possible that's what you experienced? I'm working on a solution, but its been slow going. Or maybe something broke in 1.0. I haven't had a chance to check yet.

Hi XanderTek,

indeed for me it didnt work in 1.0 (1.0.2).

I took the freedom to look at your source, and I *believe* I have fixed all instances where 1.0 changed something.

(most important was vessel.staticPressure no longer exists, thus my landertrons could not figure out when to fire).

Updated source landertron.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;



public class Landertron : PartModule
{
//[KSPField(guiActive = true, guiActiveEditor=true ,isPersistant=true),UI_FloatRange(maxValue=1.5f,minValue=0.5f,stepIncrement=0.05f)]
//public float heightmultiplier = 1;
//[KSPField(guiActive = true, guiActiveEditor = true, isPersistant = true), UI_FloatRange(maxValue = 3, minValue = -3f, stepIncrement = 0.1f)]
//public float offset = 0;
//[KSPField(guiActive = false)]
//public float endheight = 0;
[KSPField(guiActive = false, guiActiveEditor = true, isPersistant = true), UI_FloatRange(maxValue = 10, minValue = 0, stepIncrement = 0.5f)]
public float endspeed = 0;
[KSPField(guiActive = false)]
public bool boom = false;
[KSPField(guiActive = false)]
public bool showgui = true;
[KSPField(guiActive = false)]
public bool refuelable = true;
//[KSPField(guiActive = false)]
//public bool engineShutdown = true;
[KSPField(guiActive = false)]
public float electricrate = 0.05f;
[KSPField(guiActive = false, guiActiveEditor=false ,isPersistant=true)]
public int mode = 0;
public float thrust = 0;
[KSPField(isPersistant = false, guiActiveEditor = false, guiActive = false)]
public string Status = "Idle";
[KSPField(isPersistant = false, guiActiveEditor = true, guiActive = true)]
public string ModeName = " ";
//[KSPField(isPersistant = false, guiActiveEditor = false, guiActive = true)]
public double deltaV = 0;
public float m = 0;
public float elec_dem = 0;
public float elec_rec = 0;
public float totalfuelmass = 0;
public double totalthrust = 0;
public double partanglethrust = 0;
public double vesselanglethrust = 0;
public double localg;
public double gee = 0;
public double vaccel = 0;
public double backgroundaccel = 0;
public double vh_prev = 1000;
public double v = 0;
[KSPField(isPersistant = false, guiActive = true, guiName = "Braking Distance", guiUnits = "m")]
public float displayd = 0;
public double dfinal = 0;
public double dmin = 0;
public bool fire = false;
public bool arm = false;
public bool end = false;
public bool firing = false;
public bool warning = false;
public bool prevland = true;
public static bool globaljustrefueled = false;
public bool justrefueled = false;
protected ModuleEngines engine;
protected PartResource sf;
protected Landertron ltron;
public Vector3d pos;
public Vector3d up;
public Vector3d acc;
public Vector3d vel;
[KSPField(guiActive=false)]
public int lcount = 0;
public RaycastHit craft;
public Part mpart;
public float isp;
public float burntime;


[KSPField(isPersistant = false)]
public string AnimationName;


private AnimationState[] animStates;
private bool animdeployed=false;


public override void OnAwake()
{
lcount = 0;

}
public override void OnStart(PartModule.StartState state)
{
engine = this.part.Modules["ModuleEngines"] as ModuleEngines;


sf = this.part.Resources["SolidFuel"];
if (HighLogic.LoadedScene == GameScenes.EDITOR && mode == 0)
{ mode = 2; }
else if (HighLogic.LoadedScene == GameScenes.EDITOR && mode == 0)
{ mode = 1; }
switch(mode)
{
case 1:
ModeName = "Soft Landing";
break;
case 2:
ModeName = "Short Landing";
break;
case 3:
ModeName = "StayPut";
break;
}
guifixer();
animStates = SetUpAnimation(AnimationName, this.part);


//GameEvents.onJointBreak.Add(onJointBreak);
}
//private void onJointBreak(EventReport eventreport)
//{ print("Something detatched! ");}
/*[KSPEvent(guiName = "Refuel",guiActive=false ,externalToEVAOnly = true, guiActiveUnfocused = true, unfocusedRange = 3.0f)]
public void Refuel()
{
double sf_available = 0;
int containercount=0;
foreach (Part p in vessel.parts)
{
if (!p.Modules.Contains("Landertron") && p.Resources.Contains("SolidFuel"))
{
PartResource sfp = p.Resources["SolidFuel"];
sf_available += sfp.amount;
containercount++;
}
}
//print("avail: " + sf_available);
double sf_needed = sf.maxAmount - sf.amount;
double sf_added = Math.Min(sf_available, sf_needed);
sf.amount += sf_added;
foreach (Part p in vessel.parts)
{
if (!p.Modules.Contains("Landertron") && p.Resources.Contains("SolidFuel"))
{
PartResource sfp = p.Resources["SolidFuel"];
sfp.amount -= sf_added/containercount;


}
}
justrefueled = true;
animdeployed = false;
}*/
public void Refuel()
{
/*int ccount = 0;
foreach (Part p in this.part.children)
{
print("name: "+p.name);
p.Die();
//p.explosionPotential = 0;
//p.explode();
//ccount++;
}*/
for (int i = 0; i < this.part.children.Count; )
{
Part p = this.part.children[i];
if (p.Resources.Contains("SolidFuel") && sf.amount < sf.maxAmount)
{

PartResource sfp = p.Resources["SolidFuel"];
sf.amount = Math.Min(sf.amount + sfp.amount, sf.maxAmount);
//print("name: " + p.name);
p.Die();
justrefueled = true;
animdeployed = false;
}
else ++i;
}


/*if (ccount > 0)
{
for (int i = 0; i < ccount; i++)
{
print("name: " + this.part.children (i).name);
}
}*/
}
[KSPEvent(guiName = "Soft Landing", guiActiveEditor = true, guiActiveUnfocused = false, guiActive = false)]
public void ClassicMode()
{
mode = 1;
ModeName = "Soft Landing";
forAllSym();
}
[KSPEvent(guiName = "Short Landing", guiActiveEditor = true, guiActiveUnfocused = false, guiActive = false)]
public void VSL()
{
mode = 2;
ModeName = "Short Landing";
forAllSym();
}
[KSPEvent(guiName = "StayPut", guiActiveEditor = true, guiActiveUnfocused = false, guiActive = false)]
public void SP()
{
mode = 3;
ModeName = "StayPut";
forAllSym();
}
[KSPEvent(guiName = "Decouple", guiActive = false, externalToEVAOnly = true, guiActiveUnfocused = true, unfocusedRange = 3.0f)]
public void decoup()
{
this.part.decouple(2000);
}
/*[KSPEvent(guiName = "Escape!", guiActiveEditor = true, guiActiveUnfocused = false, guiActive = true)]
public void escape()
{
mode = 4;
ModeName = "Escape!";
forAllSym();
}*/
[KSPAction("Arm")]
public void armaction(KSPActionParam param)
{
this.part.force_activate();
}
[KSPAction("Decouple")]
public void decoupleaction(KSPActionParam param)
{
this.part.decouple(2000);
}
/*[KSPAction("Abort", KSPActionGroup.Abort)]
public void abort()
{
if (mode==4)
{
foreach (Part p in vessel.parts)
{
if (p.Modules.Contains("ModuleDecouple"))
{
ModuleDecouple dec=p.Modules["ModuleDecouple"] as ModuleDecouple;
dec.Decouple();
}
}
engine.Activate();
}
}*/
public void Update()
{
if (HighLogic.LoadedSceneIsEditor)
{
guifixer();

/*totalmass = 0;
totalfuelmass = 0;
foreach (Part p in EditorLogic.SortedShipList)
{
if (p.Modules.Contains("Landertron") && p.inverseStage == this.part.inverseStage)
{
ltron = p.Modules["Landertron"] as Landertron;
if (ltron.mode == mode)
{
totalfuelmass = totalfuelmass+p.GetResourceMass();

}
}
totalmass = totalmass+p.GetResourceMass()+p.mass;
}
//print("fuel: " + totalfuelmass);
//print("ln: " + Mathf.Log(totalmass / (totalmass - totalfuelmass)));
deltaV = engine.atmosphereCurve.Evaluate(1) * 9.81f * Mathf.Log(totalmass / (totalmass - totalfuelmass));*/
}




}
public override void OnActive()
{
lcount = 0;
foreach (Part p in vessel.parts)
{


if (p.Modules.Contains("Landertron") && p.inverseStage==this.part.inverseStage && p.GetResourceMass()>0)
{

ltron=p.Modules["Landertron"] as Landertron;
if (ltron.mode == mode)
{
lcount = lcount + 1;

}
}

}
//partanglethrust = Vector3d.Dot(this.part.transform.up.normalized, this.vessel.transform.up.normalized);


animdeployed = true;

}
public override void OnUpdate()
{
guifixer();
if (justrefueled && this.vessel == FlightGlobals.ActiveVessel)
{
//if (globaljustrefueled)
//{
// Staging.AddStageAt(0);
// globaljustrefueled = false;
//}
//int c = 0;
//int stg = Staging.CurrentStage;
//if (stg == c)
//{ Staging.AddStageAt(0); }

//this.part.stackIcon.SetIconColor(XKCDColors.White);
Status = "Idle";
this.part.deactivate();
//print("deact");
this.part.inverseStage = 0;
//Staging.AddStageAt(Staging.CurrentStage+1);
//Staging.AddStageAt(Staging.CurrentStage + 1);
//print("stage: " + Staging.CurrentStage);
//Staging.RecalculateVesselStaging(this.vessel);
justrefueled = false;



}
if (refuelable)
{
Refuel();
}




foreach (AnimationState anim in animStates)
{
if (animdeployed && anim.normalizedTime < 1) { anim.speed = 1; }
if (animdeployed && anim.normalizedTime >= 1)
{
anim.speed = 0;
anim.normalizedTime = 1;
}
if (!animdeployed && anim.normalizedTime > 0) { anim.speed = -1; }
if (!animdeployed && anim.normalizedTime <= 0)
{
anim.speed = 0;
anim.normalizedTime = 0;
}
}
}
public override void OnFixedUpdate()
{



//if (engine.maxThrust != 0 && engine.maxThrust != thrust)
//{ thrust = engine.maxThrust; }


m = this.vessel.GetTotalMass();
v = this.vessel.verticalSpeed;
//gee = FlightGlobals.getGeeForceAtPosition(this.vessel.mainBody.position).magnitude;
pos = this.vessel.findWorldCenterOfMass();
up = (pos - this.vessel.mainBody.position).normalized;
vesselanglethrust = Vector3d.Dot(this.vessel.transform.up.normalized, up);
Vector3 thrustp = Vector3d.zero;
foreach (var t in engine.thrustTransforms)
{ thrustp -= t.forward / engine.thrustTransforms.Count; }


//--TheDog: 03.05.2015: FIXED: KSP 1.0.2 has no more GameScenes.SPH--
Vector3 fwd = HighLogic.LoadedScene == GameScenes.EDITOR ? Vector3d.up : (Vector3d)engine.part.vessel.GetTransform().up;


partanglethrust = Vector3.Dot(fwd, thrustp);
acc = this.vessel.acceleration;
vaccel = Vector3d.Dot(acc, up);
totalthrust = engine.maxThrust * partanglethrust * vesselanglethrust * lcount * (engine.thrustPercentage / 100);
//print(totalthrust);
totalfuelmass = lcount * (float)sf.amount * 0.0075f; //this.part.GetResourceMass();


//--TheDog: 03.05.2015: FIXED: KSP 1.0.2 has no more staticPressure--
//isp = engine.atmosphereCurve.Evaluate((float)this.vessel.staticPressure);
isp = engine.atmosphereCurve.Evaluate((float)this.vessel.mainBody.GetPressure(this.height()));


deltaV = isp * 9.81f * Mathf.Log(this.vessel.GetTotalMass() / (this.vessel.GetTotalMass() - totalfuelmass)) * partanglethrust;
//burntime = this.part.GetResourceMass() / (engine.maxThrust / isp);
burntime = (float)sf.amount *0.0075f / (engine.maxThrust*(engine.thrustPercentage/100) / (isp*9.81f));

elec_dem = electricrate * TimeWarp.fixedDeltaTime;
elec_rec = elec_dem;
if (sf.amount > 0.1)
{ elec_rec = this.part.RequestResource("ElectricCharge", elec_dem); }
modeconfig();
if (elec_rec < elec_dem)
{
this.part.stackIcon.SetIconColor(XKCDColors.BrightYellow);
Status = "No Power";
}
else if (sf.amount == 0 && engine.getIgnitionState)
{
engine.allowShutdown = true;
engine.Shutdown();
engine.allowShutdown = false;
this.part.stackIcon.SetIconColor(XKCDColors.White);
Status = "Idle";
this.part.deactivate();
}
else if (end)
{
if (boom)
{ this.part.explode(); }
else
{
//print("venting " + sf.amount + " fuel");
sf.amount = 0;
}
firing = false;
}
else if (fire)
{
Status = "Firing!";
engine.Activate();
firing = true;
this.part.stackIcon.SetIconColor(XKCDColors.RadioactiveGreen);
}
else if (arm)
{
if (engine.getIgnitionState)
{
engine.allowShutdown = true;
engine.Shutdown();
engine.allowShutdown = false;
}
if (sf.amount > 0)
{
if (warning)
{
this.part.stackIcon.SetIconColor(XKCDColors.Red);
Status = "Warning! Too Fast!";
}
else
{
this.part.stackIcon.SetIconColor(XKCDColors.LightCyan);
Status = "Armed";
}


}
else
{
this.part.stackIcon.SetIconColor(XKCDColors.White);
Status = "Idle";
this.part.deactivate();
}
}
prevland = this.vessel.Landed;
}
protected void modeconfig()
{
switch (mode)
{
case 1:
//Classic
warning = -v - endspeed > deltaV * vesselanglethrust;
if (vesselanglethrust < 0.2)
{
dmin = 0;
}
//else if (warning)
//{
//double realend = v + deltaV * vesselanglethrust;
//dmin = -1* (realend * realend - v * v) / (2 * (totalthrust / m + vaccel));
//dmin = -(v * burntime + 0.5 * (totalthrust / m + vaccel) * burntime * burntime);
//dmin = -v * burntime;
//}
else if (v + (totalthrust / m + vaccel) * burntime > -endspeed)
{


dmin = -1 * (endspeed * endspeed - v * v) / (2 * (totalthrust * 0.90 / m + vaccel));
}
else
{
dmin = -(v * burntime + 0.5 * (totalthrust / m + vaccel) * burntime * burntime);
}
//double dfullburn = -(v + Math.Max(v + (totalthrust / m + vaccel) * burntime,0)) * burntime / 2;
//double dfullburn = -(v * burntime + Math.Max(0.5 * (totalthrust / m + vaccel) * burntime * burntime,0));
if (!firing)
{ backgroundaccel = vaccel; }
dfinal = dmin; //* heightmultiplier + offset;
//dfinal = Math.Min(dmin, dfullburn);
displayd = (float)dfinal;
arm = !firing;
float h = height();
fire = h < dfinal && v < -1 && !this.vessel.Landed && sf.amount > 0;// && (h/v)<burntime;
//end = (h < endheight || v > -1 * endspeed || sf.amount == 0) && firing;
if (!firing)
{
//print("w: " + warning + " dmin: " + dmin + " vf: " + (v + (totalthrust / m + vaccel) * burntime));
}
end = (h < 0.1 || v > -1 * endspeed || sf.amount == 0) && firing;

double areq = endspeed * endspeed -v * v / (2 * -1 * h) - backgroundaccel;
double adiff = areq - vaccel;
//float throt=areq * m / totalthrust;
if (firing)
{
engine.throttleLocked = false;
engine.useEngineResponseTime = true;
engine.engineAccelerationSpeed = 0.0f;
engine.engineDecelerationSpeed = 0.0f;
//engine.currentThrottle = Mathf.Min((float)(areq * m / totalthrust), 0);
//engine.currentThrottle = Mathf.Clamp(engine.currentThrottle + (float)(adiff * m / (vesselanglethrust * partanglethrust * engine.maxThrust)), 0, 1);
//engine.currentThrottle = Mathf.Clamp(engine.currentThrottle + (float)(adiff * m / totalthrust), 0, 1);
engine.currentThrottle = Mathf.Clamp((float)(areq * m *(engine.thrustPercentage/100) / totalthrust), 0, 1);
//print(engine.requestedThrust);
//print("areq: " + areq + " adiff: " + adiff);
//print("v: " + v + " h: " + h + " rthrot: " + (areq * m / totalthrust));
//print("Fuel: "+sf.amount+" v: " +v);
//engine.throttleLocked = true;
}


break;
case 2:
//Space Plane
double vh = this.vessel.srf_velocity.magnitude;


arm = !firing;
fire = this.vessel.Landed && !prevland && sf.amount > 0;
end = (vh < endspeed || vh_prev<vh ||sf.amount <= 0) && firing;
warning = vh > -deltaV;
//if (firing)
//{ print("vh: " + vh); }
vh_prev = vh;
break;
case 3:
//StayPut
double staydir = vesselanglethrust;// Vector3d.Dot(this.part.transform.up.normalized, up);


arm = !firing;
fire = this.vessel.Landed && sf.amount > 0; //&& v > 0.1
end = (staydir<0.1 || sf.amount < 0.1) && firing;
warning = false;

break;
default:
break;
}
}
protected float height()
{
float dsea = (float)FlightGlobals.getAltitudeAtPos(pos);
float d = dsea;
if (Physics.Raycast(pos, -up, out craft, dsea + 10000f, 1 << 15))
{ d = Mathf.Min(dsea, craft.distance); }
//else { d = dsea; }
float surfheight = dsea - d;
float lowestd = d;
foreach (Part p in vessel.parts)
{
if (p.collider != null) //Makes sure the part actually has a collider to touch ground
{
Vector3 bottom = p.collider.ClosestPointOnBounds(vessel.mainBody.position); //Gets the bottom point
float partAlt = FlightGlobals.getAltitudeAtPos(bottom) - surfheight; //Gets the looped part alt
lowestd = Mathf.Max(0, Mathf.Min(lowestd, partAlt)); //Stores the smallest value in all the parts
}
}
d = lowestd;
return d;
}
protected void forAllSym()
{
foreach (Part p in this.part.symmetryCounterparts)
{


ltron = p.Modules["Landertron"] as Landertron;
ltron.mode = mode;
ltron.ModeName = ModeName;
}
}
protected void guifixer()
{
//engine.Events["Activate Engine"].guiActive = false;
//engine.Actions["toggle"].active = false;
if (!showgui)
{
ltron = this.part.Modules["Landertron"] as Landertron;
Fields["endspeed"].guiActive = false;
Fields["endspeed"].guiActiveEditor = false;
Events["ClassicMode"].guiActiveEditor = false;
Events["Decouple"].guiActiveUnfocused = false;
Events["VSL"].guiActiveEditor = false;
Events["SP"].guiActiveEditor = false;
Fields["ModeName"].guiActive = false;
Fields["ModeName"].guiActiveEditor = false;
Fields["Status"].guiActive = false;
Fields["displayd"].guiActive = false;

}
else if (mode == 1 || mode==2)
{
//Fields["heightmultiplier"].guiActive = true;
//Fields["heightmultiplier"].guiActiveEditor = true;
//Fields["offset"].guiActive = true;
//Fields["offset"].guiActiveEditor = true;
Fields["endspeed"].guiActive = true;
Fields["endspeed"].guiActiveEditor = true;
}
else
{
//Fields["heightmultiplier"].guiActive = false;
//Fields["heightmultiplier"].guiActiveEditor = false;
//Fields["offset"].guiActive = false;
//Fields["offset"].guiActiveEditor = false;
Fields["endspeed"].guiActive = false;
Fields["endspeed"].guiActiveEditor = false;
}
}
public static AnimationState[] SetUpAnimation(string animationName, Part part) //Thanks Majiir!
{
var states = new List<AnimationState>();
foreach (var animation in part.FindModelAnimators(animationName))
{
var animationState = animation[animationName];
animationState.speed = 0;
animationState.enabled = true;
animationState.wrapMode = WrapMode.ClampForever;
animation.Blend(animationName);
states.Add(animationState);
}
return states.ToArray();
}


}

Now my landertrons are firing as expected.

I can also send you the updated file (source and dll), if you want.

Cheers,

TheDog

Link to comment
Share on other sites

I had a request to share my updated DLL, and I thought of this solution:

I have a temporary, unofficial patch release of my updates here:

https://github.com/TheDogKSP/XanderTek_XTLandertron/releases

(patched DLL and source only - you still need to download from the front page here first, then replace the DLL!)

**This will get pulled once XanderTek updates his release, so his release (and this thread) remains the "single version of the truth"**

This will also get pulled should XanderTek disapprove of this unofficial patch distribution.

Link to comment
Share on other sites

I totally approve of the patch TheDog, and I appreciate the help. That's the beauty of open source! I'll have the official download updated with your fixes shortly.

Version "v0.08" download from front page, include TheDog patched DLL?

Link to comment
Share on other sites

Hi

I made a texture so you can see that is "up" on one of the landertrons as i crashed Jeb and Val because i attached them the wrong side....

Here you go. Just override the texture for the trrEngine.

Screenshot: http://postimg.org/image/u6sz6xx6j

Tex: http://postimg.org/image/40efhblvn/

Have fun

Edited by ManuxKerb
Link to comment
Share on other sites

Hi

Ok i just tried the landertrons again and they fiered much too early. They went straight to yellow and then after burning out to blue.

The only thing i did was rotate them 90° down as the where 45 before. Could this cause this ?

Thanks

Link to comment
Share on other sites

I've made this patch that brings the specific impulses and maximum temperatures in line with stock parts, as well as overriding the volume of the hexcan to a more reasonable value. (Remember, only Engineers can attach stuff with KIS, so bring Bill and his screwdriver!)


@PART[HexCanSF]
{
bulkheadProfiles = srf
@maxTemp = 2000
-MODULE[KASModuleGrab]{}

MODULE
{
name = ModuleKISItem
volumeOverride = 60
}
}

@PART[XTL*]
{
@maxTemp = 2000
bulkheadProfiles = srf

@MODULE[ModuleEngines]
{
-atmosphereCurve,*{}

atmosphereCurve //the one from the advanced SRB
{
key = 0 190
key = 1 170
key = 7 0.001
}
}
}

However, the arming and firing logic needs work. Performing an elementary test with a modified Kerbal 2, the landertrons fire as soon as they are armed and don't seem to disarm -- Bill got the scare of his life when the landertron fired again as soon as he loaded it with solid fuel, tossing the capsule end over end and tossing him from the ladder. (Jeb loved it, of course, and Bob was okay with it because I'd attached airbags in case the landertrons behaved oddly.)

Link to comment
Share on other sites

how to install it?

do I just move XTLandertron08 folder to the gamedata?

Or

XanderTek, HexCans, Landertron.cs should be separate in the gamedata?

Edited by gendalf
Link to comment
Share on other sites

  • 2 weeks later...

Hi

I got the same behaviour as you too. This is definitely a bug. I suspect it happens if you rotate the landertrons in any direction. Even just a touch. If you just attach them and dont do anything like Offset or rotate they worked in my (very quick test).

Did you also rotate/offseted them ?

Edited by ManuxKerb
Link to comment
Share on other sites

  • 3 weeks later...
Sorry guys, something is clearly broken. It's been a while since I've had a chance to dive back into the code, but I should be able to this weekend. I'll let you know when I have an update!

Great news - I'm still making use of the other engines that come with this mod - they really help dealing with aerobraking, but there was a brief period where I had the landertron retrorockets working with remote tech and it was beautiful!

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...
Sorry guys, something is clearly broken. It's been a while since I've had a chance to dive back into the code, but I should be able to this weekend. I'll let you know when I have an update!

Just a little bump to see if you made any progress with this? So many fond memory’s of this mod (sort landing space planes, escape pods from KO) would love to get this going again!

Link to comment
Share on other sites

Just discovered this bug the hard way upon approaching the Mun with Jeb. I really thought I'd have to sacrifice him as he was suborbital with no fuel left, except 4 landertrons which just fired him back into space.

Only just managed to put the craft down after separating the landertrons into 2 pairs. First set killed horizontal as well as accelerated him towards the Mun so that the second set intended for killing off the vertical descent didn't send him into deep space. Managed to safely land the Kerbal way doing ~55m/s and using the poodle engine as a crumple zone :D

TL;DR Please fix this! Would love to see it working with RemoteTech as someone else has mentioned :)

Link to comment
Share on other sites

  • 3 weeks later...

Apparently, I never properly installed TheDog's recompile, since I was fiddling with XTL recently and found "staticPressure" errors in my log. So, if any of you are finding your landertrons activating immediately upon arming, that might be the problem -- be sure you're grabbing his recompile (or recompiling his source, as I did when I thought he'd goofed somehow and uploaded the wrong DLL, before I realized that I hadn't actually installed his to begin with).

Unfortunately, while the landertrons in my testing are no longer firing prematurely, they're still finicky at best. The upper "safe" limit for landing (using a testing spacecraft similar to the one in the video in the OP) seems to be about 30-40 m/s -- certainly not survivable without them, so it's an improvement, but not nearly using the full delta-V that they're capable of producing. I think that part of the issue may be framerate limits -- if a vehicle is traveling at the full 200 m/s that the landertron can theoretically compensate, it moves 3.3 meters per frame, which may not be enough time/space to properly run the engines and actually zero that velocity (braking distances measured in millimeters, according to the part context menu). Probably also involved is the more realistic atmosphere, which results in higher terminal velocity.

Reducing the thrust on the landertron (i.e. forcing it to start firing earlier and longer) seems to help some, and I'll continue testing (there are also some height multiplier and offset variables in the code that might help), but in the meantime, I don't think these guys are going to be the same "disregard parachutes, deploy rockets" kind of solution they were before.

Also, something doesn't seem quite right with the short landing mode -- in testing, KER says they should have more than enough delta-V to get the job done, but they seem to just give up after a fraction of a second (much less than their predicted burn time). I'm going to dive into the math when I get the time.

Link to comment
Share on other sites

  • 2 weeks later...

Good news! I've figured out what the problems are and how to fix them.

The issue with soft-landing was that they weren't properly calculating their own Isp (with the stockalike atmosphere curve I patched them to have, they were getting stuck at 0.001 seconds), which was causing them to severely underestimate their actual delta-V, thrust, required firing distance, and everything. That's fixed now.

The giving-up short-landing rockets are caused by jitter, I think. They stop firing if the current velocity is greater than the one from the previous frame. The intent is that this detects when the ship has come to a stop and begun to accelerate backwards., but landing with a bit of a bounce can also trip that condition. I've added some tolerance to stop that from happening further. It works in testing with the Aeris 3A, but I worry that it may be somewhat sensitive to TWR, so be careful.

I've put up the DLL as a release, but if you grab the GameData folder from the repo itself, I've made some changes to the part configs and such that I'm happy to let XanderTek package up and release. In particular, the parts have had their Isp and thermal properties rebalanced to be in line with stock parts and gotten some scale-factor updates to work well with KIS.

Finally, if anyone knows a way to tell if we're in the SPH or VAB, that would be great -- since the scene names are the same now ("GameScenes.EDITOR"), the code defaults everything to be in short-landing mode, even though I would probably rather use soft-landing mode if I'm building something in the VAB. That's the only outstanding issue that comes to mind.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...