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

MapSOCorrectWrapping patch cause the Mohole to disappear #121

Closed
gotmachine opened this issue Feb 5, 2023 · 0 comments
Closed

MapSOCorrectWrapping patch cause the Mohole to disappear #121

gotmachine opened this issue Feb 5, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@gotmachine
Copy link
Contributor

gotmachine commented Feb 5, 2023

See forum post and reddit post

As of KSPCF 1.24.5, the patched ConstructBilinearCoords() methods by the MapSOCorrectWrapping patch will have the side effect of removing the Mohole (big hole at the north pole of Moho) because Squad choose that "this is not a bug, it's a feature".

To prevent that, we can acquire references to the Moho MapSO instances (biome map and height map) and fall back to the original stock implementation if the method is called on those instances.

This not only affect Moho : that patch on a stock install results in all stock bodies getting a significantly different terrain at the poles, but due to how performance sensitive those method are, checking all stock MapSO instances (there are 40 of them) isn't really an option.

Also note that the fix need to do reference acquisition from a PSystemSetup.Awake() patch because that's the only way I found to ensure we always run before Kopernicus. Failing to do so will result in Kopernius itself calling the patched methods without the bail-out on Moho active, resulting in incorrect placement of the anomaly marker, and potentially other weird issues.

And on a side note, my opinion is that this patch doesn't belong in KSPCF and the whole thing should be handled by Kopernicus as the stock ConstructBilinearCoords() implementations are only an issue in the context of planetary system modding, and the side effects shouldn't be something players not using Kopernicus should have to deal with.

@gotmachine gotmachine added the bug Something isn't working label Feb 5, 2023
@gotmachine gotmachine changed the title MapSOCorrectWrapping patch caused the Mohole to disappear MapSOCorrectWrapping patch cause the Mohole to disappear Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant