StollD / Kopernicus

Kopernicus is a mod for Kerbal Space Program which allows users to replace the planetary system used by the game.
GNU Lesser General Public License v3.0
1 stars 3 forks source link

The discussion issue #4

Open StollD opened 9 years ago

StollD commented 9 years ago

Created to move discussion out of the one commit, which is hard to find every time. ^^

As I said before: Today I will write the first PQS configuration loader and apply the loaded configuration to the example PQS I wrote. Then, I'm going to look into UnityGUI to program a ScaledSpace updater / exporter.

teknoman117 commented 9 years ago

Um, whats wrong with the existing one? It computes a new scaled space mesh from the PQS mods applied to an object (well, whenever we get objects that have them...) and writes it to the GameData/Kopernicus/Cache folder. If the game loads and cache files are present, it loads them instead of regenerating them. See Body.cs:237.

StollD commented 9 years ago

I've tried that with my Test PQS and it wasn't working.

----- Ursprüngliche Nachricht ----- Von: "Nathaniel Lewis" notifications@github.com Gesendet: ‎25.‎03.‎2015 06:21 An: "ThomasKerman/Kopernicus" Kopernicus@noreply.github.com Cc: "Dorian Stoll" dorianstoll@googlemail.com Betreff: Re: [Kopernicus] The discussion issue (#4)

Um, whats wrong with the existing one? It computes a new scaled space mesh from the PQS mods applied to an object (well, whenever we get objects that them...) and writes it to the GameData/Kopernicus/Cache folder. If the game loads and cache files are present, it loads them instead of regenerating them. See Body.cs:237. — Reply to this email directly or view it on GitHub.

teknoman117 commented 9 years ago

Was it a PQS mod which applied changed to the heightmap? This code functioned correctly for the old Kopernicus test planet. That being said, I didn't support all the PQS mods, see Body.cs:284 for where it decides which PQS mods to enable.

teknoman117 commented 9 years ago

It basically looks for any PQS mods which contains "VertexHeight" or "VertexSimplexHeight" in the type name (there are quite a few) and turns those on. I'm headed to bed now (its 10:30 at night in California), I'll look at whatever you push in the morning. The issue could also be the ol' observation/perspective problem. If the Earth were shrunk to the size of an orange, the tallest mountains and the deepest ocean trenches would be barely perceptible. It certainly tripped me up a few times in testing. oh, the ground moved by 0.01 of a scaled space unit...

StollD commented 9 years ago

Yes, it was VertexHeightMap. I'll look into this after school, maybe my PQS is just generated after ScaledSpace loads, I don't know.

----- Ursprüngliche Nachricht ----- Von: "Nathaniel Lewis" notifications@github.com Gesendet: ‎25.‎03.‎2015 06:28 An: "ThomasKerman/Kopernicus" Kopernicus@noreply.github.com Cc: "Dorian Stoll" dorianstoll@googlemail.com Betreff: Re: [Kopernicus] The discussion issue (#4)

Was it a PQS mod which applied changed to the heightmap? This code functioned correctly for the old Kopernicus test planet. That being said, I didn't support all the PQS mods, see Body.cs:284 for where it decides which PQS mods to enable. — Reply to this email directly or view it on GitHub.

StollD commented 9 years ago

After debugging my PQS-node loader code the whole day, I'm stuck. I've got a PQS mod to work, but if I put in the node-loaded variables, the Game crashes. Could you maybe explain, how to spawn a PQSMod via the mods-list in PQSLoader.cs?

P.S. I'll upload my code tomorrow (German time), if I can't fix this. P.P.S Sorry for being so extremely nooby on this.

teknoman117 commented 9 years ago

Dude - thank you for trying at least. I really appreciate you trying to help with this mod, it's been on my mind for the better part of the last 8 months, I just want to get it done and over with so all I have to worry about with it is the occasional bug fix.

teknoman117 commented 9 years ago

The biggest thing about the PQS though is that it requires a minimum number of mods before becoming functional. I basically used the simplest of bodies as a reference of the minimum requirement of PQS mods.

teknoman117 commented 9 years ago

Although for now I'd just say to get the star systems configuration to work.

StollD commented 9 years ago

Is there a way to rename the Sun via. ModuleManager? I've tried that with MM and editing the System.cfg but it didn't worked. I need that for the StarSystems config. (Augustus is already "spamming" (more stressing) me about this).

teknoman117 commented 9 years ago

He does that doesn't he, always being commanding or whiny. Either way, you shouldn't rename the sun. There are some references to it by name instead of by ID in the KSP code. Best idea is to create a new body for the center of the universe and reparent the Sun to it. But in the future, if it ever were to be fixed, this renames it, but you'd have to patch everything that defined the sun as its reference body, or else everything breaks....

[code] @Kopernicus:AFTER[Kopernicus] { @Body[Sun] { @name = HerpDerpinson } } [/code]

To reparent the sun, you could do this

[code] @Kopernicus:AFTER[Kopernicus] { @Body[Sun] { @Orbit { // -- Note the "@" on the front of referenceBody. This means edit an existing attribute @referenceBody = Gargantua

        // Other orbit stuff
        inclination = 2
        eccentricity = 0
        semiMajorAxis = 3.0E+11 
        longitudeOfAscendingNode = 0
        argumentOfPeriapsis = 0
        meanAnomalyAtEpoch = 0
        epoch = 0
        color = 1,0.5,0,1
    }
}

} [/code]

teknoman117 commented 9 years ago

Freaking comment formatting

StollD commented 9 years ago

If I do this, Kopernicus crashes with: "Exception: "Blacky Karman" not found."

----- Ursprüngliche Nachricht ----- Von: "Nathaniel R. Lewis" notifications@github.com Gesendet: ‎26.‎03.‎2015 21:41 An: "ThomasKerman/Kopernicus" Kopernicus@noreply.github.com Cc: "Dorian Stoll" dorianstoll@googlemail.com Betreff: Re: [Kopernicus] The discussion issue (#4)

He does that doesn't he, always being commanding or whiny. Either way, you shouldn't rename the sun. There are some references to it by name instead of by ID in the KSP code. Best idea is to create a new body for the center of the universe and reparent the Sun to it. But in the future, if it ever were to be fixed, this renames it, but you'd have to patch everything that defined the sun as its reference body, or else everything breaks.... @Kopernicus:AFTER[Kopernicus] { @Body[Sun] { @name = HerpDerpinson } } To reparent the sun, you could do this @Kopernicus:AFTER[Kopernicus] { @Body[Sun] { @Orbit { // -- Note the "@" on the front of referenceBody. This means edit an existing attribute @referenceBody = Gargantua // Other orbit stuff inclination = 2 eccentricity = 0 semiMajorAxis = 3.0E+11 longitudeOfAscendingNode = 0 argumentOfPeriapsis = 0 meanAnomalyAtEpoch = 0 epoch = 0 color = 1,0.5,0,1 } } } — Reply to this email directly or view it on GitHub.

teknoman117 commented 9 years ago

where does it crash?

teknoman117 commented 9 years ago

Could you post the config?

StollD commented 9 years ago

With this config, a new sun is created, but no planet gets moved..

@Kopernicus:AFTER[Kopernicus] { Body { name = Kerbol flightGlobalsIndex = 200 Template { name = Sun } Orbit { referenceBody = Sun color = 0.7,0.7,0.7,1 inclination = 0 eccentricity = 0 semiMajorAxis = 4500000000000 longitudeOfAscendingNode = 0 argumentOfPeriapsis = 0 meanAnomalyAtEpoch = 0 epoch = 0 } }

@Body[!name[Kerbol]]
{
    @Orbit[*]:HAS[referenceBody[Sun]]
    {
        @referenceBody = Kerbol
    }
}

}

teknoman117 commented 9 years ago

I would simplify that a bit. Create a copy of the sun for the center of the universe with no orbit specified. Then just re parent the existing sun to it by defining an orbit. Don't rename or change the flight globals index of the existing sun. If you do, a bunch of stuff like contacts break.

On Mar 27, 2015, at 11:13 AM, Dorian Stoll notifications@github.com wrote:

With this config, a new sun is created, but no planet gets moved..

@Kopernicus:AFTER[Kopernicus] { Body { name = Kerbol flightGlobalsIndex = 200 Template { name = Sun } Orbit { referenceBody = Sun color = 0.7,0.7,0.7,1 inclination = 0 eccentricity = 0 semiMajorAxis = 4500000000000 longitudeOfAscendingNode = 0 argumentOfPeriapsis = 0 meanAnomalyAtEpoch = 0 epoch = 0 } }

@Body[!name[Kerbol]] { @Orbit[*]:HAS[referenceBody[Sun]] { @referenceBody = Kerbol } } }

— Reply to this email directly or view it on GitHub.

StollD commented 9 years ago

If I do this, nothing happens :(

@Kopernicus:AFTER[Kopernicus] { Body { name = Kerbol Template { name = Sun } Properties { description = :D } }

@Body[Sun]
{
    @Orbit
    {
        // Change Eeloo to orbit kerbin (obviously, this doesn't make sense but its just an example)
        // -- Note the "@" on the front of referenceBody.  This means edit an existing attribute
        @referenceBody = Kerbol

    }
}

}

teknoman117 commented 9 years ago

Huh. I'll take a look at it when I get home.

Sent from my iPhone

On Mar 27, 2015, at 12:25 PM, Dorian Stoll notifications@github.com wrote:

If I do this, nothing happens :(

@Kopernicus:AFTER[Kopernicus] { Body { name = Kerbol Template { name = Sun } Properties { description = :D } }

@Body[Sun] { @Orbit { // Change Eeloo to orbit kerbin (obviously, this doesn't make sense but its just an example) // -- Note the "@" on the front of referenceBody. This means edit an existing attribute @referenceBody = Kerbol

}

} }

— Reply to this email directly or view it on GitHub.

StollD commented 9 years ago

Thanks, Augustus is already spamming me about this. Another question: How do we release this? Simply in the Kopernicus thread, or in another thread?

teknoman117 commented 9 years ago

Hmm. We probably want to maintain it as a separate project.

Sent from my iPhone

On Mar 27, 2015, at 12:34 PM, Dorian Stoll notifications@github.com wrote:

Thanks, Augustus is already spamming me about this. Another question: How do we release this? Simply in the Kopernicus thread, or in another thread?

— Reply to this email directly or view it on GitHub.

StollD commented 9 years ago

I think so too.

----- Ursprüngliche Nachricht ----- Von: "Nathaniel R. Lewis" notifications@github.com Gesendet: ‎27.‎03.‎2015 20:37 An: "ThomasKerman/Kopernicus" Kopernicus@noreply.github.com Cc: "Dorian Stoll" dorianstoll@googlemail.com Betreff: Re: [Kopernicus] The discussion issue (#4)

Hmm. We probably want to maintain it as a separate project.

Sent from my iPhone

On Mar 27, 2015, at 12:34 PM, Dorian Stoll notifications@github.com wrote:

Thanks, Augustus is already spamming me about this. Another question: How do we release this? Simply in the Kopernicus thread, or in another thread?

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub.

StollD commented 9 years ago

I don't want to stress you, but is there a way to fix the custom corona textures? VisualStudio and KSP isn't showing errors, they just don't appear.

teknoman117 commented 9 years ago

I understand why that config wasn't working - the sun doesn't have an orbit so using @Orbit doesn't actually do anything. Just do Orbit { referenceBody = Blacky Karman // other orbit settings } to add an orbit definition

teknoman117 commented 9 years ago

corona textures aren't working? Could you send me the config & textures so I can test?

StollD commented 9 years ago

Just use Nemesis, no Corona there. And thanks!

----- Ursprüngliche Nachricht ----- Von: "Nathaniel R. Lewis" notifications@github.com Gesendet: ‎27.‎03.‎2015 23:20 An: "ThomasKerman/Kopernicus" Kopernicus@noreply.github.com Cc: "Dorian Stoll" dorianstoll@googlemail.com Betreff: Re: [Kopernicus] The discussion issue (#4)

corona textures aren't working? Could you send me the config & textures so I can test? — Reply to this email directly or view it on GitHub.

teknoman117 commented 9 years ago

No corona with Nemesis? Its working over here ... strange.

On Fri, Mar 27, 2015 at 3:24 PM, Dorian Stoll notifications@github.com wrote:

Just use Nemesis, no Corona there. And thanks!

----- Ursprüngliche Nachricht ----- Von: "Nathaniel R. Lewis" notifications@github.com Gesendet: ‎27.‎03.‎2015 23:20 An: "ThomasKerman/Kopernicus" Kopernicus@noreply.github.com Cc: "Dorian Stoll" dorianstoll@googlemail.com Betreff: Re: [Kopernicus] The discussion issue (#4)

corona textures aren't working? Could you send me the config & textures so I can test?

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/ThomasKerman/Kopernicus/issues/4#issuecomment-87107372 .

teknoman117 commented 9 years ago

https://drive.google.com/open?id=0B2-P21mrjglsWF9HNHp5YlNQNms&authuser=0

StollD commented 9 years ago

That's actually only the light that is emitted, not the corona texture. It should look like this here: http://forum.kerbalspaceprogram.com/threads/88168-Early-development-0-24-Kopernicus-Planetary-System-Modifier?p=1800806&viewfull=1#post1800806

This was working with the original at-runtime modifications, but I can't figure out what changed.

P.S. If I use the updated config, the TrackingStation turns black and the log is spammed with NaN errors

----- Ursprüngliche Nachricht ----- Von: "Nathaniel R. Lewis" notifications@github.com Gesendet: ‎27.‎03.‎2015 23:26 An: "ThomasKerman/Kopernicus" Kopernicus@noreply.github.com Cc: "Dorian Stoll" dorianstoll@googlemail.com Betreff: Re: [Kopernicus] The discussion issue (#4)

https://drive.google.com/open?id=0B2-P21mrjglsWF9HNHp5YlNQNms&authuser=0 — Reply to this email directly or view it on GitHub.

StollD commented 9 years ago

For the NaN errors: Figured it out myself.

----- Ursprüngliche Nachricht ----- Von: "Nathaniel R. Lewis" notifications@github.com Gesendet: ‎27.‎03.‎2015 23:26 An: "ThomasKerman/Kopernicus" Kopernicus@noreply.github.com Cc: "Dorian Stoll" dorianstoll@googlemail.com Betreff: Re: [Kopernicus] The discussion issue (#4)

https://drive.google.com/open?id=0B2-P21mrjglsWF9HNHp5YlNQNms&authuser=0 — Reply to this email directly or view it on GitHub.

StollD commented 9 years ago

Config is ready, if you want to try it out, here: https://www.dropbox.com/s/407sutz7yv9o3kw/StarSystemsReloaded-1.0.zip?dl=0

P.S. Could you make a prerelease on the main repository for this? :-)

teknoman117 commented 9 years ago

You figured out the corona problems?

StollD commented 9 years ago

No, it's just the Config.

----- Ursprüngliche Nachricht ----- Von: "Nathaniel R. Lewis" notifications@github.com Gesendet: ‎28.‎03.‎2015 00:56 An: "ThomasKerman/Kopernicus" Kopernicus@noreply.github.com Cc: "Dorian Stoll" dorianstoll@googlemail.com Betreff: Re: [Kopernicus] The discussion issue (#4)

You figured out the corona problems? — Reply to this email directly or view it on GitHub.

teknoman117 commented 9 years ago

I'll look at it, it might be the issue with the object tags again...

teknoman117 commented 9 years ago

Darn. There are a horrendous amount of bugs when moving kerbin from the default position. I'll play with it more.

Sent from my iPhone

On Mar 27, 2015, at 4:58 PM, Dorian Stoll notifications@github.com wrote:

No, it's just the Config.

----- Ursprüngliche Nachricht ----- Von: "Nathaniel R. Lewis" notifications@github.com Gesendet: ‎28.‎03.‎2015 00:56 An: "ThomasKerman/Kopernicus" Kopernicus@noreply.github.com Cc: "Dorian Stoll" dorianstoll@googlemail.com Betreff: Re: [Kopernicus] The discussion issue (#4)

You figured out the corona problems? — Reply to this email directly or view it on GitHub. — Reply to this email directly or view it on GitHub.

StollD commented 9 years ago

Corona bug fixed https://github.com/ThomasKerman/Kopernicus/commit/667625b3ae3e2a34925cc7cde6eb06379a7fbffc

I hope you are OK with my way doing this.

StollD commented 9 years ago

I think I've nailed the issue with the coronas down to the "active"-property of the SunCoronas object. On the prefab coronas, "active" is true, but on the newly generated ones it's false.

teknoman117 commented 9 years ago

this could be it. Also, I fixed the flight globals problem. The thing that is bugging me is that the space center view is horrifically broken. Like, it randomly timewarps or refuses to responds to the defined sun ... vessel mode is completely fine though. Could be an issue with the space center camera, but I dunno.

StollD commented 9 years ago

It's making me crazy...why has Unity 3 or 4 active-properties, and none of these is true, if I set it to true in code.... :-S

----- Ursprüngliche Nachricht ----- Von: "Nathaniel R. Lewis" notifications@github.com Gesendet: ‎28.‎03.‎2015 21:11 An: "ThomasKerman/Kopernicus" Kopernicus@noreply.github.com Cc: "Dorian Stoll" dorianstoll@googlemail.com Betreff: Re: [Kopernicus] The discussion issue (#4)

this could be it. Also, I fixed the flight globals problem. The thing that is bugging me is that the space center view is horrifically broken. Like, it randomly timewarps or refuses to responds to the defined sun ... vessel mode is completely fine though. Could be an issue with the space center camera, but I dunno. — Reply to this email directly or view it on GitHub.

StollD commented 9 years ago

OK, I've tried all, but the parameters I think I have to modify are write-protected.

teknoman117 commented 9 years ago

There are a couple, mainly because of legacy support. the "enabled" property is whether a component is enabled, "active" describes something, "activeSelf" is if the game object is enabled, "activeInHeirarchy" is false if a parent is disabled, etc/

teknoman117 commented 9 years ago

I'm almost thinking something references the existing corona objects, outside of SunCorona. PQS has this thing where you have to generate a renderer list yourself

teknoman117 commented 9 years ago

The active isn't it. Just did some debugging. They activate properly, but the local positions and scales are way off. So whatever controls those (or currently isn't) is the source of our problems...

teknoman117 commented 9 years ago

https://drive.google.com/file/d/0B2-P21mrjglsR3ZlZ2hmdUwwYTQ/view?usp=sharing

StollD commented 9 years ago

Woah. :O

----- Ursprüngliche Nachricht ----- Von: "Nathaniel R. Lewis" notifications@github.com Gesendet: ‎28.‎03.‎2015 22:35 An: "ThomasKerman/Kopernicus" Kopernicus@noreply.github.com Cc: "Dorian Stoll" dorianstoll@googlemail.com Betreff: Re: [Kopernicus] The discussion issue (#4)

https://drive.google.com/file/d/0B2-P21mrjglsR3ZlZ2hmdUwwYTQ/view?usp=sharing — Reply to this email directly or view it on GitHub.

teknoman117 commented 9 years ago

Basically I've narrowed it down to this - there must be some construct controlling the scale of the coronas. I can't seem to find it though. The scales, positions, and rotations change of the default sun coronas, but not on the custom ones. I've sent Mu a message on Skype, let's see if he'll help us out.

StollD commented 9 years ago

How did you debug this?

teknoman117 commented 9 years ago

I literally wrote some code that dumped the corona.transform.localScale, .localRotation, and .localPosition parameters before and after corona creation and when the star was switched.

StollD commented 9 years ago

Oh, now I see it.

----- Ursprüngliche Nachricht ----- Von: "Nathaniel R. Lewis" notifications@github.com Gesendet: ‎28.‎03.‎2015 23:10 An: "ThomasKerman/Kopernicus" Kopernicus@noreply.github.com Cc: "Dorian Stoll" dorianstoll@googlemail.com Betreff: Re: [Kopernicus] The discussion issue (#4)

I literally wrote some code that dumped the corona.transform.localScale, .localRotation, and .localPosition parameters before and after corona creation and when the star was switched. — Reply to this email directly or view it on GitHub.

teknoman117 commented 9 years ago

As far as the broken space center camera, I'm going to look through the alternis kerbol code to see if they had any secret sauce on getting the light to work with a reparented kerbin.