Exterior locations aren't cleared when traveling [RESOLVED]

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

Exterior locations aren't cleared when traveling [RESOLVED]

Post by Uncanny_Valley »

Sometimes when traveling, you will find locations (cities and such) floating in the sky.

How to reproduce:
Travel to Gothway Garden. Then travel to Whitecroft. You will now find the location "Burning Soul of Kynareth" floating in the sky above the coast, soutwest of Whitecroft.
or
Save your game in Whitecroft, and then load that save when you are in Gothway Garden.

The bug occurs both in the latest build (see below) and the editor:

Tested on:
Build: Windows Spells/Diseases #111 12-May-18 (64 - bit)
Github Source: 2018-05-17
Attachments
FloatingLocation.jpg
FloatingLocation.jpg (219.05 KiB) Viewed 2403 times

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

Re: Exterior locations aren't cleared when traveling

Post by Interkarma »

I just tried both of these methods and I'm unable to reproduce. As far as I'm aware, I resolved this problem a couple of years ago. If I can reproduce, I'm happy to take another crack at it. :)

Are you using any mods here or just default build? And have you increased your terrain distance in INI?

When I perform your repro steps, the only locations in the scene at Whitecroft are Whitecroft itself and the nearby Old Elzolda's Hovel, the only other location in range. Everything is placed nice and neat where it should be.
locations.JPG
locations.JPG (22.8 KiB) Viewed 2392 times

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

Re: Exterior locations aren't cleared when traveling

Post by Uncanny_Valley »

I don't have any mods enabled, and I even downloaded a clean default build to test.

More information
  • The bug only appears if TerrainDistance is set to 4
  • It happens whenever you travel or load a locations that has fewer surrounding locations than the one you came from.
  • When it happens, there is always +1 extra unloaded locations
  • The added extra locations is properly removed once you move to another terrain piece (when the surrounding terrain updates)

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

Re: Exterior locations aren't cleared when traveling

Post by Interkarma »

Cheers! Probably max terrain distance then. I'll take a look.

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

Re: Exterior locations aren't cleared when traveling

Post by Hazelnut »

Woah UV, you have eagle eyes man!
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: Exterior locations aren't cleared when traveling

Post by Nystul »

this bug report is very valuable. Especially if we can reproduce this issue.
I am not 100% sure but I think this was the reason we disabled floating-world y-value (height) adaption since we could not nail the problem down back then. With floating-world y-adaption this issue was even more obvious because cities were often floating really high in the sky.

It would be awesome if we can track down this since y-adaption would remove all these floating-point-precision shadow issues in high-elevated locations when using distant terrain or any other mod that uses TerrainSamplers that produce high elevations

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

Re: Exterior locations aren't cleared when traveling

Post by Interkarma »

This wasn't ever related to floating Y origin. It's just location data not being cleaned up after changing world tiles. I fixed this a couple of years ago, so this is probably an off-by-one error or something with max terrain distance.

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

Re: Exterior locations aren't cleared when traveling

Post by Nystul »

Interkarma wrote: Sat May 19, 2018 11:45 am This wasn't ever related to floating Y origin. It's just location data not being cleaned up after changing world tiles. I fixed this a couple of years ago, so this is probably an off-by-one error or something with max terrain distance.
ah ok, then I did not remember correctly. What was the reason that we deacitvated floation y origin in FloatingOrigin.cs script in lines 116-120?

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

Re: Exterior locations aren't cleared when traveling

Post by Interkarma »

The main problem was correctly restoring player position on load. This sounds so simple, but the shifting Y throws in some unexpected wrinkles. I decided to tackle this again later, and just haven't gotten back to it yet.

I will eventually though. It's definitely getting done by 1.0.

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

Re: Exterior locations aren't cleared when traveling

Post by Interkarma »

I'll get to this one shortly.

Nystul, I've also reopened my work on floating y. You'll find this in a branch on git. I'm working through the various serialization/deserialization problems I encountered before and solving them one by one. Hopefully will have something ready for testing in a few more days.

Locked