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

Kopernicus doesn't load RSS or any config #283

Closed
mferrie opened this issue Apr 2, 2018 · 11 comments
Closed

Kopernicus doesn't load RSS or any config #283

mferrie opened this issue Apr 2, 2018 · 11 comments

Comments

@mferrie
Copy link

mferrie commented Apr 2, 2018

A screenshot of my modlist is attached. KSP doesn't crash; it just doesn't change the solar system.
new bitmap image

@Olympic1
Copy link
Contributor

Olympic1 commented Apr 3, 2018

You don't have RSS Textures installed. Those are needed for RSS to load.

https://github.com/KSP-RO/RSS-Textures

@Kerbas-ad-astra
Copy link

Kerbas-ad-astra commented Apr 3, 2018

I've been tinkering with RSS in 1.4 as well (with the textures), and the issue appears to be related to the VertexSimplexHeightAbsolute PQS mod. Earth's CFG reads (in part):

@Kopernicus:FOR[RealSolarSystem]
{
	// Earth
	Body
	{
		name = Kerbin
		[...]
		PQS
		{
			deactivateAltitude = 167000
			fadeStart = 102000
			fadeEnd = 127000
			Material
			{
				saturation = 0.8
				contrast = 2.5
			}
			Mods
			{
				VertexSimplexHeightAbsolute
				{
					deformity = 900 //1200
					persistence = 0.5 //0.38
					frequency = 32
				}
				[...]
			}
		}
		[...]
	}
}

Delete the VertexSimplexHeightAbsolute block, and the game loads and runs properly. (Some of the terrain is a little off, especially noticeable at coastal launch sites.) If the block isn't deleted, then the game loads into empty space (skybox visible, nothing else), and attempting to access any of the space center buildings by the buttons to the side results in the game hanging or crashing.

Other planets in RSS have a VertexSimplexHeightAbsolute PQS mod, and they appear to function just fine (I cheated a rover to Mars, landed, and drove around a bit with no difficulties).

@Kerbas-ad-astra
Copy link

Kerbas-ad-astra commented Apr 3, 2018

After some more tinkering, it seems that the issue is that the values in the VertexSimplexHeightAbsolute PQS mod are causing the ground mesh (I think?) to somehow become invalid. Upon entering a game (i.e. after the main menu), I get a whole bunch of this in the log:

Mesh '': abnormal mesh bounds - most likely it has some invalid vertices (+/-inifinity or NANs) due to errors exporting.
Mesh bounds min=(-1.#J, -1.#J, -1.#J), max=(-1.#J, -1.#J, -1.#J). Please make sure the mesh is exported without any errors.

[repeats some...]

Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 1176, VertexCount: 0

Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 1176, VertexCount: 0

Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 1176, VertexCount: 0

Mesh.normals is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array.

Mesh.uv2 is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array.

Mesh.normals is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array.

Mesh.uv2 is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array.

Mesh.normals is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array.

Mesh.uv2 is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array.

Look rotation viewing vector is zero
 
[repeat 'Look rotation viewing vector is zero' ad nauseam]

However, some values of the variables in the PQS mod don't cause this problem. I'm going to play with them and look for patterns.

@Kerbas-ad-astra
Copy link

Adding an "octaves = [something]" line to the config "fixes" the issue, although all of the values I've tried (1, 3, 8...) have produced spurious islands to the east of KSC. Looking at how the simplex works (Kopernicus/pqsmods-standalone/blob/master/KSP/Simplex.cs#L171), I gather that having zero octaves defined would result in a divide-by-zero error, but that doesn't explain why this wasn't a problem in KSP 1.3.1 (tested with Kopernicus 1.3.1-7 and RSS 13). Presumably there was some default behavior that changed between versions. I'm going to dig in with Kittopia and see what the values actually were, especially the ones not defined in config files; hopefully those values will fix things completely.

@Kerbas-ad-astra
Copy link

Kerbas-ad-astra commented Apr 4, 2018

The plot thickens...even when I exactly specify all of the parameters in Earth's config (as relayed by KittopiaTech with KSP 1.3.1), some of them are different when they load in KSP 1.4.2 (again, checking with KittopiaTech). It's not Module Manager acting up -- the cache shows the values from the config.

Config file:

VertexSimplexHeightAbsolute
{
	seed = 453453435
	deformity = 900 //1200
	octaves = 8
	persistence = 0.5 //0.38
	frequency = 32
	order = 20
}

In game:

VertexSimplexHeightAbsolute
{
	seed = 453453435
	deformity = 485
	octaves = 8
	persistence = 0.6
	frequency = 24
	order = 20
}

That's all I have time to test today, and I don't know where to dig from here, but there's definitely something amiss here that's new in KSP 1.4.2.

@Kerbas-ad-astra
Copy link

I just realized where the in-game config comes from: it's Kerbin's VertexSimplexHeightAbsolute PQS mod, from the stock game (as shown in the dump). Kittopia shows that the RSS PQS mod does get applied, but it's in addition to this one. Kittopia can remove the stock PQS mods (which restores the planet's expected appearance), so maybe the stock PQS mods aren't getting removed 'naturally' because KSP has changed up the order of operations so they get added after Kopernicus tries to remove them. (I suppose it could be possible to 'hack' past the problem by applying more PQS mods that are the negatives of the stock ones, but that would just be kicking the problem down the road.)

@PhineasFreak
Copy link

Is this also something that we should worry about?

[EXC 16:16:49.417] IndexOutOfRangeException: Array index is out of range.
	(wrapper stelemref) object:stelemref (object,intptr,object)
	Kopernicus.Components.KopernicusStarOcclusion.Start ()

(if so, i will provide a full log)

@Kerbas-ad-astra
Copy link

@PhineasFreak, I don't know that that's related to what's going on here.

After further investigation, I think what's changed from KSP 1.3.1 to 1.4.2 is that, for some reason, it used to be that the PQSMods in Earth.cfg would overwrite their counterparts on Kerbin, but now they are applied in addition to Kerbin's PQSMods. Every other planet config in RSS explicitly removes all PQSMods from their templates with the removePQSMods command; adding PQSMod_VertexSimplexHeightAbsolute and friends to Earth's removePQSMods list properly removes them from the game, which restores the terrain to normal. (Along with adding the missing values to each PQSMod's config, to prevent the divide-by-zero problem that caused the game to completely choke on loading.) I don't know why Kerbin/Earth used to work differently from the other planets, but I guess it's "fixed" now. (Maybe there was a bug or special case that got reworked to accommodate the multiple-launch-site capabilities in Making History.)

I can't shake the suspicion that there are other PQSMods from Kerbin that should be deleted (there's some other appearance items that I think are different from 1.3.1), but the only way to be sure is to export the planet's configs in 1.3.1 and 1.4.2 and check for changes (scrolling through all of the windows and buttons in KittopiaTech is not a good way to check for differences), and that functionality isn't working because of some of the changes in the Kopernicus 1.3.1-X series. I've got it compiling against Kopernicus 1.4.2-1, but there's still some work to do to get it working properly again.

@Kerbas-ad-astra
Copy link

KittopiaTech is updated, the configs are exported, and there were a couple of seed values that still needed to be brought into alignment. Now that that's done, Earth looks just like it did in 1.3.1.

@PhineasFreak
Copy link

I believe we can safely close this issue. RSS now works as expected under both the 1.3 and 1.4 KSP branches.

@Sigma88
Copy link
Contributor

Sigma88 commented Dec 17, 2019

since there has been no update in more than 1 year I'll close this issue, if you still experience this issue feel free to reopen it

@Sigma88 Sigma88 closed this as completed Dec 17, 2019
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

5 participants