Jump to content

[1.8.1 - 1.12] Photon Sailor 1.7.1 (now with background processing)


FreeThinker

Recommended Posts

1 hour ago, FreeThinker said:

Not sure but possibly this is caused by using incompatible versions. Please make sure KSPIE and PhotonSailor are the latest version

Good idea. I will check in the log I sent. Interstellar v1.19.11.1. PhotonSail v1.4.5.0. Checking now for the version files, since they have not been updated since the log was produced.

Photon Sailor     "VERSION":{"MAJOR":1,"MINOR":4,"PATCH":5,"BUILD":1},    "KSP_VERSION":{"MAJOR":1,"MINOR":4,"PATCH":5}.

KSPIE     "VERSION":    {        "MAJOR":1,        "MINOR":19,        "PATCH":10,        "BUILD":1    },    "KSP_VERSION":    {        "MAJOR":1,        "MINOR":4,        "PATCH":5    }}

I have posted before that the version number for kspie does not match the name of the download, ie it should be 1.19.11.1 but as you can see inside the version file it is 1.19.10.1

I will try reinstalling the last download I made. Just in case I missed one of the many sub folders.

Edited by Apaseall
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

@FreeThinker hey man, since photon sailor is standalone, is it possible that the microwave beamed power could also be made to have a standalone version? kspie is really big and full of things I don't intend to use and I currently started a nice simple playthrough in 1.6 with lots to learn and do, kspie is just rather big and scary to me, more complex than I can handle, only a few thing I'd like to try and I'm sure I'm not alone

Link to comment
Share on other sites

9 hours ago, The-Doctor said:

@FreeThinker hey man, since photon sailor is standalone, is it possible that the microwave beamed power could also be made to have a standalone version? kspie is really big and full of things I don't intend to use and I currently started a nice simple playthrough in 1.6 with lots to learn and do, kspie is just rather big and scary to me, more complex than I can handle, only a few thing I'd like to try and I'm sure I'm not alone

Well I already had plans to move in that direction, but the problem is that technologies are interconnected as in order to transmit power,  in any meaningful quantities, you going to need reactors, power generators and radiators. The exception to this would be if you want to power using only solar cells, but this would require huge solar space stations.

Edited by FreeThinker
Link to comment
Share on other sites

2 hours ago, FreeThinker said:

Well I already had plans to move in that direction, but the problem is that technologies are interconnected as in order to transmit power,  in any meaningful quantities, you going to need reactors, power generators and radiators. The exception to this would be if you want to power using only solar cells, but this would require huge solar space stations.

Better than nothing plus players could install different power generation mods

Link to comment
Share on other sites

Is the direction of the sail's atmospheric drag reversed in the latest version for 1.5.1? I watched the Apoapsis increasing quickly when opening this sail up in low orbit (see pic), and even seeing my probe accelerating like hell when hitting this atmosphere.

KSP configuration:

  • KSP 1.5.1
  • with DLC
  • 3.2x Kerbin
  • FAR installed
  • KSPIE not installed
  • the rest should be irrelevant

5c28b8fe484c6.png

------ update ------

Went to see the source code.

I suppose there's a missing -1 on line 1058 in https://github.com/sswelm/KSP-Interstellar-Extended/blob/master/PhotonSail/ModulePhotonSail.cs? (Not very sure)

// starting at line 1015
		private void ApplyDrag(double universalTime, double vesselMassInKg)
        {
            atmosphericGasKgPerSquareMeter = AtmosphericFloatCurves.GetAtmosphericGasDensityKgPerCubicMeter(vessel);

            var specularRatio = Math.Max(0, Math.Min(1, part.skinTemperature / part.skinMaxTemp));
            var diffuseRatio = 1 - specularRatio;
            var maximumDragCoefficient = 4 * specularRatio + 3.3 * diffuseRatio;
            var normalizedOrbitalVelocity = part.vessel.obt_velocity.normalized;
            var cosOrbitRaw = Vector3d.Dot(this.part.transform.up, normalizedOrbitalVelocity);
            var cosObitalDrag = Math.Abs(cosOrbitRaw);
            var squaredCosOrbitalDrag = cosObitalDrag * cosObitalDrag;
            var siderealSpeed = 2 * vessel.mainBody.Radius * Math.PI / vessel.mainBody.rotationPeriod;
            var effectiveSurfaceArea = cosObitalDrag * currentSurfaceArea * (IsEnabled ? 1 : 0);

            var highAltitudeDistance = Math.Min(1, vessel.altitude / vessel.mainBody.atmosphereDepth);
            var highAtmosphereModifier = highAltitudeDistance * highAltitudeDistance * highAltitudeDistance;
            var lowOrbitModifier = Math.Min(1, vessel.mainBody.atmosphereDepth / vessel.altitude);
            var highOrbitModifier = Math.Sqrt(1 - lowOrbitModifier);
            var effectiveSpeedForDrag = Math.Max(0, vessel.obt_speed - siderealSpeed * lowOrbitModifier);
            var dragForcePerSquareMeter = atmosphericGasKgPerSquareMeter * 0.5 * effectiveSpeedForDrag * effectiveSpeedForDrag;
            maximumDragPerSquareMeter = (float)(dragForcePerSquareMeter * maximumDragCoefficient);
            
            // calculate specular Drag
            Vector3d partNormal = this.part.transform.up;
            if (cosOrbitRaw < 0)
                partNormal = -partNormal;

            var specularDragCoefficient = squaredCosOrbitalDrag + 3 * squaredCosOrbitalDrag * highOrbitModifier;
            var specularDragPerSquareMeter = specularDragCoefficient * dragForcePerSquareMeter * specularRatio;
            var specularDragInNewton = specularDragPerSquareMeter * effectiveSurfaceArea;
            specularSailDragInNewton = (float)specularDragInNewton;
            var specularDragForce = specularDragInNewton * partNormal;

            // calculate Diffuse Drag
            var diffuseDragCoefficient = 1 + highOrbitModifier + squaredCosOrbitalDrag * 1.3 * highOrbitModifier;
            var diffuseDragPerSquareMeter = diffuseDragCoefficient * dragForcePerSquareMeter * diffuseRatio;
            var diffuseDragInNewton = diffuseDragPerSquareMeter * effectiveSurfaceArea;
            diffuseSailDragInNewton = (float)diffuseDragInNewton;
            var diffuseDragForce = diffuseDragInNewton * normalizedOrbitalVelocity;

            var combinedDragDeceleration = (specularDragForce + diffuseDragForce) / vesselMassInKg;

            // apply drag to vessel
            // ↓ Should this drag value be multiplied by -1? ######
            ChangeVesselVelocity(this.vessel, universalTime, highAtmosphereModifier * combinedDragDeceleration * (double)(decimal)TimeWarp.fixedDeltaTime);

            weightedDragCoefficient = specularDragCoefficient * specularRatio + diffuseDragCoefficient * diffuseRatio;

            // increase temperature skin
            dragHeatInMegajoule = highAtmosphereModifier * dragForcePerSquareMeter * effectiveSurfaceArea * heatMultiplier * (0.1 + cosObitalDrag) * 1e-3;
            dragHeatInJoule = dragHeatInMegajoule * 1e+6;
}

Further testing need to be done

Edited by 01010101lzy
update
Link to comment
Share on other sites

  • 1 month later...
16 minutes ago, danielboro said:

1-can you remove some of the info in the sail window?

way too big for my screen

 

What I could do is put the information in a separate window, this should be very convenient as it would also be accessible in map view

16 minutes ago, danielboro said:

2- can you add a way to point the ship so the force will be along the wanted direction? (like node or prograde/retrograde)

 

That not possible because the sail is fixed to the frame, instead what I could do is optionally make the force vectors visible, giving new players a better sense of what is happening.

Edited by FreeThinker
Link to comment
Share on other sites

On 12/30/2018 at 1:26 PM, 01010101lzy said:

Is the direction of the sail's atmospheric drag reversed in the latest version for 1.5.1? I watched the Apoapsis increasing quickly when opening this sail up in low orbit (see pic), and even seeing my probe accelerating like hell when hitting this atmosphere.

KSP configuration:

  • KSP 1.5.1
  • with DLC
  • 3.2x Kerbin
  • FAR installed
  • KSPIE not installed
  • the rest should be irrelevant

5c28b8fe484c6.png

------ update ------

Went to see the source code.

I suppose there's a missing -1 on line 1058 in https://github.com/sswelm/KSP-Interstellar-Extended/blob/master/PhotonSail/ModulePhotonSail.cs? (Not very sure)


// starting at line 1015
		private void ApplyDrag(double universalTime, double vesselMassInKg)
        {
            atmosphericGasKgPerSquareMeter = AtmosphericFloatCurves.GetAtmosphericGasDensityKgPerCubicMeter(vessel);

            var specularRatio = Math.Max(0, Math.Min(1, part.skinTemperature / part.skinMaxTemp));
            var diffuseRatio = 1 - specularRatio;
            var maximumDragCoefficient = 4 * specularRatio + 3.3 * diffuseRatio;
            var normalizedOrbitalVelocity = part.vessel.obt_velocity.normalized;
            var cosOrbitRaw = Vector3d.Dot(this.part.transform.up, normalizedOrbitalVelocity);
            var cosObitalDrag = Math.Abs(cosOrbitRaw);
            var squaredCosOrbitalDrag = cosObitalDrag * cosObitalDrag;
            var siderealSpeed = 2 * vessel.mainBody.Radius * Math.PI / vessel.mainBody.rotationPeriod;
            var effectiveSurfaceArea = cosObitalDrag * currentSurfaceArea * (IsEnabled ? 1 : 0);

            var highAltitudeDistance = Math.Min(1, vessel.altitude / vessel.mainBody.atmosphereDepth);
            var highAtmosphereModifier = highAltitudeDistance * highAltitudeDistance * highAltitudeDistance;
            var lowOrbitModifier = Math.Min(1, vessel.mainBody.atmosphereDepth / vessel.altitude);
            var highOrbitModifier = Math.Sqrt(1 - lowOrbitModifier);
            var effectiveSpeedForDrag = Math.Max(0, vessel.obt_speed - siderealSpeed * lowOrbitModifier);
            var dragForcePerSquareMeter = atmosphericGasKgPerSquareMeter * 0.5 * effectiveSpeedForDrag * effectiveSpeedForDrag;
            maximumDragPerSquareMeter = (float)(dragForcePerSquareMeter * maximumDragCoefficient);
            
            // calculate specular Drag
            Vector3d partNormal = this.part.transform.up;
            if (cosOrbitRaw < 0)
                partNormal = -partNormal;

            var specularDragCoefficient = squaredCosOrbitalDrag + 3 * squaredCosOrbitalDrag * highOrbitModifier;
            var specularDragPerSquareMeter = specularDragCoefficient * dragForcePerSquareMeter * specularRatio;
            var specularDragInNewton = specularDragPerSquareMeter * effectiveSurfaceArea;
            specularSailDragInNewton = (float)specularDragInNewton;
            var specularDragForce = specularDragInNewton * partNormal;

            // calculate Diffuse Drag
            var diffuseDragCoefficient = 1 + highOrbitModifier + squaredCosOrbitalDrag * 1.3 * highOrbitModifier;
            var diffuseDragPerSquareMeter = diffuseDragCoefficient * dragForcePerSquareMeter * diffuseRatio;
            var diffuseDragInNewton = diffuseDragPerSquareMeter * effectiveSurfaceArea;
            diffuseSailDragInNewton = (float)diffuseDragInNewton;
            var diffuseDragForce = diffuseDragInNewton * normalizedOrbitalVelocity;

            var combinedDragDeceleration = (specularDragForce + diffuseDragForce) / vesselMassInKg;

            // apply drag to vessel
            // ↓ Should this drag value be multiplied by -1? ######
            ChangeVesselVelocity(this.vessel, universalTime, highAtmosphereModifier * combinedDragDeceleration * (double)(decimal)TimeWarp.fixedDeltaTime);

            weightedDragCoefficient = specularDragCoefficient * specularRatio + diffuseDragCoefficient * diffuseRatio;

            // increase temperature skin
            dragHeatInMegajoule = highAtmosphereModifier * dragForcePerSquareMeter * effectiveSurfaceArea * heatMultiplier * (0.1 + cosObitalDrag) * 1e-3;
            dragHeatInJoule = dragHeatInMegajoule * 1e+6;
}

Further testing need to be done

Not sure but it appears the DiffuseDrag vector should be multiplied by -1, as it supposed to be a force opposite to the orbital vector.

Edited by FreeThinker
Link to comment
Share on other sites

On 1/31/2019 at 4:00 PM, FreeThinker said:

What I could do is put the information in a separate window, this should be very convenient as it would also be accessible in map view

That not possible because the sail is fixed to the frame, instead what I could do is optionally make the force vectors visible, giving new players a better sense of what is happening.

ill try to write a KOS script to point the ship
i dont know what data ill need but the expected/current F applied by the sail is a mast

do you think you can add bearing of the F to the list on display?

 

p.s.
if you ever have the time and inclination breaking KSPIE to a number of submod (even if ther is some dependence) will be a good thing

like a reactor pack, beam pack, engean pack

 

edit:

after some reading and testing it look that as long as the direction i want the force has a redial out component i can just point in the direction i want and its good inaf
and last night i got a 120 TON space station to mun orbit using 500 dV of fule and the rest using a sail ~ 50% less dV then normal

Edited by danielboro
Link to comment
Share on other sites

  • 4 weeks later...

UI problem

if the KOS terminal is in focus the sail window is not updated

is this something you can fix?

 

p.s.

im using this KOS script to lower AP and PE  in mun orbit

CLEARSCREEN.
//	if KUNIVERSE:CANQUICKSAVE KUNIVERSE:QUICKSAVE().
//	set startpartnum to SHIP:PARTS:LENGTH.
set Rn to SHIP:partSNAMED("sm-solar-sail").
set Rn to rn[0]:GETMODULE("ModulePhotonSail").
	lock KSCLEA to Rn:GETFIELD("KSC Laser elevation angle").
	print ag1.
	until ag1{
		if SHIP:ELECTRICCHARGE<200 if Rn:hasevent("Retract Sail") Rn:DOEVENT("Retract Sail"). 
		if prograde:vector*Sun:position >1 print "sun" at (0,2).
		if prograde:vector*kerbin:position >1 print "kerbin" at (0,2).
		print "kerbin: "+prograde:vector*kerbin:position at (0,4).
		print "sun: "+prograde:vector*sun:position at (0,5).
		print "rn: "+rn:GETFIELD("KSC Laser elevation angle") at (0,1).
		print "ksclea: "+KSCLEA at (0,0).
		if KSCLEA>68 and prograde:vector*kerbin:position >1 {
			print "kerbin" at (0,8).
			if VANG(-kerbin:position,FACING:VECTOR)<0.5 set warp to 3.
				else set warp to 0.
			lock steering to -kerbin:position.
			if Rn:hasevent("Deploy Sail") and SHIP:ELECTRICCHARGE>200 Rn:DOEVENT("Deploy Sail").
		} else
		if prograde:vector*Sun:position >1 {
			print "sun   " at (0,8).
			if VANG(-sun:position,FACING:VECTOR)<0.5 set warp to 3.
				else set warp to 0.
			lock steering to -Sun:position.
			if Rn:hasevent("Deploy Sail") and SHIP:ELECTRICCHARGE>200 Rn:DOEVENT("Deploy Sail").
		}else {print "      " at (0,8). unlock steering. if Rn:hasevent("Retract Sail") Rn:DOEVENT("Retract Sail"). if warp<3 set warp to 3.}
		if SHIP:ELECTRICCHARGE<200 if Rn:hasevent("Retract Sail") Rn:DOEVENT("Retract Sail"). 
		wait 1.
	}

 

Edited by danielboro
Link to comment
Share on other sites

17 hours ago, danielboro said:

UI problem

if the KOS terminal is in focus the sail window is not updated


 

 

In order to keep the main KSP game from seeing your keypresses in kOS as commands to the ship, kOS has to turn on almost all the input lock flags in the game while the terminal is focused.  This is probably what is messing up this mod - it's probably not updating when certain input locks are on.

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
  • 2 weeks later...

I'm testing the solar cell sail on the launchpad, as it's not clear from the description how much charge it generates.  The part window says it's generating power (3ish EC/s, I think just from the doors) but it doesn't actually seem to be counting; it should be enough to keep my probe core powered, but I'm still losing EC at the standard rate for the core.

 

Edit:  I just did a test with the sail upside down, and it does charge the craft now.  But for some reason, when the doors are pointed up and the sail pointed down (and thus getting no sun), it reports a tiny amount of EC/s but never applies it AFAICT.

Edited by GDorn
More sleuthing.
Link to comment
Share on other sites

I also suspected that the R&D upgrades responsible for reducing the weight of photon sails aren't working properly, so I just bought the 'Orbital Assembly' tech and checked the weight of the solar cell sail before and after - it's 1 ton in both cases.

Link to comment
Share on other sites

2 hours ago, GDorn said:

I also suspected that the R&D upgrades responsible for reducing the weight of photon sails aren't working properly, so I just bought the 'Orbital Assembly' tech and checked the weight of the solar cell sail before and after - it's 1 ton in both cases.

I will look into it

Link to comment
Share on other sites

12 hours ago, The-Doctor said:

Just how large in scale can the sail get?

Theoretically, there is no real limitation. Practically the main limitation would be KSP Physics range which by default is 2.5 km  (if I'm not mistaken). If you want to experiment with larger sails then 5 km, you would have to increase physics range (with Physics Range Extender).  You probably also have to manually modify the part config file and add larger tweak scale sizes. I imagine you can easily scale it to 200 km diameter this way.

Edited by FreeThinker
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...