Jump to content

[WIP] Kopernicus Expansion v0.2: comets, footprints, new PQSMods for Kopernicus


MrHappyFace

Recommended Posts

At the moment, I have no plans to implement my own volumetric cloud system. I don't really see the point of remaking something that's already been made.

I am, however, going to be making particle based winds, if that interests you. :wink:

Very cool!

Link to comment
Share on other sites

Is it possible to make a procedural sun that has prominences and flares and a bubbly hydrogen looking surface.

For the "bubbly hydrogen looking surface," Do you mean something similar to the procedural gas giants, except for stars?

As for flares, I don't plan on implementing custom lens flares until 1.1 anyways, because 1.1 uses Unity 5, and Unity 5 allows the exporting of AssetBundles in the free version, and people could just make their lens flares in unity and export them in a .assetbundle file.

Not sure about solar prominences. It seems like they'd be difficult to implement, especially considering that they would just be eye candy.

Link to comment
Share on other sites

For the "bubbly hydrogen looking surface," Do you mean something similar to the procedural gas giants, except for stars?

As for flares, I don't plan on implementing custom lens flares until 1.1 anyways, because 1.1 uses Unity 5, and Unity 5 allows the exporting of AssetBundles in the free version, and people could just make their lens flares in unity and export them in a .assetbundle file.

Not sure about solar prominences. It seems like they'd be difficult to implement, especially considering that they would just be eye candy.

Yes i do mean like gas giants only with stars :)

And as for flares... I dont mean lens flares i mean solar flares.

Link to comment
Share on other sites

The Squig already has an animation. It would be stupid to not have animations anyways. :P

Here comes Arthur C Clarke with his Jupiter Gasbags!

Can't wait to hear thin scream of hydrogen wind :P

One suggestion: Persistent terrain scatters with collision. Use pseudorandom generator with seed saved in persistent file to get their positions - similar to map seed in games like Minecraft and Age of Empires, where same seed would give you same map all the time. You can even spawn some large rocks with that, to get DUna to look like Mars in the Martian.

Edited by sashan
Link to comment
Share on other sites

I dont mean lens flares i mean solar flares.

According to wikipedia, solar flares are just large bursts of energy from the sun's surface, and they usually result in solar prominences, which I already said aren't that big of a priority at the moment.

One suggestion: Persistent terrain scatters with collision.

Besides the collision, that's already a stock feature. Stock ground scatter is persistent, and Kopernicus itself adds collision.

Link to comment
Share on other sites

So I spent most of the last few days on a new feature, which I'm very happy about: Modular Noise

It adds a new PQS Mod to the game that allows you to mix noises together in virtually unlimited ways, by exposing almost all of LibNoise's (KSP's noise library) API to config files.

I'm sure KillAshley is going to love this...

I put together a tutorial for it here:

First, an example config:


PQS
{
Mods
{
ModularNoise
{
enabled = true
order = 10

deformity = 10000

finalNoise = PerlinNoise1
Noises
{
NOISE
{
name = PerlinNoise1
type = Perlin
frequency = 8
lacunarity = 2
persistence = 0.5
octaves = 5
seed = 123456
}
}
Operators
{
MULT
{
order = 0
applyTo = PerlinNoise1
X = 0.2
}
}
}
}
}

Let's go over each component of this config:

The first 2 lines are lines included in every PQS mod, whether it's enabled, and what position, or order, it is in the PQSMod list.

Next, there's the deformity property. It's the same as the deformity property in other PQSMods, It just determines the maximum height that this PQSMod's terrain will reach; in this case, 10 kilometers.

Now something interesting: the finalNoise property. It says which NOISE node is used to calculate the final value, which is then multiplied by deformity, and applied to the terrain.

Next, there's a Noise node, which can contain and arbitrary number ( ≥ 1 ) of NOISE nodes. This is basically a list of all the NOISE objects you can use. I'll explain it more later.

NOISE nodes describe NOISE objects. This config only has 1 NOISE object, which is named PerlinNoise1. You probably noticed that PerlinNoise1 is also what the finalNoise property is equal to. That means that the terrain is deformed based on whatever value is taken from PerlinNoise1.

Inside the NOISE node, there is a type and a name property, and some others.

The most important property is the type. There are 6 types of noise supported at the moment:

  1. Perlin noise
  2. Billow noise
  3. RidgedMultiFractal noise
  4. Voronoi noise
  5. Const noise
  6. ExDistPerlin noise

IMPORTANT NOTE: NOISE objects always return a value between 0 and 1, before operators are applied.

Noise Types

Perlin:

Perlin noise is just simple perlin noise. It looks like this:

http://i.imgur.com/jy6vGtV.png

It has 5 properties:

  1. seed: an integer between 0 and 2,147,483,647. The same seed will always output the same results.
  2. octaves: an integer between 1 and 30, determines how much detail is generated. The greater the number, the slower the terrain will generate, and the laggier your planet will be. Try to keep it below 8, but a value of 4 or 5 will suffice for most purposes.
  3. frequency: a number greater than 0 which determines how close together features are generated.
  4. lacunarity: a number greater than 0 which determines how much smaller features in one octave will be than the previous octave. The default value is 2
  5. persistence: a number between 0 and 1 which determines how large features in octaves will be compared to the previous octave. The default value is 0.5

These 5 properties are also used in Billow, RidgedMultiFractal, and ExDistPerlin noise types.

Billow:

Billow noise is just perlin noise with an absolute value function called on it. It looks like this:

http://i.imgur.com/T33rRzo.png

It has the exact same properties as Perlin noise.

RidgedMultiFractal:

RidgedMultiFractal noise (sometimes spelled RiggedMultiFractal) is a noise type that is very good for mountains. It looks like this:

http://i.imgur.com/gd7iBSI.png

It has the same properties as Perlin noise, except you don't need to set the persistence value.

Const:

Const noise isn't actually noise, it's just a constant value. It looks like this:

http://i.imgur.com/6hYoHsN.png

It has 1 property:

  • constantValue: whatever the constant value is. It can be any real number between -10304 and 1030. It's recommended you stay between -1 and 1

Voronoi:

Voronoi noise is very intersting. It's used to generate the Mun's procedural craters, among other things.

It can have 2 distinct looks, depending on how you configure it:

This:

http://i.imgur.com/4sUeJJ2.png

And this:

http://i.imgur.com/2917ZH9.png

It has 4 properties:

  • seed: an integer between 0 and 2,147,483,647. The same seed will always output the same results.
  • frequency: a number greater than 0 that determines how large the cells are. Similar to the frequency property in Perlin noise
  • displacement: a number between 0 and 1. determines how much cells are offset.
  • voronoiUseDistance: a true/false value that determines which one of those looks the noise will have. True will use the second one, and False will use the first one.

Keep in mind that if you don't have voronoiUseDistance set to true, there will be sudden changes in terrain height, which can result in really ugly cliffs.

ExDistPerlin:

ExDistPerlin (short for Exponentially Distributed Perlin) is a derivative of Perlin noise, created by a professor at UNT, which is exactly the same as Perlin noise, except for the fact that instead of having linearly distributed gradients, it has exponentially distributed gradients. This means that terrain features will be less evenly spaced, and will more closely model real life terrain. I highly suggest you look at the linked page, because the images explain it better than me.

image coming soon...

It has the same properties as Perlin noise, but with one extra property: mu

The mu property determines how the terrain features are distributed. A higher mu value means that there will be more flatter terrain, and less mountainous terrain. The default value is 1.0146, and a value of 1 is the same as regular perlin noise.

Operators

After the list of NOISEs, there is another list, called Operators, that contains all of the operators used. An operator is a basic function that can be applied to a NOISE object, such as MULT (multiplies it by X) or CLAMP (clamps the noise value between two values).

Every operator has at lease 2 properties:

  1. order: the order in the list this operator is in
  2. applyTo: the name of the NOISE object this operator affects. Operators can only affect this NOISE object, even if it uses 2 or more NOISE's.

In the example config, there is one operator, a MULT operator, which is in order 0 (is executes first) and it applies to PerlinNoise1.

There are currently 15 operators supported:

  1. ADD
  2. MULT
  3. MIN
  4. MAX
  5. EXPONENT
  6. ABS
  7. CLAMP
  8. CURVE
  9. DEFORMITYCURVE
  10. LATITUDECURVE
  11. LONGITUDECURVE
  12. SCALE
  13. TURBULENCE
  14. BLEND
  15. SELECT

I find that all of this is best explained with a flowchart:

This flowchart depitcts the config below


PQS
{
Mods
{
ModularNoise
{
enabled = true
order = 10

deformity = 8000

finalNoise = Blender
Noises
{
NOISE
{
name = PerlinNoise1
type = Perlin
frequency = 8
lacunarity = 2
persistence = 0.5
octaves = 5
seed = 123456
}
NOISE
{
name = RidgedMultiFractal1
type = RidgedMultiFractal
frequency = 3
lacunarity = 1.6
octaves = 6
seed = 654321
}
NOISE
{
name = Blender
type = Const
constantValue = 0.4
}
}
Operators
{
ADD
{
order = 1
applyTo = PerlinNoise1
X = 0.2
}
ADD
{
order = 1
applyTo = RidgedMultiFractal1
X = 0.6
}
BLEND
{
order = 2
applyTo = Blender
firstNoise = PerlinNoise1
secondNoise = RidgedMultiFractal1
}
}
}
}
}

http://i.imgur.com/5jSIZkC.png

In the flowchart, rounded rectangles are NOISE objects and ovals are operators.

ADD:

The ADD operator is a simple operator that adds a value to a noise. It can also add one NOISE's value to it's own value.

It has 2 properties:

  • applyFrom: the name of a noise to add to applyTo's value. It will also normalize the two values, meaning that if applyTo and applyFrom are equal to 1, then they will still be 1, because they were normalized.
  • X: If applyFrom is not set, then X is added to applyTo's value instead of applyFrom. It is a number that can have decimals.

NOTE: You can do subtraction by using a negative X value in this operator, or by using a MULT operator on applyFrom's NOISE object, with an X value of -1.

MULT:

The MULT operator is a simple operator that multiplies a value to a noise. It can also multiply it's own value by another NOISE's value.

It has 2 properties:

  • applyFrom: the name of a noise to multiply with applyTo's value.
  • X: If applyFrom is not set, then X is added to applyTo's value instead of applyFrom. It is a number that can have decimals.

MIN:

The MIN operator is an operator that selects the minimum of 2 NOISE object's values.

It has 1 property:

  • applyFrom: the name of the second NOISE object. Keep in mind that this will only affect applyTo's value, and not applyFrom's

MAX:

The MAX operator is an operator that selects the maximum of 2 NOISE object's values.

It has 1 property:

  • applyFrom: the name of the second NOISE object. Keep in mind that this will only affect applyTo's value, and not applyFrom's

NOTE: If you want to set a minimum or maximum hard value for a NOISE object, use CLAMP.

EXPONENT:

The EXPONENT operator is an operator that sets applyTo's value to the power of either X, or applyFrom's value

It has 1 property:

  • applyFrom: the name of the second NOISE object. Keep in mind that this will only affect applyTo's value, and not applyFrom's
  • X: the hard value that will be used if applyFrom is not set.

ABS:

The ABS operator is an operator that puts applyTo's value though an Absolute Value function.

This operator has no extra properties.

CLAMP:

The CLAMP operator is an operator that clamps applyTo's value between a minimum and a maximum.

It has 2 properties:

  • min: the minimum value
  • max: the maximum value

NOTE: Keep in mind that the minimum should be less than the maximum, or else things will break. :P

CURVE:

The CURVE operator is an operator that puts applyTo's value though a curve. The curve should be in the shape of whatever prominent terrain feature you need. If your curve looks like the image below, then your terrain will have plateaus.

https://bobsullivan.net/wp-content/uploads/2014/04/slope.png

It has 1 property:

  • Curve: the curve that this noises's output will be put though

DEFORMITYCURVE:

The DEFORMITYCURVE operator is an operator that allows you to modify the deformity based on the preexisting height of the terrain. This way, you could make a noise that only gets applied in high areas.

It has 1 property:

  • DeformityCurve: the curve that this noises's output will be put though

LATITUDECURVE:

The LATITUDECURVE operator is an operator that puts applyTo's value though a curve, based on it's latitude. This allows you to have the poles of the planet (or some other arbitrary latitude range) not affected by this noise at all.

It has 2 properties:

  • LatitudeCurve: the curve that this noises's output will be put though, based on the latitude

LONGITUDECURVE:

The LONGITUDECURVE operator is an operator that puts applyTo's value though a curve, based on it's longitude. This allows you to have a range of longitudes on the planet (or some other arbitrary latitude range) not affected by this noise at all.

It has 2 properties:

  • LongitudeCurve: the curve that this noises's output will be put though, based on the longitude

SCALE:

The SCALE operator is an operator that pertubes applyTo's value so that you can

It has 3 properties:

  • XScale: the scale along the X axis.
  • YScale: the scale along the Y axis. Larger values will squish the planet's terrain pole to pole, and smaller values will stretch it.
  • ZScale: the scale along the Z axis.

NOTE: this does not actually stretch or squish the planet itself, just the terrain's shape. It's not a replacement for VertexHeightOblate.

TURBULENCE:

The TURBULENCE operator is an operator that randomly pertubes applyTo's value.

It has 6 properties:

  • seed: the same as a NOISE object's seed
  • frequency: the frequency of the pertubations. smaller values will result in larger scale pertubations.
  • lacunarity: the same as Perlin noise's lacunarity value. the default is 1.5
  • persistence: the same as Perlin noise's persistence value. the default is 0.5
  • roughness: an integer between 1 and 30. a good value is 3 or 4. similar to Perlin noise's octaves value.
  • power: a number greater than or equal to 0 that determines how powerful the pertubations are. A good value should be between 0 and 0.5. anything more, and there are diminishing returns. 0 means that the pertubations don't appear.

NOTE: this is the most resource intensive operator. Use it with care.

BLEND:

The BLEND operator is an operator that blends two noises together into applyTo's value. It selects between the 2 values using applyTo's value, so if applyTo's value is 0.4, it samples the first noise at 40%, and the second noise at 60%. This is where Const type NOISE objects are most useful, because you can use them to have a constant blend between the two values.

It has 2 properties:

  • firstNoise: the name of the first NOISE object
  • secondNoise: the name of the second NOISE object

It looks like this:

http://i.imgur.com/hKaDKGj.png

In that image, the bottom noise is applyTo, and the other two are firstNoise and secondNoise.

SELECT:

The SELECT operator is an operator that blends between two noises based on applyTo's value. It selects between the 2 values using applyTo's value.

It has 5 properties:

  • firstNoise: the name of the first NOISE object
  • secondNoise: the name of the second NOISE object
  • falloff: how large the gradient between the two noises is.
  • min: the minimum value for secondNoise to be set
  • max: the maximum value for secondNoise to be set

It looks like this:

http://i.imgur.com/zWlQfSh.png

In that image, the bottom noise is applyTo, and the other two are firstNoise and secondNoise.

Images from http://www.draw.io and http://libnoise.sourceforge.net

Also, to avoid a double post...

I'm not sure what's going on there, but it looks like an issue with the texture rather than the shader. Try converting the image to a .png file. If you had a texture with solid colors like that, then you'd get that look.

Also, KopernicusExpansion does not officially support Kopernicus 0.4 yet. This is in development, so don't expect perfection. :P

For what it's worth, send me your output_log.txt folder (found in KSP/KSP_data/ folder) and I'll see what might have happened

LOL when can we expect to use this?

Link to comment
Share on other sites

Hi! I love your comet mod and I used it in my game. I have only one question: there is the possibility to rotate the dust tail like the real ones?

Cometorbit.png

I'm asking that because in this moment ion tail and dust tail are rotating togheter opposite to the sun.

Thank you for your attention, and congratulations for your mods!

Link to comment
Share on other sites

. Stock ground scatter is persistent, and Kopernicus itself adds collision.

Well, I've noticed that it changes position from one load to another. At least from one game launch to another. Here I am standing besides the tree, save&exit, load the same vessel next day, the's no tree but there are small stones all around.

What I wanted to do is to randomly place such giant rocks in certain biomes of Duna. From my experience with mapping in Crysis, which also has random vegetation placing feature, 6-10 different models of similar rocks plus random rotation and scaling makes it look good enough.

screen%20shot%202015-08-19%20at%2010.41.45%20am.png

Edited by sashan
Link to comment
Share on other sites

MrHappyFace, my mod's users have been coming to me about weird things happening to Jool. It seems to be related to KopernicusExpansion. Someone in this thread already mentioned it: http://forum.kerbalspaceprogram.com/threads/132390-WIP-Kopernicus-Expansion-v0-1-2-comets-animated-gas-giants-and-more?p=2248687&viewfull=1#post2248687. Could you perhaps take a look at this?

Link to comment
Share on other sites

Hi! I love your comet mod and I used it in my game. I have only one question: there is the possibility to rotate the dust tail like the real ones?

https://upload.wikimedia.org/wikipedia/commons/c/cb/Cometorbit.png

I'm asking that because in this moment ion tail and dust tail are rotating togheter opposite to the sun.

Thank you for your attention, and congratulations for your mods!

I was originally going to include that, but the game wouldn't cooperate. Maybe in the next update if I can fix it.

MrHappyFace, my mod's users have been coming to me about weird things happening to Jool. It seems to be related to KopernicusExpansion. Someone in this thread already mentioned it: http://forum.kerbalspaceprogram.com/threads/132390-WIP-Kopernicus-Expansion-v0-1-2-comets-animated-gas-giants-and-more?p=2248687&viewfull=1#post2248687. Could you perhaps take a look at this?

I've never seen this bug on my own computer, and until I do, I can't do anything until someone sends me logs or an actual bug report about it. I imagine it's got something to do with DirectX vs OpenGL, but I can't really test it.

Link to comment
Share on other sites

Any chance we could make some sort of normal map for a star? Maybe even a solar atmosphere? I'm thinking it would be terribly cool to see a star like Betelgeuse with massive convection bubbles rising and falling.

- - - Updated - - -

how about making nebulas? you know maybe a 3d model rendered in scaled space that transitions into particle effects at close proximity.

I think it might just be simpler to include nebulae by editing the skybox. think about how big a nebula is compared to a normal solar system. KSP just isn't made to handle any object, let alone a particle effect 50 light years in diameter.

Link to comment
Share on other sites

Any chance we could make some sort of normal map for a star? Maybe even a solar atmosphere? I'm thinking it would be terribly cool to see a star like Betelgeuse with massive convection bubbles rising and falling.

- - - Updated - - -

I think it might just be simpler to include nebulae by editing the skybox. think about how big a nebula is compared to a normal solar system. KSP just isn't made to handle any object, let alone a particle effect 50 light years in diameter.

Not all nebulas are epic in size, take planetary nebulae for example or the crab nebula.

Link to comment
Share on other sites

even a planatary nebula is pretty epic in scale, and likely too much for the KSP engine to handle in a suitably realistic way.

That said, it would be pretty cool. i just don't believe the game can really handle it.

Edited by Dunrana
Link to comment
Share on other sites

even a planatary nebula is pretty epic in scale, and likely too much for the KSP engine to handle in a suitably realistic way.

That said, it would be pretty cool. i just don't believe the game can really handle it.

You'd be surprised. I have no doubts that KSP's engine could handle things the size of planetary nebulas, maybe not stellar nebulas, but definitely planetary ones. That said, I have no plans to implement them.

Link to comment
Share on other sites

Hi! I've been struggling with trying to make comet tails in RealSolarSystem, and failed miserably. It appears that your mod can detect that I added this to my planets but doesn't render the tail.

CometTails {

Tails

{

Tail

{

type = Ion

color = 0,0.4,1,1

radius = 3750

length = 100000

}

Tail

{

type = Dust

color = 0.4,0.4,0.5,1

radius = 5000

length = 65000

}

}

}

Link to comment
Share on other sites

Hi! I've been struggling with trying to make comet tails in RealSolarSystem, and failed miserably. It appears that your mod can detect that I added this to my planets but doesn't render the tail.
CometTails {

Tails

{

Tail

{

type = Ion

color = 0,0.4,1,1

radius = 3750

length = 100000

}

Tail

{

type = Dust

color = 0.4,0.4,0.5,1

radius = 5000

length = 65000

}

}

}

I am also having problems with comet tails (using the examples) and they are not showing up with Eeloo and in the editor. The orbit modification works. Help anyone?

Link to comment
Share on other sites

I'm trying to write a patch that changes Minmus to be kind of a standin for Charon, and moves the Mun to an inclined, slightly eccentric, more distant orbit around Kerbin. My game doesn't want to load my patches though. I also want to shrink and copy Ike to imitate Phobos and Deimos. Could someone help me with those configs?

Link to comment
Share on other sites


@Kopernicus:AFTER[Kopernicus]
{
@Body[Moho]
{
@flightGlobalsIndex = 1
}
@Body[Eve]
{
@flightGlobalsIndex = 2
}
@Body[Kerbin]
{
@flightGlobalsIndex = 3
}
@Body[Mun]
{
@flightGlobalsIndex = 4
@Orbit
{
@semiMajorAxis = 38440000
@inclination = 5.16
@eccentricity = 0.0554
}
}
@Body[Duna]
{
@flightGlobalsIndex = 5
}
@Body[Ike] //Phobos
{
@flightGlobalsIndex = 6
@Properties
{
}
@Orbit
{
}
}
@Body[Minmus] //Deimos
{
@flightGlobalsIndex = 7
@Properties
{
}
@Orbit
{
}
}
@Body[Dres]
{
@flightGlobalsIndex = 8
}
@Body[Jool]
{
@flightGlobalsIndex = 9
}
@Body[Laythe]
{
}
@Body[Eeloo] //Europa
{
@flightGlobalsindex = 10
@Orbit
{
@referenceBody = Jool
}
}
@Body[Tylo]
{
@flightGlobalsIndex = 11
}
@Body[Bop]
{
@flightGlobalsIndex = 12
}
@Body[Pol]
{
@flightGlobalsIndex = 13
}
@Body[Vall] //Pluto
{
@flightGlobalsIndex = 14
@Orbit
{
@referenceBody = Sun
}
}
Body
{
name = Karus
flightGlobalsIndex = 15
Orbit
{
referenceBody = Eeloo
inclination =
eccentricity =
semiMajorAxis =
longitudeOfAscendingNode =
argumentOfPeriapsis =
meanAnomalyAtEpoch =
epoch =
color =
}
Properties
{
description =
radius =
geeASL =
ScienceValues
{
flyingLowDataValue = 14
flyingHighDataValue = 13
inSpaceLowDataValue = 12
inSpaceHighDataValue = 11
recoveryValue = 11
flyingAltitudeThreshold = 130000
spaceAltitudeThreshold = 5000000
}
}
}
}

Edited by MAFman
Remembered to fix a value
Link to comment
Share on other sites

I'm trying to write a patch that changes Minmus to be kind of a standin for Charon, and moves the Mun to an inclined, slightly eccentric, more distant orbit around Kerbin. My game doesn't want to load my patches though. I also want to shrink and copy Ike to imitate Phobos and Deimos. Could someone help me with those configs?

Ask in the Kopernicus thread, this is a development thread for a different mod.

Link: http://forum.kerbalspaceprogram.com/threads/114649-1-0-4-Kopernicus-Beta

Link to comment
Share on other sites

Hey Happy face is there a guide on how to write custom PQS mods?

I can't find Microsoft Visual C++ in my win10 computer even trough I installed it a second time. BTW if I would find it, I could theoreticaly study existent PQS code to create aother one... I just need to make a PQS mod that smooths terrain. Like smooth terrain created with PQSMod_VertexHeightNoise riggedMultifractal mod.

Edited by amarius1
Link to comment
Share on other sites

Ohhhkay. It seems that you don't have any clue how to write Plugins in KSP. That is a good starting point: http://wiki.kerbalspaceprogram.com/wiki/Plugins

KSP Plugins are written in .NET (mostly C#, but any .NET language will work). You can't look at the source of the PQSMods, because they are compiled into the .dll and the EULA forbids decompiling theese .dlls to look at the source.

Basically, you need to create a new class that derives from PQSMod and override OnVertexBuildHeight and OnVertexBuild. In theese methods you can manipulate the height and color of the PQS.

If you have more questions, send me a PM.

(Sorry for the Offtopic @MrHappyFace ;))

Thank you a lot...

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...