Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetSurfaceHeight bug #246

Closed
Sigma88 opened this issue Nov 22, 2017 · 3 comments
Closed

GetSurfaceHeight bug #246

Sigma88 opened this issue Nov 22, 2017 · 3 comments

Comments

@Sigma88
Copy link
Contributor

Sigma88 commented Nov 22, 2017

DISCLAIMER: I know this is not a Kopernicus bug, but since Kopernicus uses that method I think it's worth mentioning it here

using PQS.GetSurfaceHeight(Vector3) does not return the correct value.

as far as I can tell, this is caused by anything with "ridged" noise

for example, if we look at the first PQSCity2 on Kerbin which has:

(lat = -11.95, lon = 33.74, pos = [5396701, -1373531.5, 3604598])

we get the following results:

method used stock Kerbin SigmaDimensions 10x SigmaDimensions 20x
(no ridged crap)
GetSurfaceHeight() 2651.62151 26516.19917874 21098.45243442
landed kerbal 2638.22783068579 26378.4273154484 21094.3161698328
offset 13.39367958 137.7718633 4.136265
relative offset 13.39367958 13.77718633 0.20681325

as you can see the relative offset (the offset between GetSurfaceHeight() and "landed kerbal" all divided by the rescale) is basically zero when I remove the two PQSMods that have ridged crap on kerbin

@Kopernicus
{
	@Body[Kerbin]
	{
		@Template
		{
			removePQSMods = VertexRidgedAltitudeCurve,VertexHeightNoiseVertHeightCurve2
		}
	}
}
@Sigma88
Copy link
Contributor Author

Sigma88 commented Nov 22, 2017

I tried adding VertexHeightNoise with noiseType = RidgedMultifractal to kerbin but it seems like that one doesn't mess up GetSurfaceHeight

I tested it again, this time using the same parameters of the stock mod:

STOCK

VertexRidgedAltitudeCurve
{
	deformity = 750
	ridgedAddFrequency = 140
	ridgedAddLacunarity = 2.5
	ridgedAddOctaves = 3
	ridgedAddSeed = 1384047773
	ridgedMinimum = -0.7
	ridgedMode = Standard
	[...]
	order = 16
	[...]
}

TEST:

VertexHeightNoise
{
	deformity = 750
	frequency = 140
	lacunarity = 2.5
	octaves = 3
	persistence = 1
	seed = 1384047773
	noiseType = RidgedMultifractal
	mode = Standard
	order = 16
}

turns out that using these values (in addition to removing the two ridged mods from stock) I still get the bug.

if I use more simple values however, the bug does not appear.

I assume this means that those values are breaking the calculations, probably they should be clamped or rounded to the nearest integer

@Sigma88
Copy link
Contributor Author

Sigma88 commented Nov 22, 2017

I tried changing some numbers and I found out that the culprit is "frequency"

starting from lower values it works up untill 79.
at 80 the bug appears

@Sigma88
Copy link
Contributor Author

Sigma88 commented Nov 24, 2017

solved with Sigma88/Sigma-Dimensions@6a1ce66

@Sigma88 Sigma88 closed this as completed Nov 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant