[MOD] Interesting Terrains [WIP]

Show off your mod creations or just a work in progress.
Post Reply
Jarlyjarljarl
Posts: 64
Joined: Sat Aug 01, 2020 6:37 am

Re: [MOD] Interesting Terrains [WIP]

Post by Jarlyjarljarl »

Daniel87 wrote: Tue Apr 27, 2021 10:09 am
All you would need to get the oceans back is:
- Creating a mod
- Having the mod load your custom ITerrainTexturing script before game start

Code: Select all

static MyTerrainTexturing myTexturing;
myTexturing = new MyTerrainTexturing();
DaggerfallUnity.Instance.TerrainTexturing = myTexturing;
Where do I go in the editor to have the mod load a custom script before game start? I'm still new to Unity and really have no idea how to do this.
Daniel87 wrote: Tue Apr 27, 2021 10:09 am
- Adding this rule to the texturing algorithm of your custom ITerrainTexturing (in this case called "MyTerrainTexturing.cs"):

Code: Select all

if (height <= 100.1f) {
    tileData[index] = water;
    return;
}
How do I add a script to the mod? In fact how do I add anything to the mod? It only says to add selected asset, I see no "add to mod" option or a way to add an asset to the list.

Also whereabouts in this code below am I supposed to put your lines of code?

Code: Select all

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NewBehaviourScript : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        
    }
}

User avatar
Daniel87
Posts: 391
Joined: Thu Nov 28, 2019 6:25 pm

Re: [MOD] Interesting Terrains [WIP]

Post by Daniel87 »

Jarlyjarljarl wrote: Tue Apr 27, 2021 4:13 pm
Daniel87 wrote: Tue Apr 27, 2021 10:09 am
All you would need to get the oceans back is:
- Creating a mod
- Having the mod load your custom ITerrainTexturing script before game start

Code: Select all

static MyTerrainTexturing myTexturing;
myTexturing = new MyTerrainTexturing();
DaggerfallUnity.Instance.TerrainTexturing = myTexturing;
Where do I go in the editor to have the mod load a custom script before game start? I'm still new to Unity and really have no idea how to do this.
Daniel87 wrote: Tue Apr 27, 2021 10:09 am
- Adding this rule to the texturing algorithm of your custom ITerrainTexturing (in this case called "MyTerrainTexturing.cs"):

Code: Select all

if (height <= 100.1f) {
    tileData[index] = water;
    return;
}
How do I add a script to the mod? In fact how do I add anything to the mod? It only says to add selected asset, I see no "add to mod" option or a way to add an asset to the list.
Let me answer this in another place, to keep things tidy.
I will write you a post in the next few minutes here
In Julianos we Trust.

User avatar
King of Worms
Posts: 4747
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: [MOD] Interesting Terrains [WIP]

Post by King of Worms »

Im still not sure if the Widerness by you Daniel will be compatible with interesting terrains? If I understand it right, Wilderness is about ground textures and sprites placement? And Terrains is about terrains shapes and a bit of texture distribution tweaks

I think by combining both mods we could get ultimate results? Best terrain shape with best texture algo and sprite placements..

Or will Widlerness have some kind of terrain height/shape improvements as well?

IMO so far the Interresting Terrains has the best terrain from all the terrain mods. So combine this with Wilderness is like a dream come true possibly.

Im a bit lost at this 😊

User avatar
Daniel87
Posts: 391
Joined: Thu Nov 28, 2019 6:25 pm

Re: [MOD] Interesting Terrains [WIP]

Post by Daniel87 »

King of Worms wrote: Tue Apr 27, 2021 6:45 pm Im still not sure if the Widerness by you Daniel will be compatible with interesting terrains? If I understand it right, Wilderness is about ground textures and sprites placement? And Terrains is about terrains shapes and a bit of texture distribution tweaks

I think by combining both mods we could get ultimate results? Best terrain shape with best texture algo and sprite placements..

Or will Widlerness have some kind of terrain height/shape improvements as well?

IMO so far the Interresting Terrains has the best terrain from all the terrain mods. So combine this with Wilderness is like a dream come true possibly.

Im a bit lost at this 😊
Yeah you are right my friend. WO is about Billboard placement and Terrain Texturing but it doesn't touch Heightmaps.
Right now I am testing Interesting Terrain vs Mountains and Hills vs No Heightmap Mod. As I understand it, ITs heightmap values completely differ from M&H and original DF. This causes problems with pretty much everything, from placing vegetation to texturing the terrain because I use the relative height in relation to the absolute height very often for the right choice of vegetation and the chance for certain textures.

Currently I am trying to figure out a way to change the height value when using IT so it comes as close as possible to the equivalent height value of M&H and original DFU, but to be honest, it really is a pain.
I am thinking if I should abandon the original DFU and Mountains and Hills for the sake of Interesting Terrain. What do you think?
I just don't really like the idea of depending on an abandoned mod :/
In Julianos we Trust.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: [MOD] Interesting Terrains [WIP]

Post by BadLuckBurt »

Daniel87 wrote: Tue Apr 27, 2021 6:56 pm Yeah you are right my friend. WO is about Billboard placement and Terrain Texturing but it doesn't touch Heightmaps.
Right now I am testing Interesting Terrain vs Mountains and Hills vs No Heightmap Mod. As I understand it, ITs heightmap values completely differ from M&H and original DF. This causes problems with pretty much everything, from placing vegetation to texturing the terrain because I use the relative height in relation to the absolute height very often for the right choice of vegetation and the chance for certain textures.

Currently I am trying to figure out a way to change the height value when using IT so it comes as close as possible to the equivalent height value of M&H and original DFU, but to be honest, it really is a pain.
I am thinking if I should abandon the original DFU and Mountains and Hills for the sake of Interesting Terrain. What do you think?
I just don't really like the idea of depending on an abandoned mod :/
This is just a thought but what if you turned the height values into percentages relative to the defined min and max heights in the terrain sampler and check against those? Those properties are publicly available if I'm not mistaken. I'm not sure if it will work but it just might do the trick to make it scale properly.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Daniel87
Posts: 391
Joined: Thu Nov 28, 2019 6:25 pm

Re: [MOD] Interesting Terrains [WIP]

Post by Daniel87 »

BadLuckBurt wrote: Tue Apr 27, 2021 7:03 pm
Daniel87 wrote: Tue Apr 27, 2021 6:56 pm Yeah you are right my friend. WO is about Billboard placement and Terrain Texturing but it doesn't touch Heightmaps.
Right now I am testing Interesting Terrain vs Mountains and Hills vs No Heightmap Mod. As I understand it, ITs heightmap values completely differ from M&H and original DF. This causes problems with pretty much everything, from placing vegetation to texturing the terrain because I use the relative height in relation to the absolute height very often for the right choice of vegetation and the chance for certain textures.

Currently I am trying to figure out a way to change the height value when using IT so it comes as close as possible to the equivalent height value of M&H and original DFU, but to be honest, it really is a pain.
I am thinking if I should abandon the original DFU and Mountains and Hills for the sake of Interesting Terrain. What do you think?
I just don't really like the idea of depending on an abandoned mod :/
This is just a thought but what if you turned the height values into percentages relative to the defined min and max heights in the terrain sampler and check against those? Those properties are publicly available if I'm not mistaken. I'm not sure if it will work but it just might do the trick to make it scale properly.
I will check that now.
The weird thing is that MaxTerrainHeight of IT is 5000 while for the original DFU and M&H it is 1539. This scales quite weird.
I evaluated for DFU and M&H the following heightmapSample[y,x] value range:
Woodlands (0 - 0.35)
Mountains (0 - 0.85)
In IT they are mostly based around 0.1 - 0.4 with some extreme cases going to 0.8 in moutain but average in mountain is around 0.2 - 0.3

Is there a global min and max or is it only for MapPixels? As I understood it, landscapes gradually increase in size going from the ocean to the high mountains. I expected this to be from 0 to 1 (0.85 since there is always a couple of hundred meters of "sky" above)
For this I used mainly MapPixel.WorldHeight, but I am not sure how that differs between the mods or if IT ignores this value for its height maps.

EDIT: WorldHeight is being drawn from the Game files, so it should be the same across all Mods, no matter if the heightmap makes sense with it or not.

Phew, I already exceed 4500 lines of code with my mod...
In Julianos we Trust.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: [MOD] Interesting Terrains [WIP]

Post by BadLuckBurt »

Max terrain height is arbitrary. You could change that to 12000 which is ridiculous but that's why I hope just going by percentages will work.

Check the source code of both mods to see if they have min - max values. Normally there should be MaxTerrainHeight declared somewhere in the sampler code.

The WorldHeight is the integer value from the original heightmap so yeah, that doesn't change. You could base your code around that instead, would simplify things a lot.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
King of Worms
Posts: 4747
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: [MOD] Interesting Terrains [WIP]

Post by King of Worms »

I agree that depending on abandoned mod is sketchy. If it is open source tho, with code on git, than its different story and you can continue to work on it and adjust it for Wilderness.. Thats how at least one of the old terrain samplers survived to this day anyway, abandoned and taken over by others.

Ive tried all terrain samplers available and interesting terrains is the best one IMO by far. It takes the game to another level. It also works with the road system. Only drawback is that it was not compatible with distant terrain if I remember corectly.

User avatar
Daniel87
Posts: 391
Joined: Thu Nov 28, 2019 6:25 pm

Re: [MOD] Interesting Terrains [WIP]

Post by Daniel87 »

King of Worms wrote: Tue Apr 27, 2021 8:12 pm I agree that depending on abandoned mod is sketchy. If it is open source tho, with code on git, than its different story and you can continue to work on it and adjust it for Wilderness.. Thats how at least one of the old terrain samplers survived to this day anyway, abandoned and taken over by others.

Ive tried all terrain samplers available and interesting terrains is the best one IMO by far. It takes the game to another level. It also works with the road system. Only drawback is that it was not compatible with distant terrain if I remember corectly.
Then it's decided. I will base my mod on IT. The mod will not "need" it to run, but it will look best with it. I also love the terrains a LOT. They look simply amazing.
In Julianos we Trust.

Jarlyjarljarl
Posts: 64
Joined: Sat Aug 01, 2020 6:37 am

Re: [MOD] Interesting Terrains [WIP]

Post by Jarlyjarljarl »

King of Worms wrote: Tue Apr 27, 2021 8:12 pm I agree that depending on abandoned mod is sketchy. If it is open source tho, with code on git, than its different story and you can continue to work on it and adjust it for Wilderness.. Thats how at least one of the old terrain samplers survived to this day anyway, abandoned and taken over by others.

Ive tried all terrain samplers available and interesting terrains is the best one IMO by far. It takes the game to another level. It also works with the road system. Only drawback is that it was not compatible with distant terrain if I remember corectly.
IT is definitely compatible with Distant Terrain. You just need to not activate Distant Terrain's own heightmap in the settings.

IT was designed to work with DT and Basic Roads.

In fact I would say don't use it without DT as the distant terrain that DT uses from IT's heightmap make the horizon look stunning. This is the distant terrain (with IT) of the Isle of Balfiera from the southern coast of Menevia
Attachments
received_272283044612142.jpeg
received_272283044612142.jpeg (66.72 KiB) Viewed 1318 times

Post Reply