Jump to content

How do I make a flat site with Kopernicus


Recommended Posts

I need level ground to land my planes on. Something similar to the flat ground around KSC. I've been trying to make it happen through Kopernicus, but so far to no avail.

There's once Kopernicus example for moving the Space center:

Spoiler

@Kopernicus:AFTER[Kopernicus]
{
    @Body[Kerbin]
    {
        SpaceCenter
        {
            //PQSCity
            latitude = 10
            longitude = -110
            lodvisibleRangeMult = 6
            repositionRadiusOffset = 53
            
            // MapDecal
            decalLatitude = 10
            decalLongitude = -110
            heightMapDeformity = 80
            absoluteOffset = 0
            absolute = true
            radius = 10000
            
            // Ground Materials
            groundColor = 0.641791, 0.5348482, 0.4106565, 0.69
            //groundTexture = BUILTIN/ksc_exterior_terrain_ground
        }
    }
}

 

On it's own, it works a treat. I can put the space center in any place I like (well, i didn't try oceans) and the terrain around it will be flattened, creating plateaus or valleys as needed. Great!

Now I'm trying to get the flat terrain without relocating the Space Center. This is where I'm hitting a snag: simply renaming the node from "SpaceCenter" to anything else will render it ineffective: not only does KSC stay at home, but the terrain at the target lat/long remains entirely unchanged.

Could anyone please lend me a hand with this?

Edited by Laie
Link to comment
Share on other sites

You may want to switch over the the FlattenArea function instead...? yymv

@Kopernicus:AFTER[Kopernicus]
{
    @Body[Kerbin]
	{
		@PQS
		{
			@Mods
			{
				FlattenArea
				{
					DEBUG_showColors = False
					flattenTo = 0 //height in m
					innerRadius = 0 //radius of start of slope in m
					outerRadius = 0 //radius of end of slope in m
					position = 0,0,0 //x,y,z radial vectors
					smoothEnd = 0
					smoothStart = 0
					order = 99999
					enabled = True
					name = value //name identifier
				}
			}
		}
	}
}

 

Edited by Poodmund
Link to comment
Share on other sites

3 hours ago, Poodmund said:

You may want to switch over the the FlattenArea function instead...? yymv

Sounds good. Only... now I have the problem of how to map xyz to boring old coordinates. There's online calculators, but putting in some known values from Kopernicus examples (position of the Temple, KSC2 and so on) I cannot find any relation to their position on the surface. Coordinates for KSC appear to be below ground, for starters.

[Edit]:

I'm still not 100% certain if I have figured out coordinates, but I tried FlattenArea on four spots that should each be 5° away from KSC in the four cardinal directions, without obvious success. That should be visible from the space center, right? Even if it doesn't raise the sea, the one spot due west should flatten the grasslands...

I start to wonder if I need to place an artifact first (KSC, Monolith, Radar Dish) before I can flatten the terrain around it.

Edited by Laie
Link to comment
Share on other sites

The calculation is the following:

Your input variables are:

  • latitude of the desired point (lat)
  • longitude of the desired point (lon)
  • altitude (above sea level) of the desired point (alt)
  • radius of the planet (rad)

I am going to assume that the sin and cos functions accept degrees instead of radians.

lat = lat - 90
x = (alt + rad) * -1 * sin(lat) * cos(lon)
y = (alt + rad) * cos(lat)
z = (alt + rad) *  -1 * sin(lat) * sin(lon)

X, Y, and Z are the three values of the position vector you need to enter.

And if you are a terribly lazy person like I am you can just do this:

FlattenArea
{
	Position
	{
		latitude = <latitude>
		longitude = <longitude>
		altitude = <altitude above sea level>
	}
}

 

Edited by Thomas P.
Link to comment
Share on other sites

21 hours ago, Thomas P. said:

And if you are a terribly lazy person like I am you can just do this: 


FlattenArea
{
	Position
	{
		latitude = <latitude>
		longitude = <longitude>
		altitude = <altitude above sea level>
	}
}

 

Thank you so much for this. That's a true quality-of-life improvement, now I'm getting somewhere.
Behold! Isengard:

not-so-flat-area.jpg

That spike is due to a difference between the Position{} altitude and the value of FlattenTo appears to happen whenever you try to flatten terrain to a height much lower than it's natural altitude. If you try to raise the ground too much, you get a hole instead. But Hey! it was the first time my terrain-altering patches produced a visible effect, and after two day of bashing my head against the wall, this was a real breakthrough (no pun intended). I literally screamed with joy.

And yes, no need to enter the flight scene: it's visible even from the space center.

Edited by Laie
Link to comment
Share on other sites

6 hours ago, Laie said:

That spike is due to a difference between the Position{} altitude and the value of FlattenTo appears to happen whenever you try to flatten terrain to a height much lower than it's natural altitude. If you try to raise the ground too much, you get a hole instead. But Hey! it was the first time my terrain-altering patches produced a visible effect, and after two day of bashing my head against the wall, this was a real breakthrough (no pun intended). I literally screamed with joy.

Thats interesting. The SpaceCenter uses FlattenAreaTangential instead of FlattenArea, so maybe using that instead works better?

I have distant memories of FlattenArea being messed up, but I could be wrong.

Link to comment
Share on other sites

2 minutes ago, Thomas P. said:

Thats interesting. The SpaceCenter uses FlattenAreaTangential instead of FlattenArea, so maybe using that instead works better?

For my purposes, a map decal would probably be the right solution, but that poses the question of how to make a decal heightmap.

FlattenArea works nicely as long as you stay within tens of meters of the original altitude at the coordinates. I've picked a site that was pretty level to begin with, and made a string of small flattened areas. The outcome is a 3km stretch of level ground that blends into the surrounding landscape so well, I'll have to place flags in order to find it. Mission accomplished.

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