[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
User avatar
Nystul
Posts: 1400
Joined: Mon Mar 23, 2015 8:31 am

Re: [MOD] Distant Terrain

Post by Nystul » Tue May 12, 2020 6:49 pm

can you tell us the map location (nearest town e.g.) from where that screenshot was captured? thank you :)

User avatar
herman2000
Posts: 16
Joined: Sun May 10, 2020 2:08 pm
Location: Dresden, Saxony, Germany
Contact:

Re: [MOD] Distant Terrain

Post by herman2000 » Wed May 13, 2020 6:51 am

Hm. With Distant Terrain's improved Terrain setting, I'm getting some weird results in south-Dak'fron. Fast-Travelling to Lothten Orchard spawns me beneath the Terrain. Going from The Queen's Huntsman's Lodge and running South East for a while, I'll eventually see giant holes in the terrain. With the setting turned off, all is well. Quite bizarre.
Spoiler!
Image

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

Re: [MOD] Distant Terrain

Post by pango » Wed May 13, 2020 10:27 am

When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

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

Re: [MOD] Distant Terrain

Post by Nystul » Mon May 25, 2020 8:20 pm

Hazelnut wrote:
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:
thanks for investigating - this is indeed an easy fix - thanks for your efforts!

update: there is a new version 2.6.1 with retro rendering mode support and map border fix in first post of this thread

Post Reply