[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
Opcero
Posts: 36
Joined: Tue Sep 03, 2019 8:12 pm

Re: [MOD] Distant Terrain

Post by Opcero »

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 »

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: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: [MOD] Distant Terrain

Post by Nystul »

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: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: [MOD] Distant Terrain

Post by Hazelnut »

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.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: [MOD] Distant Terrain

Post by Nystul »

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: 282
Joined: Thu Apr 05, 2018 8:01 am

Re: [MOD] Distant Terrain

Post by Ferital »

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: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: [MOD] Distant Terrain

Post by Hazelnut »

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.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: [MOD] Distant Terrain

Post by Hazelnut »

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:
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
haloterm
Posts: 391
Joined: Sat Feb 16, 2019 5:21 am

Re: [MOD] Distant Terrain

Post by haloterm »

Ferital wrote: 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]
I think that is the same issue reported by another user in August (about fast travel to Abibon-Gora).

I want to add that is not related to the location itself, but to being so far south / near the southern end of the game world. With the mod, DFU freezes also when you manually walk too far south and north in general.

For example, I was at Eternal Sunrise of Kynareth in the Wrothgarian mountains today (beautiful panorama, really gorgeous). It's a small temple village between two very high mountains. To the north there's the ocean. One can run several minutes north. The terrain gets spikier. Near the coast there is another hill visible, but before reaching it, DFU freezes.

I think it's basically the end of the world here that makes the mod freeze DFU. If one knows that, one can circumvent this by being very careful not going too far. Usually, this is not needed anyway, because there is nothing of interest (besides the views), but Abibon-Gora is a special case, because it is so far south that it is affected by the issue. So simply avoid quests leading there, at least as the mod can take care of the issue.

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: [MOD] Distant Terrain

Post by pango »

I'm not sure what you mean by "freeze", if that means "stop responding", then something is wrong.
It's just supposed to prevent you from going forward, but you should be able to walk away from the border and everything should be okay:
https://github.com/Interkarma/daggerfal ... PS.cs#L319
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

Post Reply