Varying view distance

Feedback on past, current, and future development.
jermungand
Posts: 11
Joined: 08 Jun 2016, 22:45

Varying view distance

Post by jermungand » 05 May 2017, 19:53

By all means, shut me up if what I suggest has been done.

Many of us have a love/hate relationship with viewing distance in Morrowind. On the one hand, we all like sweeping panoramic views, but that being said, there are places in the game where the extended view destroys the sense (or illusion) of scale. Seeing the towers of Arkngthand from Balmora for the first time was a particularly uncomfortable example.

When I look back at the times/places where I appreciated the grand landscape vistas, as well as the times/places where I regretted how rolling back the fog had shrunk my perception of the world, I noticed a pattern: The view was much appreciated when I was standing/levitating at a relatively high altitude. The increased view distance was hated when I was in a lower altitude area (like The Bitter Coast/Isles/etc.). Think back to your own experience... it's true isn't it?

Easy idea: Code the engine such that the viewing distance and fog change gradually with altitude.

Does it make sense in terms of realism? It sort of could, on the grounds that the coasts are humid and misty while the mountains and ashlands of the interior are much drier.

User avatar
Pherim
Posts: 140
Joined: 27 Aug 2014, 15:37

Re: Varying view distance

Post by Pherim » 05 May 2017, 22:17

I must, say, this is an interesting idea, even though I never felt this way in terms of the view distance when being on the ground. I have no idea if it can be done, though.

User avatar
Zobator
Posts: 62
Joined: 23 Nov 2014, 19:35

Re: Varying view distance

Post by Zobator » 06 May 2017, 07:20

well have I ever... You're goddamn right. Never made the link between altitude and preferred view distance. It also just makes sense. Where do you go when you want to have a better field of view? Up.

EvilEye
Posts: 10
Joined: 12 Feb 2014, 13:45

Re: Varying view distance

Post by EvilEye » 06 May 2017, 07:58

I actually suggested this to Peachykeen ~7 years ago when he was working on shaders/MGE/something.

All you really need to implement it is a GetViewDistance and a SetViewDistance:

Code: Select all

Begin EE_DistantLandDistanceCalculator

float d
float zpos
;global EE_ViewDistance

if ( GetInterior == 1 )
	Return
endif

if ( player->GetPos Z != zpos )
	set zpos to ( player->GetPos Z )
	if ( player->GetPos Z > 0 )
		set d to ( player->GetPos Z )
		set d to ( 13 * ( d / 75 ) )
		set d to ( GetSquareRoot d )
		set d to ( d / 0.109 )
	else
		set d to 1
	endif
endif

if ( EE_ViewDistance < d )
	if ( EE_ViewDistance != 0 )
		Return
	endif
endif
xif ( xGetViewDistance != d )
	xSetViewDistance to d
endif

end

Code: Select all

Begin EE_DL_config

short state
short button

if ( state == 0 )
	MessageBox "Do you want to set the view distance to a specific number of cells?" "Yes" "No"
	set state to 1
endif

if ( state == 1 )
	set button to GetButtonPressed
	if ( button == 0 )
		set state to 2
	elseif ( button == 1 )
		set state to 0
		StopScript EE_DL_config
		Return
	endif
endif

if ( state == 2 )
	if ( EE_ViewDistance != 0 )
		MessageBox "Max. view distance is now %G cells." EE_ViewDistance "Reset" "Back" "Add digit"
		set state to 3
	else
		MessageBox "Max. view distance is now infinity." "Define cell number" "Back"
		set state to 4
	endif
endif

if ( state == 3 )
	set button to GetButtonPressed
	if ( button == 0 )
		set EE_ViewDistance to 0
		set state to 2
		return
	elseif ( button == 1 )
		set state to 0
		Return
	elseif ( button == 2 )
		set state to 5
	endif
endif

if ( state == 4 )
	set button to GetButtonPressed
	if ( button == 0 )
		set state to 5
	elseif ( button == 1 )
		set state to 0
		Return
	endif
endif

if ( state == 5 )
	MessageBox "Choose a digit." "0" "1" "2" "3" "4" "More" "Back"
	set state to 6
endif

if ( state == 6 )
	set button to GetButtonPressed
	if ( button == 0 )
		set EE_ViewDistance to ( EE_ViewDistance * 10 )
		set state to 2
	elseif ( button == 1 )
		set EE_ViewDistance to ( ( EE_ViewDistance * 10 ) + 1 )
		set state to 2
	elseif ( button == 2 )
		set EE_ViewDistance to ( ( EE_ViewDistance * 10 ) + 2 )
		set state to 2
	elseif ( button == 3 )
		set EE_ViewDistance to ( ( EE_ViewDistance * 10 ) + 3 )
		set state to 2
	elseif ( button == 4 )
		set EE_ViewDistance to ( ( EE_ViewDistance * 10 ) + 4 )
		set state to 2
	elseif ( button == 5 )
		MessageBox "Choose a digit." "5" "6" "7" "8" "9" "More" "Back"
		set state to 7
	elseif ( button == 6 )
		set state to 2
		Return
	endif
endif

if ( state == 7 )
	set button to GetButtonPressed
	if ( button == 0 )
		set EE_ViewDistance to ( ( EE_ViewDistance * 10 ) + 5 )
		set state to 2
	elseif ( button == 1 )
		set EE_ViewDistance to ( ( EE_ViewDistance * 10 ) + 6 )
		set state to 2
	elseif ( button == 2 )
		set EE_ViewDistance to ( ( EE_ViewDistance * 10 ) + 7 )
		set state to 2
	elseif ( button == 3 )
		set EE_ViewDistance to ( ( EE_ViewDistance * 10 ) + 8 )
		set state to 2
	elseif ( button == 4 )
		set EE_ViewDistance to ( ( EE_ViewDistance * 10 ) + 9 )
		set state to 2
	elseif ( button == 5 )
		set state to 5
		Return
	elseif ( button == 6 )
		set state to 2
		Return
	endif
endif

end
These scripts have been sitting on my hard drive for ages (looking at the last modified date).

Lamoot
Posts: 79
Joined: 22 Apr 2016, 12:03

Re: Varying view distance

Post by Lamoot » 06 May 2017, 10:48

https://gataplex.files.wordpress.com/20 ... own_st.gif

This could actually work really really well, would love to see it in action.

CaptainCosmotic
Posts: 7
Joined: 22 Jan 2017, 18:40

Re: Varying view distance

Post by CaptainCosmotic » 06 May 2017, 11:03

I would like this too.
Maybe you can make it some optional feature.

ezze
Posts: 428
Joined: 21 Nov 2013, 13:20

Re: Varying view distance

Post by ezze » 06 May 2017, 17:13

It is possible to change the view distance now? If it is possible to change it dynamically it should be really easy to implement and probably works very well (as the EvilEye code shows). I am not sure about the "realism," but if it helps to keep the sense of scale and deepness it would be great.

User avatar
Jyby
Posts: 408
Joined: 10 Dec 2013, 04:16

Re: Varying view distance

Post by Jyby » 07 May 2017, 03:14

I think you'd certainly connect this with weather, and wrap the whole feature under the term atmospheric adjusted distant land. If you haven't beaten the game the blight around Red Mountain should never clear up. Nor should you escape rain at usual levitating heights, thus your weather setting should occlude your view distance.
Macbook Air 2013 - 1.7GHz Intel i7 - 8 GB - 512 GB SSD - Intel HD 5000
Windows 10 PC - 4GHz Intel i7 - 16 GB - 512 GB SSD - EVGA GTX 1060 SSC

EvilEye
Posts: 10
Joined: 12 Feb 2014, 13:45

Re: Varying view distance

Post by EvilEye » 07 May 2017, 09:49

Jyby wrote:thus your weather setting should occlude your view distance.
Very true.

Luckily, GetCurrentWeather already exists :D


Edit Found a file explaining the numbers:

Code: Select all

((sqrt(1.5*h/8192*385))*5280/385)/s=c
h = player's Z-pos in Morrowind's units.
s = scale, because rendering a couple hundred cells is a pain and Vvardenfell is bigger in lore anyway. (30 like timescale global and lore to game)
c = number of cells that should be rendered.

magamo
Posts: 106
Joined: 28 May 2016, 17:28

Re: Varying view distance

Post by magamo » 07 May 2017, 22:53

It's worth pointing out that Visvaldis's height based fog patch already does this, by implementing a heavier fog at lower altitudes. Standing higher up, say on the slopes of red mountain, lets you see very much further than when you're down in the thick of it.

Post Reply