Page 1 of 2

Varying view distance

Posted: 05 May 2017, 19:53
by jermungand
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.

Re: Varying view distance

Posted: 05 May 2017, 22:17
by Pherim
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.

Re: Varying view distance

Posted: 06 May 2017, 07:20
by Zobator
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.

Re: Varying view distance

Posted: 06 May 2017, 07:58
by EvilEye
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).

Re: Varying view distance

Posted: 06 May 2017, 10:48
by Lamoot
https://gataplex.files.wordpress.com/20 ... own_st.gif

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

Re: Varying view distance

Posted: 06 May 2017, 11:03
by CaptainCosmotic
I would like this too.
Maybe you can make it some optional feature.

Re: Varying view distance

Posted: 06 May 2017, 17:13
by ezze
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.

Re: Varying view distance

Posted: 07 May 2017, 03:14
by Jyby
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.

Re: Varying view distance

Posted: 07 May 2017, 09:49
by EvilEye
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.

Re: Varying view distance

Posted: 07 May 2017, 22:53
by magamo
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.