[MOD] Distant Terrain

A curated forum for approved 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
Opcero
Posts: 7
Joined: Tue Sep 03, 2019 8:12 pm

Re: [MOD] Distant Terrain

Post by Opcero » Tue Sep 03, 2019 9:08 pm

pango wrote:
Tue Sep 03, 2019 8:28 pm
Opcero wrote:
Tue Sep 03, 2019 8:17 pm
I'm getting a pink sky. searching this thread; before build 2.1 there was a conflict with enhanced sky? I have the current build downloaded (2.6 I think) and enhanced sky, but I'm getting the pink distant terrain bug. I'm on a Mac if that helps at all. It's not the sky, per se, that is pink, but rather the very distant terrain?
Did you install only the mods for OS X? Mod archives often contain the .dfmod files for Windows, Linux and OS X, but you must only install the one that matches your system, otherwise you can get issues like above.
There can be other reasons, but that one if worth checking.
thanks! Turns out I accidentally installed the windows version!

MonoRena667
Posts: 10
Joined: Thu Aug 01, 2019 5:10 pm

Re: [MOD] Distant Terrain

Post by MonoRena667 » Mon Sep 16, 2019 8:38 pm

Nystul wrote:
Mon Aug 19, 2019 9:34 am
there was a similar issue with on older version of this mod, maybe MonoRena667 is running an older version?
I have version 2.6.0 and I am using the most recent Daggerfall Unity version...still falling through the ground in the same location.

I am using the Windows version. Might be an issue with that, do you want my mod list?

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

Re: [MOD] Distant Terrain

Post by Nystul » Tue Sep 17, 2019 1:10 pm

hmm yes there seems to be a problem in a function (ScheduleGenerateSamplesJob) - not sure when I will have time to take a look

User avatar
Hazelnut
Posts: 1808
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: [MOD] Distant Terrain

Post by Hazelnut » Fri Sep 27, 2019 5:12 pm

Could this possibly be caused by using Distant Terrain as well as Mountains & Hills mods together? I've seen a lot of people using both mods, even though they're incompatible as far as I am aware since only one terrain sampler can be used at a time. Either way I think both DT and M&H mods need to make it much much clearer that they should not be used together.

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

Re: [MOD] Distant Terrain

Post by Nystul » Fri Sep 27, 2019 7:59 pm

no, it is a problem in Distant Terrain mod, I was able to reproduce with distant terrain being the only mod active

User avatar
Ferital
Posts: 177
Joined: Thu Apr 05, 2018 8:01 am

Re: [MOD] Distant Terrain

Post by Ferital » Mon Sep 30, 2019 8:27 am

An issue I just encountered: travelling to T'old Manor in Abibon-Gora leads to an IndexOutOfRangeException:

Code: Select all

IndexOutOfRangeException: Array index is out of range.
DistantTerrain.ImprovedTerrainSampler.ScheduleGenerateSamplesJob (DaggerfallWorkshop.MapPixelData& mapPixel)
DaggerfallWorkshop.DaggerfallTerrain.BeginMapPixelDataUpdate (DaggerfallWorkshop.TerrainTexturing terrainTexturing) (at Assets/Scripts/Terrain/DaggerfallTerrain.cs:211)
DaggerfallWorkshop.StreamingWorld.UpdateTerrainData (TerrainDesc terrainDesc) (at Assets/Scripts/Terrain/StreamingWorld.cs:1176)
DaggerfallWorkshop.StreamingWorld+<UpdateTerrains>c__Iterator0.MoveNext () (at Assets/Scripts/Terrain/StreamingWorld.cs:634)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
DaggerfallWorkshop.StreamingWorld:Update() (at Assets/Scripts/Terrain/StreamingWorld.cs:255)

User avatar
Hazelnut
Posts: 1808
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: [MOD] Distant Terrain

Post by Hazelnut » Thu Oct 10, 2019 5:15 pm

I should take a look at that and check it's nothing to do with the jobs update I made. Nystul, have you made any changes that aren't in your github repo? I ask because it's been 9 months since the last commit.

User avatar
Hazelnut
Posts: 1808
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: [MOD] Distant Terrain

Post by Hazelnut » Thu Oct 10, 2019 6:33 pm

I took a look and it's not due to the jobs update. I did track down the error to these lines 606-608 of ImprovedTerrainSampler.cs:

Code: Select all

int mapPixelX = Math.Max(0, Math.Min(mx + x - 2, WoodsFile.mapWidthValue -1));
int mapPixelY = Math.Max(0, Math.Min(my + y - 2, WoodsFile.mapHeightValue -1));
waterDistanceMap[x, y] = (float)Math.Sqrt(ImprovedWorldTerrain.MapDistanceSquaredFromWater[mapPixelY * WoodsFile.mapWidthValue + mapPixelX]);
The array out of bounds happens when the mapPixelY becomes 500, so when multiplied by 1000 it's 500,000 which is the length of the array. Subtracting 1 from the map width and height values (as shown in the modified code above) stops the OOB but it may be that the actual mapPixelY/X need 1 subtracting for the array. I will leave that to you Nystul as I have no idea what this code is actually doing. :lol:

Post Reply