Ger_space

[1.2.X] Kerbal Konstructs - 0.9.8.9 - 12.12.2016

226 posts in this topic

13 minutes ago, whale_2 said:

This behavior is implemented in 'Hangar' mod - 

- its code can provide clues on how to do this.

Thank you, it looks like I need to update the hangar models for this feature to work.

2 people like this

Share this post


Link to post
Share on other sites
6 hours ago, Ger_space said:

Thank you, it looks like I need to update the hangar models for this feature to work.

I have high hopes, lets make the game immersive!

35FkxxI.png

Share this post


Link to post
Share on other sites

Hold up, so if I'm reading this correctly. This mod can help me build bases on other planets, and launch my stuff from there?

Plus, it's up to date for 1.2.1!? Why have I not heard of this mod before?

Share this post


Link to post
Share on other sites
6 minutes ago, IraqiWalker said:

Hold up, so if I'm reading this correctly. This mod can help me build bases on other planets, and launch my stuff from there?

Plus, it's up to date for 1.2.1!? Why have I not heard of this mod before?

I have no idea, why you never saw this mod, but yes you can build bases anywhere you want. (fly a ship to the place and press crtl+k)
I
f you don't want to model the bases yourself (with 3ds or unity), you could try the kerbin-side core package for a set of assets, or use the assets from any other installed KK-mod.

I strongly suggest to use the latest pre-release on from github, If you really want to create your own bases, because the last official release contains a bug in the editor.

1 person likes this

Share this post


Link to post
Share on other sites
1 minute ago, Ger_space said:

I have no idea, why you never saw this mod, but yes you can build bases anywhere you want. (fly a ship to the place and press crtl+k)
I
f you don't want to model the bases yourself (with 3ds or unity), you could try the kerbin-side core package for a set of assets, or use the assets from any other installed KK-mod.

I strongly suggest to use the latest pre-release on from github, If you really want to create your own bases, because the last official release contains a bug in the editor.

I'll have to look into this family of mods, to get the bases, since my 3DS skills are almost zero.

Now, you mentioned the bug in the editor, would that have an impact on me if I DON'T want to model my own structures/assets?

 

Share this post


Link to post
Share on other sites
20 minutes ago, IraqiWalker said:

I'll have to look into this family of mods, to get the bases, since my 3DS skills are almost zero.

Now, you mentioned the bug in the editor, would that have an impact on me if I DON'T want to model my own structures/assets?

 

the ingame editor is only for the placement and configuration of the models(like giving a launchSite a name etc). and this is fixed in the pre-release. It's also got easier to use.

Creating new models is done outside of KSP.

A new official release should be done this weekend or early next week. I need some more time for testing and cleanup the mess I created the last few days. :confused:

1 person likes this

Share this post


Link to post
Share on other sites
1 minute ago, Ger_space said:

the ingame editor is only for the placement and configuration of the models(like giving a launchSite a name etc). and this is fixed in the pre-release. It's also got easier to use.

Creating new models is done outside of KSP.

A new official release should be done this weekend or early next week. I need some more time for testing and cleanup the mess I created the last few days. :confused:

Take your time, I'll be here, waiting, and planning my system wide expansion, XD.

Share this post


Link to post
Share on other sites

@Ger_space

I've had some time to test KK with SD and konstructs are not even touched by my mod.

I would assume this is because either the PQSCity mods created by KK are not added to  CelestialBody.pqsSurfaceObjects or they are added after my mod goes through that list to edit all the mods.

I have yet to look into KK code, if you have any pointers that might save me some time I'd be grateful :)

Edited by Sigma88

Share this post


Link to post
Share on other sites

I cannot get KK to work together with RSS. I have the icon but pressing ctrl-k does nothing. 

At first when examining the log file it said :

[ERR 18:05:05.703] KK: Couldn't find body "Kerbin"

and:

Spoiler

[EXC 18:05:05.705] NullReferenceException: Object reference not set to an instance of an object
    KerbalKonstructs.Core.StaticDatabase.addStatic (KerbalKonstructs.Core.StaticObject obj)
    KerbalKonstructs.KerbalKonstructs.loadInstances (.ConfigNode confconfig, KerbalKonstructs.Core.StaticModel model, Boolean bSecondPass)
    KerbalKonstructs.KerbalKonstructs.LoadModelInstances ()
    KerbalKonstructs.KerbalKonstructs.Awake ()
    UnityEngine.GameObject:AddComponent(Type)
    AddonLoader:StartAddon(LoadedAssembly, Type, KSPAddon, Startup)
    AddonLoader:StartAddons(Startup)
    AddonLoader:OnLevelLoaded(Int32)
    AddonLoader:OnSceneLoaded(Scene, LoadSceneMode)
    UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)
[LOG 18:05:05.705] 

So edited all the .cfg files that said CelestialBody = Kerbin to be = Earth. That worked and the log-file didn't display the error anymore. Pressing ctrl-k however still does nothing. Anyone have any solutions for making KK and RSS work together?

Share this post


Link to post
Share on other sites
1 hour ago, Sigma88 said:

@Ger_space

I've had some time to test KK with SD and konstructs are not even touched by my mod.

I would assume this is because either the PQSCity mods created by KK are not added to  CelestialBody.pqsSurfaceObjects or they are added after my mod goes through that list to edit all the mods.

I have yet to look into KK code, if you have any pointers that might save me some time I'd be grateful :)

CelestialBody.pqsSurfaceObjects

there is such a thing? Cool :cool:

But, KK does't add itself to the array, yet... I expected that this is done automaticly, but it looks like I have to do this on my own. I'll post a updated prerelease later tonight, where I try to fill the qpsSurfaceObjects array.

 

1 person likes this

Share this post


Link to post
Share on other sites

Hey, can I use this with the stock KSC assets, or are those locked away?

This doesn't seem to have been mentioned in this thread, but every other post saying "you need KerbinSide" or something similar makes me think I already know the answer to that :P

Is it a matter of not knowing how to locate the stock assets, or is it that they really can't be used?

Edited by monstah

Share this post


Link to post
Share on other sites

@SuperSimon

Ther is no RSS for 1.2.X, so I cannot support it in the moment. If you recompiled KK from the sources, then please open an issue on github and upload the logfiles, as I have no 1.1.3 install (at least not now).

 

@monstah

the stock assets are not usable by KK. At least not now. @Sigma88 showed me where I might find them, but currently I cannot access them to place copies of them or worse: edit them... It might be cool, but currently I have some other prioities, but I add a note to look into it.

1 person likes this

Share this post


Link to post
Share on other sites
1 minute ago, Ger_space said:

Ther is no RSS for 1.2.X, so I cannot support it in the moment. If you recompiled KK from the sources, then please open an issue on github and upload the logfiles, as I have no 1.1.3 install (at least not now

I see yes. I found a dll for RSS compiled to work in 1.2.X someone posted in a thread, so thats how I got it to work. I guess I will have to wait for a proper RSS 1.2.x release then. Thanks anyway. 

Share this post


Link to post
Share on other sites
1 hour ago, Ger_space said:

CelestialBody.pqsSurfaceObjects

there is such a thing? Cool :cool:

But, KK does't add itself to the array, yet... I expected that this is done automaticly, but it looks like I have to do this on my own. I'll post a updated prerelease later tonight, where I try to fill the qpsSurfaceObjects array.

 

don't worry, I thought PQSmods were added to that list automatically, since they aren't I might as well just fish them out of the Celestialbody itself, that way I will be sure to get all of them, regardless of which mod adds them.

Edited by Sigma88

Share this post


Link to post
Share on other sites

I changed the loader a bit, so I think they get added... I'll run a few quick tests and report back. that were only 5 lines of code on my side. You will need much more to find them otherwise.

Share this post


Link to post
Share on other sites
11 minutes ago, Ger_space said:

I changed the loader a bit, so I think they get added... I'll run a few quick tests and report back. that were only 5 lines of code on my side. You will need much more to find them otherwise.

Actually it's a 1 line change for me :)

Instead of using foreach on body.surfaceobjects I use it on body.GetComponents<PQSMod>

Share this post


Link to post
Share on other sites
3 minutes ago, Sigma88 said:

Actually it's a 1 line change for me :)

Instead of using foreach on body.surfaceobjects I use it on body.GetComponents<PQSMod>

Does is work with your change? It looks I succefully filled the body.surfaceobjects array with some usable data. If nothing speaks agains it, I'll leave it included in the next release.

Share this post


Link to post
Share on other sites

@Sigma88

OK, that was not really expected: when I add KK statics to the body.surfaceobjects, they show up as anomalies in the scanners. (which is good to know, but nothing I really want for all objects I place).
But I now can add real hidden bases to the world, which only show only up in the scanner (or after they are open)

Edited by Ger_space

Share this post


Link to post
Share on other sites
1 hour ago, Ger_space said:

@Sigma88

OK, that was not really expected: when I add KK statics to the body.surfaceobjects, they show up as anomalies in the scanners. (which is good to know, but nothing I really want for all objects I place).
But I now can add real hidden bases to the world, which only show only up in the scanner (or after they are open)

cool, feel free to use that feature as you prefere. I decided I will keep getting my PQSmods the other way so that you don't have to worry about it.

PS: seems legit

Screenshot%202016-12-02%2020.02.34.png?d

3 people like this

Share this post


Link to post
Share on other sites
4 minutes ago, Sigma88 said:

cool, feel free to use that feature as you prefere. I decided I will keep getting my PQSmods the other way so that you don't have to worry about it.

PS: seems legit

Screenshot%202016-12-02%2020.02.34.png?d

This looks cool and disturbing at the same time. I'm glad you figured it out.

1 person likes this

Share this post


Link to post
Share on other sites
5 minutes ago, Ger_space said:

This looks cool and disturbing at the same time. I'm glad you figured it out.

the weird thing is, doing that KSC gets called 2 times so, while everything is scaled 1/10 ksc is scaled 1/100 :D

I had to put a check to avoid just that

Share this post


Link to post
Share on other sites

ok, I managed to fix the basics of KK compatibility :)

@Ger_space I'll put here some thoughts about rescaling that came up while me and @AlphaAsh where discussing SD and KK compatibility way back when...

since it'll probably end up a wall of text I'll put everything into a spoiler so that I don't annoy people

Spoiler

so, when rescaling a planet there are a lot of things to keep in mind that can mess up KK.

first of all, the only real way to get a good result is to scale the buildings by the same factor you scale the planet.

of course this solution is not always the most enjoyable even if it is the most accurate, this is why other options might be considered.

 

when rescaling planets but not buildings, there are 2 main issues to solve:

1- Altitude

2- Latitude-Longitude

 

when rescaling a planet, the altitude of every surface point is multiplied by the "resize" parameter. so if a hill is 100 meters in stock Kerbin, it will become 1000 meters in 10x Kerbin.

This means that I just need to multiply the repositionRadiusOffset by 10 right? wrong!

most PQSCity in stock (and also in KK) are set up to load with a certain offset compared to the center of the planet or to the sea level.

the problem is that this kind of offset actually includes 2 different informations:

A- the offset required to move the model of the building to the surface
B- the offset required to make sure the model is intersecting the terrain at the correct altitude

this picture should help explain my issue:

KSC%20offset.png?dl=1

Here you can see a random building, which has a part that goes over the ground (black) and a part that goes under the ground (grey).

to position the building at the correct height KK and KSP use an offset (pink) relative to the sea level (blue)

What I need to know to calculate the correct position of the building is the two distances on the left (A and B)

This could be solved in a couple of different ways:

1- use repositionToSphereSurface = true

this would make the building spawn directly on the surface (arrow A) and so in the offset you can just put the offset necessary to hide underground parts (arrow B). All buildings positioned this way will always work fine with SD, but also they will always work with planet packs that change the shape of the planet.

 

2- store somewhere the value of "arrow B"

which would allow SD to read it and scale the building accordingly

honestly, this is the less efficient solution, the only reason I mention this is because there are a lot of KK packs out there and maybe some have a restrictive license that doesn't allow redistribution, this solution would allow to bring up-to-date with SD some of those abandoned KK packs with such restrictive licenses

 

Latitude and Longitude are also a problem when rescaling the planet but not the buildings:

lat_long_issue.png?dl=1

Here you can see a planet with buildings before and after being rescaled.

since latitude and longitude ramain constant, it means that the distance between the buildings will increase when making a planet bigger, and decrease when making a planet smaller.

this will lead to buildings "crunched" together, or spread on a wider area than they are supposed to.

This could be avoided by:

1- Put all the buildings inside the same "PQSCity" Mod

I have no idea if this would be possible

2- Save somewhere the "position" vector of the "center" of the buildings group.

for example, if every additional building of KSC2 (from kerbinside) had stored in their cfg the position vector of the building and the position vector of KSC (as a reference) I would be able to calculate the new lat-long necessary to maintain the correct distance between buildings.

@AlphaAsh told me he was working on something similar before his hiatus from ksp modding, so I don't know if this feature actually made it into the mods or not.

as expected, big wall of text there (those ms paint skillz tho)

anyways, @Ger_space I'm not writing this because I expect you to do anything about it, I'm just putting it out there in case you are interested in increasing the potential of KK.

in time, I will add to SD all the tools necessary to do a proper rescale of buildings.

like a loader for the offsets and a loader for the position references, since this is the main PQSMod adding mod I will gladly keep in touch with you during development to find solutions that are best for both of us.

But I have no interest in bothering you, so if this is not something you want to go into it's perfectly fine :wink:

cheers

Edited by Sigma88
1 person likes this

Share this post


Link to post
Share on other sites
1 hour ago, Sigma88 said:

ok, I managed to fix the basics of KK compatibility :)

@Ger_space I'll put here some thoughts about rescaling that came up while me and @AlphaAsh where discussing SD and KK compatibility way back when...

since it'll probably end up a wall of text I'll put everything into a spoiler so that I don't annoy people

  Reveal hidden contents

so, when rescaling a planet there are a lot of things to keep in mind that can mess up KK.

first of all, the only real way to get a good result is to scale the buildings by the same factor you scale the planet.

of course this solution is not always the most enjoyable even if it is the most accurate, this is why other options might be considered.

 

when rescaling planets but not buildings, there are 2 main issues to solve:

1- Altitude

2- Latitude-Longitude

 

when rescaling a planet, the altitude of every surface point is multiplied by the "resize" parameter. so if a hill is 100 meters in stock Kerbin, it will become 1000 meters in 10x Kerbin.

This means that I just need to multiply the repositionRadiusOffset by 10 right? wrong!

most PQSCity in stock (and also in KK) are set up to load with a certain offset compared to the center of the planet or to the sea level.

the problem is that this kind of offset actually includes 2 different informations:

A- the offset required to move the model of the building to the surface
B- the offset required to make sure the model is intersecting the terrain at the correct altitude

this picture should help explain my issue:

KSC%20offset.png?dl=1

Here you can see a random building, which has a part that goes over the ground (black) and a part that goes under the ground (grey).

to position the building at the correct height KK and KSP use an offset (pink) relative to the sea level (blue)

What I need to know to calculate the correct position of the building is the two distances on the left (A and B)

This could be solved in a couple of different ways:

1- use repositionToSphereSurface = true

this would make the building spawn directly on the surface (arrow A) and so in the offset you can just put the offset necessary to hide underground parts (arrow B). All buildings positioned this way will always work fine with SD, but also they will always work with planet packs that change the shape of the planet.

 

2- store somewhere the value of "arrow B"

which would allow SD to read it and scale the building accordingly

honestly, this is the less efficient solution, the only reason I mention this is because there are a lot of KK packs out there and maybe some have a restrictive license that doesn't allow redistribution, this solution would allow to bring up-to-date with SD some of those abandoned KK packs with such restrictive licenses

 

Latitude and Longitude are also a problem when rescaling the planet but not the buildings:

lat_long_issue.png?dl=1

Here you can see a planet with buildings before and after being rescaled.

since latitude and longitude ramain constant, it means that the distance between the buildings will increase when making a planet bigger, and decrease when making a planet smaller.

this will lead to buildings "crunched" together, or spread on a wider area than they are supposed to.

This could be avoided by:

1- Put all the buildings inside the same "PQSCity" Mod

I have no idea if this would be possible

2- Save somewhere the "position" vector of the "center" of the buildings group.

for example, if every additional building of KSC2 (from kerbinside) had stored in their cfg the position vector of the building and the position vector of KSC (as a reference) I would be able to calculate the new lat-long necessary to maintain the correct distance between buildings.

@AlphaAsh told me he was working on something similar before his hiatus from ksp modding, so I don't know if this feature actually made it into the mods or not.

 

OK, I see the problems, wich arise with scaling. But here goes a new one: If I reposition the objects to new coordinates, so thier spaceing is OK, then they end up not where they belong. A waterlaunch system could end up in the desert, or a runway partial in a mountain.

reposition on surface = true will break all current mods, which is be very very bad.

If you only need the offset vector B):

it is (terrainhigh - pqsCity.repositionRadiusOffset)

unscaled terrainhight = (CelestialBody.pqsController.GetSurfaceHeight(pqsCity.repositionRadial) - CelestialBody.Radius)/TerrainScaleFactor

from there you can rescale the models as you need. (I don't have the rescale factor within KK, so I cannot convert legacy mods on the fly).

Edited by Ger_space

Share this post


Link to post
Share on other sites
26 minutes ago, Ger_space said:

OK, I see the problems, wich arise with scaling. But here goes a new one: If I reposition the objects to new coordinates, so thier spaceing is OK, then they end up not where they belong. A waterlaunch system could end up in the desert, or a runway partial in a mountain.

reposition on surface = true will break all current mods, which is be very very bad.

If you only need the offset vector B):

it is (terrainhigh - pqsCity.repositionRadiusOffset)


unscaled terrainhight = (CelestialBody.pqsController.GetSurfaceHeight(pqsCity.repositionRadial) - CelestialBody.Radius)/TerrainScaleFactor

from there you can rescale the models as you need.

oh there is a way to get surfaceheight?????? LOL I didn't know that. nevermind then (thank you)

 

and yes, if you change LONG-LAT on a non flat area the buildings may end up in weird places, but:

 

1- that's not something YOU do, that's something SD does. so it's not decreasing the quality of KK, at most it's decreasing the quality of SD, but that brings me to 

2- the problem itself arises from the fact that if you scale up kerbin you probably don't want to also scale up buildings. if that's the case you end up with this:

(KSC2 from KerbinSide on stock Kerbin compared with 10xKerbin)

Screenshot%202016-12-03%2022.44.24.png?d Screenshot%202016-12-03%2022.41.35.png?d

so clearly here it looks bad, either the user accepts the fact that he/she needs to have big-ass buildings or accepts the fact that the buildings will be spaced out seemingly with no reason.

I'm not saying you should do anything about it, but if there is a way that would allow me to know which buildings are supposed to go "together" I might give the option to choose between the standard resize which spaces out buildings and the alternative version which maintains the distance between buildings at the cost of some altitude issues if the terrain is not flat enough

 

EDIT:

btw, we can move the discussion on SD thread if you don't want to clutter this thread

Edited by Sigma88
1 person likes this

Share this post


Link to post
Share on other sites

Just downloaded @Beale's South West Launch site in the newest version of Kerbal Konstructs. The launch site is in the middle of the sea, and off to the west of where I believe it should be. What do I need to do to move it back onto land?

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now