Jump to content

[1.8.1-1] [PLEASE FORK ME] Kopernicus & KittopiaTech


Thomas P.

Recommended Posts

1 hour ago, Maelstrom Vortex said:

Solar panels aren't tracking properly with Koppernicus installed and I was told it was most likely due to how Koppernicus tracks. Any one know a fix for this or what I need to do to get it adjusted? I'm assuming there's something about the config perhaps I missed.

Does this post help?

 

Link to comment
Share on other sites

16 hours ago, wile1411 said:

Does this post help?

 

I'm using Interstellar and near Future Solar, both of which whose panels have been rendered non-functional, but this isn't really a good solution for me. I need this to work with interstellar so I can travel to other star systems and have the panels work with their given stellar body. Is there no way to get the three into a compatible state?

 

Edited by Maelstrom Vortex
Link to comment
Share on other sites

30 minutes ago, Maelstrom Vortex said:

I'm using Interstellar and near Future Solar, both of which whose panels have been rendered non-functional, but this isn't really a good solution for me. I need this to work with interstellar so I can travel to other star systems and have the panels work with their given stellar body. Is there no way to get the three into a compatible state?

 

Not currently.

Link to comment
Share on other sites

I have investigated, and looking at the following code

 public override void PostCalculateTracking(Boolean trackingLOS, Vector3 trackingDirection)
            {
                // Maximum values
                Single maxAOA = 0;
                Double maxFlowRate = 0;
                KopernicusStar maxStar = null;

                // Override layer mask
                planetLayerMask = ModularFlightIntegrator.SunLayerMask;

                // Efficiency modifier
                _efficMult = (temperatureEfficCurve.Evaluate((Single)part.skinTemperature) * timeEfficCurve.Evaluate((Single)((Planetarium.GetUniversalTime() - launchUT) * 1.15740740740741E-05)) * efficiencyMult);
                _flowRate = 0;
                sunAOA = 0;

                // Go through all stars
                foreach (KopernicusStar star in KopernicusStar.Stars)
                {
                    // Calculate stuff
                    Vector3 trackDir = (star.sun.transform.position - panelRotationTransform.position).normalized;
                    CelestialBody old = trackingBody;
                    trackingTransformLocal = star.sun.transform;
                    trackingTransformScaled = star.sun.scaledBody.transform;
                    trackingLOS = CalculateTrackingLOS(trackDir, ref blockingObject);
                    trackingTransformLocal = old.transform;
                    trackingTransformScaled = old.scaledBody.transform;

                    // Calculate sun AOA
                    Single _sunAOA = 0f;
                    if (!trackingLOS)
                    {
                        _sunAOA = 0f;
                        status = "Blocked by " + blockingObject;
                    }
                    else
                    {
                        status = "Direct Sunlight";
                        if (panelType == PanelType.FLAT)
                        {
                            _sunAOA = Mathf.Clamp(Vector3.Dot(trackingDotTransform.forward, trackDir), 0f, 1f);
                        }
                        else if (panelType != PanelType.CYLINDRICAL)
                        {
                            _sunAOA = 0.25f;
                        }
                        else
                        {
                            Vector3 direction;
                            if (alignType == PanelAlignType.PIVOT)
                            {
                                direction = trackingDotTransform.forward;
                            }
                            else if (alignType != PanelAlignType.X)
                            {
                                direction = alignType != PanelAlignType.Y ? part.partTransform.forward : part.partTransform.up;
                            }
                            else
                            {
                                direction = part.partTransform.right;
                            }
                            _sunAOA = (1f - Mathf.Abs(Vector3.Dot(direction, trackDir))) * 0.318309873f;
                        }
                    }

                    // Calculate distance multiplier
                    Double __distMult = 1;
                    if (!useCurve)
                    {
                        if (!KopernicusStar.SolarFlux.ContainsKey(star.name))
                            continue;
                        __distMult = (Single)(KopernicusStar.SolarFlux[star.name] / stockLuminosity);
                    }
                    else
                    {
                        __distMult = powerCurve.Evaluate((star.sun.transform.position - panelRotationTransform.position).magnitude);
                    }

                    // Calculate flow rate
                    Double __flowRate = _sunAOA * _efficMult * __distMult;
                    if (part.submergedPortion > 0)
                    {
                        Double altitudeAtPos = -FlightGlobals.getAltitudeAtPos((Vector3d) secondaryTransform.position, vessel.mainBody);
                        altitudeAtPos = (altitudeAtPos * 3 + part.maxDepth) * 0.25;
                        if (altitudeAtPos < 0.5)
                        {
                            altitudeAtPos = 0.5;
                        }
                        Double num = 1 / (1 + altitudeAtPos * part.vessel.mainBody.oceanDensity);
                        if (part.submergedPortion >= 1)
                        {
                            __flowRate = __flowRate * num;
                        }
                        else
                        {
                            __flowRate = __flowRate * UtilMath.LerpUnclamped(1, num, part.submergedPortion);
                        }
                        status += ", Underwater";
                    }
                    sunAOA += (Single)__flowRate * _sunAOA;
                    if (__flowRate > maxFlowRate)
                    {
                        maxFlowRate = __flowRate;
                    }

                    // Apply the flow rate
                    _flowRate += __flowRate;

                    // Check if we have a new maximum
                    if (_sunAOA > maxAOA)
                    {
                        maxAOA = _sunAOA;
                        maxStar = star;
                    }
                }

                // Sun AOA
                sunAOA /= (Single)maxFlowRate;
                _distMult = _flowRate / _efficMult / sunAOA;

                // We got the best star to use
                if (maxStar != null && maxStar.sun != trackingBody)
                {
                    trackingBody = maxStar.sun;
                    GetTrackingBodyTransforms();
                }

                // Use the flow rate
                flowRate = (Single)(resHandler.UpdateModuleResourceOutputs(_flowRate) * flowMult);
            }
}

source: https://github.com/Kopernicus/Kopernicus/blob/6676d6ff9dfcc644bf6ebceea9b98006e5384bed/Kopernicus/Kopernicus.Components/KopernicusSolarPanel.cs

 

I found a possible problem with sunAOA  which could be negative (with pivoting solar array) which would cause maxStar never to be selected, causing  trackingbody not to be set and GetTrackingBodyTransforms() never to be called, causing the solar panels no to track the sun.

Edit:

At second look  Mathf.Abs(Vectore.Dot()) always result in a positive number , causing _sunAOA to become positive as well

But what happens after  trackingBody is set and it enter a second frame wouldn't that stop GetTrackingBodyTransforms() from being called the next frame?

 

 

Edited by FreeThinker
Link to comment
Share on other sites

1 hour ago, Maelstrom Vortex said:

Is this the error line?


  _sunAOA = (1f - Mathf.Abs(Vector3.Dot(direction, trackDir))) * 0.318309873f;

and if so is the fix as simple as changing the - to a +?

At second look  Mathf.Abs(Vectore.Dot()) always result in a positive number , causing _sunAOA to become positive as well

But what happens after  trackingBody is set and it enter a second frame wouldn't that stop GetTrackingBodyTransforms() from being called the next frame?

Edited by FreeThinker
Link to comment
Share on other sites

1 minute ago, FreeThinker said:

At second look  Mathf.Abs(Vectore.Dot()) always result in a positive number , causing _sunAOA to become positive as well

But what happens after  trackingBody is set and it enter a second frame wouldn't that stop GetTrackingBodyTransforms() from being called the next frame?

Wouldn't PEDMAS apply though and the parenthesis be processed first resulting in a negative being assigned to the absolute value function?

Link to comment
Share on other sites

2 hours ago, Maelstrom Vortex said:

Wouldn't PEDMAS apply though and the parenthesis be processed first resulting in a negative being assigned to the absolute value function?

I don't think so, but what the hell is that number 0.318309873f for?

@Thomas P.  Also the flowRate variable becomes 0 while it should be equal to the panels output. This is causing KSPIE to malfunction as it need it for solar power collectors

Edited by FreeThinker
Link to comment
Share on other sites

4 minutes ago, Syczek said:

Kerbin is wrongly lit dark side is light side and light side is twilight side anyone could help me fix that??

We need more info than that. Are you using any mods? Trying to edit Kerbin? Are you experiencing an eclipse? Probably not the last one, but you get the point

Edited by Galileo
Link to comment
Share on other sites

8 minutes ago, Galileo said:

We need more info than that. Are you using any mods? Trying to edit Kerbin? Are you experiencing an eclipse? Probably not the last one, but you get the point

I using Galactic Neighborhood if i spell it right with these packs that are supported in 1.3:

Alternis Kerbol Rekerjiggered

Gameslinx's Planet Overhaul

Kerbol Origins

New Horizons

Uncharted Lands

Asclepius and Kronkus

Boris system

OPM edited by u Galileo

Transkeptunians and Keridiani edited by sigma88

and Extrasolar planet beyond kerbol

plus bunch mods that adds part contracts and technological thingy

Thing is that Kerbin and only Kerbin have that fancy bug and sun is visible for both sides.In dark which is now light sun is visible in flight mode and in light side which is now twilight zone sun is visible but alot dimmer than in dark side

 

Edited by Syczek
Link to comment
Share on other sites

14 minutes ago, Galileo said:

Perhaps @Sigma88 has seen something like this, but to get support from him, you will need the proper documentation,like logs, and other goodies

But did ring any bell for u that thing?? Because i fixed that once myself but that was long ago and my memory is not one of best.I looking for hint so my memory will hit on again

it is like this but i didnt edit anything.I have no idea what means that normal map

Edited by Syczek
Link to comment
Share on other sites

46 minutes ago, Syczek said:

But did ring any bell for u that thing?? Because i fixed that once myself but that was long ago and my memory is not one of best.I looking for hint so my memory will hit on again

it is like this but i didnt edit anything.I have no idea what means that normal map

A normal map is a texture. when a normal map is saved incorrectly, a planet will be lit incorrectly by the light source. 

I can't know for sure if this is your issue because you haven't posted a screenshot. 

I doubt that it is your issue because the packs that are compatible with GN are pretty high quality for the most part. Still, I'll need a screenshot.

Link to comment
Share on other sites

34 minutes ago, Galileo said:

A normal map is a texture. when a normal map is saved incorrectly, a planet will be lit incorrectly by the light source. 

I can't know for sure if this is your issue because you haven't posted a screenshot. 

I doubt that it is your issue because the packs that are compatible with GN are pretty high quality for the most part. Still, I'll need a screenshot.

I will load my KSP and make screenshot asap as game load(it took some time).It now take longer time i guess.Now for some reason i runned into issue that i cannot press start what the heck

Edited by Syczek
Link to comment
Share on other sites

1 hour ago, Syczek said:

I will load my KSP and make screenshot asap as game load(it took some time).It now take longer time i guess.Now for some reason i runned into issue that i cannot press start what the heck

Time to check your file cache, sounds like you have an outright game data corruption. That or you alt+tabbed while loading Kerbals.

Edited by Maelstrom Vortex
Link to comment
Share on other sites

Just now, Maelstrom Vortex said:

Time to check your file cache, sounds like you have an outright game data corruption. That or you alt+tabbed while loading Kerbals.

Well i have big fear that i had to make clean install of ksp geez

Link to comment
Share on other sites

1 hour ago, Galileo said:

A normal map is a texture. when a normal map is saved incorrectly, a planet will be lit incorrectly by the light source. 

I can't know for sure if this is your issue because you haven't posted a screenshot. 

I doubt that it is your issue because the packs that are compatible with GN are pretty high quality for the most part. Still, I'll need a screenshot.

http://imgur.com/a/Ky8lY

Here is my screenshot i now doing clear install having only installed galactic neighborhood sve alternis,chani pack,opm,transkeptunian and nothing more. As is seen on image kerbol is behind kerbin yet sun side is in front

Edited by Syczek
Link to comment
Share on other sites

1 minute ago, Syczek said:

http://imgur.com/a/Ky8lY

Here is my screenshot i now doing clear install having only installed galactic neighborhood sve alternis,chani pack,opm,transkeptunian and nothing more

You should really try with the minimum amount of mods. Like only GN and SVE, then add the others back one at a time until the issue occurs. Then you will have the culprit. Right now, nobody can tell you what is wrong, not even with that screenshot. You may even have your ambient light setting too high

Link to comment
Share on other sites

I wanted to add a minute atmosphere to Minmus to justify my dust clouds up there, just minimum pressure and just below the height of the dust.

But now during the day everything is lit and the sky is blue.

What would I have to change to remove the atmospheric effects? (Apart from removing the atmosphere ... :wink: )

Spoiler

@Kopernicus
{
    @Body[Minmus]
    {
        Atmosphere
        {
            enabled = true
            oxygen = false
            
            altitude = 400.0
            atmosphereMolarMass = 0.000019999990016222
            pressureCurve
            {
                key = 0 1
                key = 50 0.5
                key = 400 0
            }
            temperatureSeaLevel = 223.15
            temperatureCurve
            {
                key = 0 223.15
                key = 400 233.15
            }
        }    
    }
}

And yes, I am using Scatterer, PlanetShine and stuff.

Edited by KerbMav
Link to comment
Share on other sites

2 hours ago, Galileo said:

You should really try with the minimum amount of mods. Like only GN and SVE, then add the others back one at a time until the issue occurs. Then you will have the culprit. Right now, nobody can tell you what is wrong, not even with that screenshot. You may even have your ambient light setting too high

I will try with only sve with his requirements then gn. But i have feeling that gn is culprit

Yes GN is the culprit

Anyone got gn and had issue because stocksun becomes galactic core and added a clone of sun that planets orbit in kerbol system

Anyone could help me figure how to fix kerbin ??

Edited by Syczek
Link to comment
Share on other sites

On ‎8‎/‎5‎/‎2017 at 2:54 PM, KerbMav said:

I wanted to add a minute atmosphere to Minmus to justify my dust clouds up there, just minimum pressure and just below the height of the dust.

But now during the day everything is lit and the sky is blue.

What would I have to change to remove the atmospheric effects? (Apart from removing the atmosphere ... :wink: )

I had this same issue once before, where I wanted a thin atmosphere but a black starry nighttime sky.  I tried several things but was never able to figure it out.  No matter what I did, when daylight came the stars disappears and I got a lighted sky.  I eventually gave up and deleted the atmosphere.  Of course that was several versions of Kopernicus ago, so maybe things have changed.  What happens if you try this...

Spoiler

@Kopernicus
{
    @Body[Minmus]
    {
        Atmosphere
        {
            lightcolor = 0,0,0,0
            enabled = true
            oxygen = false 

            altitude = 400.0
            atmosphereMolarMass = 0.000019999990016222
            pressureCurve
            {
                key = 0 1
                key = 50 0.5
                key = 400 0
            }
            temperatureSeaLevel = 223.15
            temperatureCurve
            {
                key = 0 223.15
                key = 400 233.15
            }
        }    
    }
}

 

Edited by OhioBob
Link to comment
Share on other sites

Any possibility I could convince someone to give a look at sunAOA, I really think that's what's causing my directable panels to malfunction while all others work normal. I can be around Eve or around Kerbin and the panels will point away from the sun!

Edited by Maelstrom Vortex
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...