[MOD] Distant Terrain

A curated forum for compatible and maintained mods. Users are unable to create new topics in this forum but can reply to existing topics. Please message a moderator to have your mod moved into this forum area.
Post Reply
User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

[MOD] Distant Terrain

Post by Nystul »

@Interkarma: working on an updated version of my DistantTerrain mod (and making it compatible with Uncanny Valley's "Mountains And Hills" mod).

I realized that we will run into problems with terrain samplers not using a baseHeightScale and noiseMapScale equal to DefaultTerrainSampler. Luckily it seems that Uncanny Valley's mod uses same scale factors as DefaultTerrainSampler (8.0, 4.0 which add up to a scaling factor of 12.0).

To get matching near terrain and far terrain I have to scale the small height map with this factor (I just assume it to be 12.0 for the moment).

Now what happens if the terrain sampler function GenerateSamples generates height samples with different scale is that this won't fit far terrain height values of DistantTerrain mod.

A workaround to support custom terrain samplers with different scale factor would be to introduce a settings float value for distant terrain mod. This would work but would require the user to know the correct values for the terrain sampler in use.
A better way would be if distant terrain mod could get the scale factor from the terrain sampler (like with properties MaxTerrainHeight, OceanElevation and BeachElevation)

What are your thoughts about this?

User avatar
Interkarma
Posts: 7234
Joined: Sun Mar 22, 2015 1:51 am

Re: [MOD] Distant Terrain

Post by Interkarma »

I understand, and I'd be happy for the ITerrainSampler interface and base class to expose this property so others can use it.

I'm happy for you to add this so it suits your needs precisely, but just let me know if any assistance required.

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: [MOD] Distant Terrain

Post by Nystul »

Distant Terrain 2.3.0 (only compatible with new dfunity version with new baseline (Unity 2018.1.2f1)):
https://drive.google.com/file/d/1GoYxeU ... sp=sharing

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: [MOD] Distant Terrain

Post by Nystul »

Interkarma wrote: Thu Jun 14, 2018 10:21 pm I understand, and I'd be happy for the ITerrainSampler interface and base class to expose this property so others can use it.

I'm happy for you to add this so it suits your needs precisely, but just let me know if any assistance required.
Ok, I will work on it ;) Will try to coordinate with Uncanny Valley so I do not break his mod ;)

User avatar
Uncanny_Valley
Posts: 221
Joined: Mon Mar 23, 2015 5:47 pm

Re: [MOD] Distant Terrain

Post by Uncanny_Valley »

Nystul wrote: Thu Jun 14, 2018 11:00 pm
Interkarma wrote: Thu Jun 14, 2018 10:21 pm I understand, and I'd be happy for the ITerrainSampler interface and base class to expose this property so others can use it.

I'm happy for you to add this so it suits your needs precisely, but just let me know if any assistance required.
Ok, I will work on it ;) Will try to coordinate with Uncanny Valley so I do not break his mod ;)
Thank your for your consideration. :) My plan is to update my mods over the weekend, and if there anything I can fix or change on my end to improve compatibility, just let me know. :)

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: [MOD] Distant Terrain

Post by Nystul »

ok, so here is what my latest pull request does and how you can update your mod to work with next version of Distant Terrain mod:

here is a copy of the comment of the pull request:

new property MeanTerrainHeightScale and new method TerrainHeightScale added

default use is fixed terrain height scale factor - set MeanTerrainHeightScale in constructor (SimpleTerrainSampler, NoiseTerrainSampler, DefaultTerrainSampler)

more sophisticated use: terrain height scale factor depends on map pixel position - override for method TerrainHeightScale(x,y) happens in this case (used by Distant Terrain Mod's Improved Terrain Sampler)


what you will have to do (once the pull request is accepted) is to add a line to the constructor of your terrain sampler like in DefaultTerrainSampler:

Code: Select all

MeanTerrainHeightScale = baseHeightScale + noiseMapScale;
just replace baseHeightScale + noiseMapScale with your scaling factor (if it differs)

as soon as the pull request is accepted I will also update Distant Terrain from 2.3.0 to 2.4.0 (it will use new methods then)

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: [MOD] Distant Terrain

Post by Nystul »

Distant Terrain 2.4.0 (uses new changes to Terrain Sampler, only compatible with new dfunity version with new baseline (Unity 2018.1.2f1)):
https://drive.google.com/file/d/11oVri4 ... sp=sharing

ready to be moved to Released Mods forum :)

User avatar
ZephaniahNoah
Posts: 4
Joined: Tue Feb 13, 2018 2:41 am

Re: [MOD] Distant Terrain

Post by ZephaniahNoah »

Not compatible with Enhanced Sky?
Spoiler!
Image
EDIT: My bad. Enhanced Sky just doesn't work with the current build of DFU.

User avatar
Interkarma
Posts: 7234
Joined: Sun Mar 22, 2015 1:51 am

Re: [MOD] Distant Terrain

Post by Interkarma »

Nystul is working on an update for Enhanced Sky that's compatible with latest version. It's still a work in progress, but you can download best available version from this post (last post on that page).

https://forums.dfworkshop.net/viewtopic ... =40#p14123

Once Nystul is happy with the rebuilt mod, it will be placed back into Released Mods forums with a topic of its own.

User avatar
Midknightprince
Posts: 1324
Joined: Fri Aug 11, 2017 6:51 am
Location: San Antonio TX
Contact:

Re: [MOD] Distant Terrain

Post by Midknightprince »

ZephaniahNoah wrote: Mon Jul 09, 2018 9:34 pm Not compatible with Enhanced Sky?
Spoiler!
Image
EDIT: My bad. Enhanced Sky just doesn't work with the current build of DFU.
It's been updated, it works..
make sure it's 2.1, that's the one that works for me..
Check out my YouTube Channel!

Post Reply