EnvironmentalVisualEnhancements icon indicating copy to clipboard operation
EnvironmentalVisualEnhancements copied to clipboard

EVE compatability with Kopernicus/RSS

Open NathanKell opened this issue 9 years ago • 21 comments

@rbray89 There are two issues here:

  1. Kopernicus may replace the shaders on bodies. How should we handle compatibility?
  2. Kopernicus supports the renaming (at main menu) of bodies, and also the renaming of only the CelestialBody (with PQS and scaled space versions keeping the old name). How should we handle compatibility?

1 has obvious applications, but I should explain 2. The reason for the "change celestial body name only, and at main menu) is so that KSP will actually work with the homeworld not named Kerbin. Can't replace the PQS name because too much relies on it being still named Kerbin (most of the KSC stuff), and since PQS can't change scaled space can't either or (IIRC) the PQSMod that switches between them has trouble. However, we can safely rename just the CelestialBody, and that allows RSS to have Earth named Earth.

NathanKell avatar Jun 14 '15 07:06 NathanKell

@rbray89 just bumping this--I notice @pingopete says scaledversion textures aren't showing, which I assume means EVE still isn't compatible with Kopernicus shaders...

NathanKell avatar Jul 06 '15 18:07 NathanKell

Hmmm... Afraid I didn't see this until earlier... (1) Hmmm... I try and use the same texture names as the original shaders. I only perform shader replacement (not material) to ensure that we don't loose the textures. I have plans to include as many of the original material parameters that are useful as well.

I didn't realize Kopernicus was loading and performing shader swapping. Does it have a terrain shader as well?

(2) This one I'm not so sure about. It would really depend on which mod gets loaded first. I could try and do a differed load. I only reference things by the CB name and SS transform name.

rbray89 avatar Jul 06 '15 18:07 rbray89

(1) @Teknoman117 would know best, but I believe Kopernicus does replace the materials on both (scaled/PQS). I'll have to dig regarding names.

(2) When do you query CBs? If it's anywhere after mainmenu, then my suggested solution is to use only CB name, grab the CB, and get the scaled space transform by getting that component in the object tree rather than searching for it separately.

NathanKell avatar Jul 06 '15 18:07 NathanKell

Alternative to (2): Use only scaled space transform name, and get component CelestialBody upwards/downwards from the scaled space transform.

NathanKell avatar Jul 06 '15 18:07 NathanKell

(1) If it is material replacement, that could explain it. (2) The query only happens at loading (main menu). The CB and scaled space transforms are then stored locally.

As an aside: Did you guys ever figure out how to add a bona-fide PQS to Jool? I just have a dummy class I use that I can attach PQS mods to. I also wanted to double check that the way I'm attaching PQSMods is correct.

rbray89 avatar Jul 06 '15 19:07 rbray89

Ah, I see. Ouch, yes, that does sound race-condition-y, although it could be solved by the alternate approach above (getting scaled transform only, and then looking in the scaled transform's gameobject for component of type CB i.e. regardless of CB name).

I haven't tried myself, but you can see if adding a PQS node (and required default parameters) to Jool's body definition in Kopernicus works. I rather think it would.

NathanKell avatar Jul 06 '15 19:07 NathanKell

Another approach I had considered is using single frame-delay so that ALL mods would load before mine, regardless of alphabetical order.

rbray89 avatar Jul 06 '15 19:07 rbray89

That's probably safest, tbh, a lot of stuff runs on main menu.

NathanKell avatar Jul 06 '15 19:07 NathanKell

(1) Yes the materials are replaced by Kopernicus, I swear I had a good reason for doing this. Something related to preserving the original when cloning bodies.

Nathaniel Sent from my iPhone

On Jul 6, 2015, at 12:48 PM, NathanKell [email protected] wrote:

That's probably safest, tbh, a lot of stuff runs on main menu.

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

teknoman117 avatar Jul 06 '15 22:07 teknoman117

Which also means if the shaders are changed later they wouldn't be inherited. However, if EVE queried the live CB from main menu it should be fine (versus the shader and material names, as the latter is a random string). New planets and new materials are created at PSystemSpawn, before main menu

teknoman117 avatar Jul 06 '15 22:07 teknoman117

Hmmm... That is what I am doing... Do the replacement materials use the same shader as the original materials (same parameter names, etc)?

rbray89 avatar Jul 06 '15 22:07 rbray89

Yeah it just clones the material but assigns a random name. Unless someone changed that....

teknoman117 avatar Jul 07 '15 01:07 teknoman117

@rbray89 so is there anything we can do Kopernicus-side to make things easier for you?

NathanKell avatar Jul 09 '15 01:07 NathanKell

Just uploaded a new version that should address the ;loading order concerns.

rbray89 avatar Jul 09 '15 02:07 rbray89

Awesome! What about the terrain and scaled space shaders? Does that also work now, or if not should we change them any on our end?

NathanKell avatar Jul 09 '15 02:07 NathanKell

I think that the change should address both...

rbray89 avatar Jul 09 '15 04:07 rbray89

Awesome!

NathanKell avatar Jul 09 '15 07:07 NathanKell

Thankyou!

Pingopete avatar Jul 09 '15 19:07 Pingopete

Looks like I'm still going to have to get the scaled transform another way though. Do you know of a quick way to get it from the CB?

rbray89 avatar Jul 09 '15 20:07 rbray89

@rbray89 does cb.scaledBody not work?

NathanKell avatar Jul 09 '15 20:07 NathanKell

Ah, I never noticed that before! I'll give it a shot :)

rbray89 avatar Jul 09 '15 20:07 rbray89