Jump to content

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


MrHappyFace

Recommended Posts

Just uploaded the next version, KopernicusExpansion 0.2.0! (Compatible with Kopernicus 0.6.3)

Sorry it's taken almost 6 months, it's long overdue. :P

Changelog:

  • Added ModularNoise
  • Improved ScaledVersion exporter
  • Improved texture viewer
  • Added Footprints
  • Made comet tails fully configurable
  • Added DebugHeightColor
  • Started creatures
  • Added creature development tools

I'll be updating the OP with documentation and screenshots later.

Keep in mind that this is still an incomplete mod, and you may experience bugs, but hopefully there won't be too many.

I'll be updating the CKAN metadata too.

 

I'd also like to talk about the next version of this mod, and what I hope to include.

I mentioned a while ago that for various reasons, the caves and subsurface oceans wouldn't be included in version 0.2.0. That's because when you try to cheat a flat, height-based terrain system into being volumetric, you run into issues. I did some research, and came to the conclusion that full-blown voxel terrain would be the only efficient way to do it. I've since been thinking about how this will work, and done some tests in unity and KSP, and I'm reasonably certain that it's possible. The voxel terrain engine will be the only major feature in version 0.3.0, except for the particle grass, which I found would need unity 5.

Wish me luck! :)

Link to comment
Share on other sites

2 hours ago, MrHappyFace said:

Just uploaded the next version, KopernicusExpansion 0.2.0! (Compatible with Kopernicus 0.6.3)

Sorry it's taken almost 6 months, it's long overdue. :P

Changelog:

  • Added ModularNoise
  • Improved ScaledVersion exporter
  • Improved texture viewer
  • Added Footprints
  • Made comet tails fully configurable
  • Added DebugHeightColor
  • Started creatures
  • Added creature development tools

I'll be updating the OP with documentation and screenshots later.

Keep in mind that this is still an incomplete mod, and you may experience bugs, but hopefully there won't be too many.

I'll be updating the CKAN metadata too.

 

I'd also like to talk about the next version of this mod, and what I hope to include.

I mentioned a while ago that for various reasons, the caves and subsurface oceans wouldn't be included in version 0.2.0. That's because when you try to cheat a flat, height-based terrain system into being volumetric, you run into issues. I did some research, and came to the conclusion that full-blown voxel terrain would be the only efficient way to do it. I've since been thinking about how this will work, and done some tests in unity and KSP, and I'm reasonably certain that it's possible. The voxel terrain engine will be the only major feature in version 0.3.0, except for the particle grass, which I found would need unity 5.

Wish me luck! :)

Good luck :D Btw is it possible to load a custom 3d model into scaledspace?

Link to comment
Share on other sites

  • 2 weeks later...

Oh, that's right. I'm trying to get into someone's recreation of Kragethea's planet system, specifically the comet "Ascension."

But because I'm an idiot, I don't know how to put the Comet config in properly, so, here's the config, let me know what I'm messing up with the formatting.

Or, not, I'll try to figure it out.

Spoiler

@Kopernicus:AFTER[Kopernicus]
{
    Body
    {
        name = Ascension
        cacheFile = SentarExpansion/Ascension/Cache/Ascension.bin
        Template
        {
        name = Minmus
        removeAllPQSMods = true
        }
        Properties
        {
            description=I could just belch on this tiny little comet and vaporize your entire species. It's a sort of a threat you see...
            geeASL=0.66
            radius=14000
            rotates=True
            rotationPeriod=4040
            initialRotation=180
            tidallyLocked=False
            
            biomeMap = SentarExpansion/Ascension/Textures/Ascension_Biomes.dds
            
            Biomes
            {
                Biome
                {
                    name = Lowlands
                    color = RGBA(180, 255, 7, 1)
                    value = 0
                }
                Biome
                {
                    name = Highlands
                    color = RGBA(89, 255, 105, 1)
                    value = 0
                }
                Biome
                {
                    name = Flats
                    color = RGBA(96,165,255,1)
                    value = 0
                }
                Biome
                {
                    name = Midlands
                    color = RGBA(255, 138, 89, 1)
                    value = 0
                }
            }
            
            ScienceValues
            {
                landedDataValue = 25
                inSpaceLowDataValue = 20
                inSpaceHighDataValue = 15
                recoveryValue = 20
                spaceAltitudeThreshold = 120000
            }
        }
        ScaledVersion
        {

            Material
            {
                texture = SentarExpansion/Ascension/Textures/Ascension_map
                normals = SentarExpansion/Ascension/Textures/Ascension_normal

             }

        }

        Orbit
        {
            inclination = 19.0
            eccentricity = 0.97
            semiMajorAxis = 100000000000
            LAN = 0
            argumentOfPeriapsis = 0
            meanAnomalyAtEpoch = 0
            epoch = 2332222300
            referenceBody = Sun
        }    
        PQS
        {
            Material
            {
                contrast=2
            }
                
                Mods 
                {
                
                    HeightColorMap
                    {
                        blend =1
                        enabled=True
                        order=30
                        LandClasses
                        {
                            Class
                            {
                                name=low
                                altitudeStart=0
                                altitudeEnd=0.5
                                color=0.99, 0.99, 0.99, 1.000
                                lerpToNext = true
                            }
                            Class
                            {
                                name=mid
                                altitudeStart=0.5
                                altitudeEnd=0.6
                                color=0.0, 0.02, 0.02, 1.000
                                lerpToNext = true
                                
                            }
                            Class
                            {
                                name=high
                                altitudeStart=0.6
                                altitudeEnd=0.7
                                color=0.15, 0.150, 0.155, 1.000
                                lerpToNext = true
                                
                            }        
                            Class
                            {
                                name=snow
                                altitudeStart=0.7
                                altitudeEnd=1.0
                                color=0.99, 0.99, 0.98, 1.000
                                lerpToNext = false
                            }        
                        }
                    }
                    VertexHeightNoise
                    {
                        enabled=True
                        order=10
                        deformity=10
                        seed=45756
                        frequency=2
                        lacunarity=2.5
                        persistance=0.8
                        octaves=6
                        mode=Low
                    }

                    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

The CometTails node just goes inside the base Body node, like this:

Spoiler

@Kopernicus:AFTER[Kopernicus]
{
    Body
    {
        name = Ascension
        cacheFile = SentarExpansion/Ascension/Cache/Ascension.bin
        Template
        {
        name = Minmus
        removeAllPQSMods = true
        }
        Properties
        {
            description=I could just belch on this tiny little comet and vaporize your entire species. It's a sort of a threat you see...
            geeASL=0.66
            radius=14000
            rotates=True
            rotationPeriod=4040
            initialRotation=180
            tidallyLocked=False
            
            biomeMap = SentarExpansion/Ascension/Textures/Ascension_Biomes.dds
            
            Biomes
            {
                Biome
                {
                    name = Lowlands
                    color = RGBA(180, 255, 7, 1)
                    value = 0
                }
                Biome
                {
                    name = Highlands
                    color = RGBA(89, 255, 105, 1)
                    value = 0
                }
                Biome
                {
                    name = Flats
                    color = RGBA(96,165,255,1)
                    value = 0
                }
                Biome
                {
                    name = Midlands
                    color = RGBA(255, 138, 89, 1)
                    value = 0
                }
            }
            
            ScienceValues
            {
                landedDataValue = 25
                inSpaceLowDataValue = 20
                inSpaceHighDataValue = 15
                recoveryValue = 20
                spaceAltitudeThreshold = 120000
            }
        }
        ScaledVersion
        {

            Material
            {
                texture = SentarExpansion/Ascension/Textures/Ascension_map
                normals = SentarExpansion/Ascension/Textures/Ascension_normal

             }

        }

        Orbit
        {
            inclination = 19.0
            eccentricity = 0.97
            semiMajorAxis = 100000000000
            LAN = 0
            argumentOfPeriapsis = 0
            meanAnomalyAtEpoch = 0
            epoch = 2332222300
            referenceBody = Sun
        }

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

        PQS
        {
            Material
            {
                contrast=2
            }
                
                Mods 
                {
                
                    HeightColorMap
                    {
                        blend =1
                        enabled=True
                        order=30
                        LandClasses
                        {
                            Class
                            {
                                name=low
                                altitudeStart=0
                                altitudeEnd=0.5
                                color=0.99, 0.99, 0.99, 1.000
                                lerpToNext = true
                            }
                            Class
                            {
                                name=mid
                                altitudeStart=0.5
                                altitudeEnd=0.6
                                color=0.0, 0.02, 0.02, 1.000
                                lerpToNext = true
                                
                            }
                            Class
                            {
                                name=high
                                altitudeStart=0.6
                                altitudeEnd=0.7
                                color=0.15, 0.150, 0.155, 1.000
                                lerpToNext = true
                                
                            }        
                            Class
                            {
                                name=snow
                                altitudeStart=0.7
                                altitudeEnd=1.0
                                color=0.99, 0.99, 0.98, 1.000
                                lerpToNext = false
                            }        
                        }
                    }
                    VertexHeightNoise
                    {
                        enabled=True
                        order=10
                        deformity=10
                        seed=45756
                        frequency=2
                        lacunarity=2.5
                        persistance=0.8
                        octaves=6
                        mode=Low
                    }
                }
            }

 

 

You had it inside the Mods node.

Link to comment
Share on other sites

Oh, der, and one more stupid question, sorry.

After I put this config in, it reset the planet itself, not the scaledspace, but the actual planet. I tried fixing it, but it's been so long since I've used Planet Factory, and now it's Kopernicus, that I didn't remember how to fix it.

Sorry for being an idiot.

Link to comment
Share on other sites

  • 2 weeks later...

Development update:

I've been working on the voxel terrain, and I decided to tackle the hardest problem (so far), smooth voxel mesh generation.

I chose the naive surface nets algorithm for generating the meshes because it produces smooth meshes at really high speed, and it's relatively easy to implement. This may change in the future, since it is relatively easy to switch out the meshing algorithm for a new one if need be.
I wrote the first version of the mesher in a seperate test project in Unity 5.3, and it doesn't produce spherical terrain yet, but that's simply a matter of distorting the mesh and generation coordinates into a wedge shape, like a slice of pie, except in 3D.

RlBsk7a.jpg

I'm not entirely happy with the smoothing algorithm yet (it looks kind of like lumpy excrement), but it's a good first step.

To get the voxel terrain working with the PQS system, the plan is to take each quad, which will be refered to as a chunk, and do the following:

  1. Disable stock terrain mesh.
  2. Compute LOD for each voxel subchunk.
  3. Generate each subchunk's mesh.
  4. Add MeshCollider components to each of the subchunks.

Subchunks are the vertical subdivision of each chunk, so that the terrain at different altitudes has different LODs, and so that each mesh sent to the GPU isn't kilometers high. The separation of the meshes also helps immensely with occlusion culling, which is a huge optimization. If you had a 12km cliff-face it might be split into 48 subchunks, each one 250m high. The size of each subchunk is configurable, but they shouldn't be much larger than 1 kilometer high. The width/length of each subchunk is equal to the width/length of the parent chunk. The roundness of planets means that subchunks that are higher will be slightly wider than subchunks that are lower.

I made a crudely drawn diagram to help, although this diagram assumes that the terrain is flat, and it definitely not to scale:

aBfoKqL.jpg

The generation of the meshes may be done on a different thread, because it's just numbers and can be done without interaction with Unity, and it is probably going to be the largest CPU-sink. This means that there wouldn't be frame-dropping when the terrain loads, which is actually better than the stock terrain, although when a landed ship is loaded, the chunks within the physics load range will have to be generated before the flight scene can continue (causing a lag spike) so that ships don't fall through the terrain before it gets a chance to generate.

The terrain generation on a large scale will still be done with 2D, stock PQS Mods, but the smaller details, such as overhangs, rocks, caves, etc., will be done with specialized 3D Voxel PQS Mods. This way, people can disable the voxel terrain system on lower end systems and still have the same general shape of the terrain.

The terrain color will also be generated per voxel, so you could have the underground terrain be a different color, or have small blotches of color all over the surface. Since the vertex-density will be much higher than in the stock terrain system, and colors are per-vertex, smaller details will be possible.

I'm sure this system is going to spawn many bugs once I push it into the game, but we'll deal with that once we get there.

I might also want to write a custom terrain shader for this that can better handle voxel terrain, but I'm afraid there might be conflicts with mods that already replace the terrain shaders, such as EVE Overhaul or Scatterer.

In other news, I recently had a hard drive crash. Thankfully though, everything important was backed up to github. :)

Edited by MrHappyFace
Link to comment
Share on other sites

Got the smoothing algorithm working. Apparently, I needed to use a scalar field instead of a binary field. Binary means that 0 is air and 1 is ground, with no in between. With the scalar field, I can specify the density of each point from 0 (air) to 1 (ground). This allows for non-blocky shapes because of the fuzzy edges.

I also got edge detection working, which is required for seamless transitions between chunks and subchunks. In the stock terrain system, they use a similar (but much simpler) edge detection algorithm to make the terrain seamless. BTW, I actually am talking about seams in the terrain, if I (or the stock terrain) didn't do this, there'd be ugly seams in the mesh everywhere.
Each subchunk is a cube with terrain inside, and the colors are where the terrain intersects the boundaries of that cube. Red means that it is intersecting the corner of the cube, yellow means it is intersecting an edge, and green means it is intersecting a face.

FL53SAp.jpg

I still don't have actual seam smoothing working yet, so there's still seams around the boundaries of the subchunks, but that's mostly straightforward now that I've got the edge detection finished.

This also means LOD is much more straightforward now too, and once I finish these two things, I can start integrating the voxel terrain into KSP.

:)

Edited by MrHappyFace
Link to comment
Share on other sites

Is it possible to make individual planes of water? the stock sea-level system is inadequate sometimes.

This would make it possible to have multiple kinds of liquid on the surface of a single world, As well as bodies of water at different altitudes.

Link to comment
Share on other sites

Is it possible to make individual planes of water? the stock sea-level system is inadequate sometimes.

This would make it possible to have multiple kinds of liquid on the surface of a single world, As well as bodies of water at different altitudes.

I'm also unhappy about the stock ocean system, but at the moment, I don't know how to fix it. I definitely want to do something about it though.

It was relatively easy pre-1.0.5 because the buoyancy system was really simple and could be easily replicated (stock kopernicus did this before 1.0.5), but now it's way too difficult to try to replicate the buoyancy system, so the only sensible option is to somehow force it to activate/deactivate when/where you want, but I don't have any idea how to do that at the moment.

@blackrack was doing something similar to move ships with the waves in scatterer's ocean shaders, but I'm not sure if that ever came to fruition, or if it could possibly work on scales larger than a few meters.

Edited by MrHappyFace
Link to comment
Share on other sites

I found it! I finally found it!! The add-on I've been looking for to add tails to comets and other neat things. As soon as I wake up... Today (AusEST), I'll be downloading it instantly.

Link to comment
Share on other sites

  • 2 weeks later...
47 minutes ago, daniel l. said:

@MrHappyFace 1.1 is out on prerelease :), Any plans relating to the surface grass?

Don't have access to the prerelease because I didn't buy on steam, but I am updating all of the shaders to Unity 5 using the unity editor. Hopefully, there'll be much better compatibility in the next version for all of the shader effects, including the particle grass shader. :D

I'll probably make an interim release after 1.1 finally comes out, including particle grass and some bugfixes, then get back to working on voxel terrain.

Link to comment
Share on other sites

Just now, MrHappyFace said:

Don't have access to the prerelease because I didn't buy on steam, but I am updating all of the shaders to Unity 5 using the unity editor. Hopefully, there'll be much better compatibility in the next version for all of the shader effects, including the particle grass shader. :D

I'll probably make an interim release after 1.1 finally comes out, including particle grass and some bugfixes, then get back to working on voxel terrain.

readImage?iid=20397105

:P

Link to comment
Share on other sites

I finished the particle grass shader today. It's not in KSP yet, but once 1.1 comes out, I'll put it in.

Here's a gfycat of the grass in action. There's some compression from gfycat though:

Oh neat, you can embed gfycats now.

 

There are some problems with the grass though, but they'll probably be less apparent when the terrain is not flat, and the grass is not so evenly distributed.

The LOD boundaries are painfully visible, which is probably just a matter of tweaking some color settings, but I'm not sure yet:

z3CCt16.jpg

And the grass viewed from the top looks a bit geometric. Not so sure how to fix this, hopefully it'll be mostly unnoticeable when the grass isn't so evenly spaced. If anyone has any ideas, I'm open.

tGOVH07.jpg

The scene shown above has 40,000 high-detail grass particles, and 115,200 low-detail grass particles, and is running at ~60fps on my computer in fullscreen. Very promising, considering that almost all cases of grass in-game won't have such dense fields like this does.

Now that that's done, I don't have much to do but wait for 1.1 to release... :P

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