[REQ] Could someone make this script?

Post » Thu Jun 21, 2012 12:36 pm

I know nothing about scripts, and such... but I think this could be a great idea and useful to a lot of people.
Many people have Z-fighting issues with flickering mountains in Skyrim.
One of the ways to reduce this is to put fNearDistance=25.0000 (default value is 15.0000) in Skyrim.ini under the [Display] section. This reduces the flicker by quite a lot (like 30-35 %), but it also causes clipping issues when you look extremely close to objects. The reason is becasue, I think, increasing the fNearDistance value moves the near clipping plane further away.
So the higher the number, the less the flicker, but also the more clipping-issues when really close to objects.

Request: A workaround for this could be to add a script that automatically changes fNearDistance to 15.0000 (which is the default value) when you're in interiors, because then it's much more likely that the player are right next to walls & objects and looking straight in them. In interiors we also don't need to have a higher fNearDistance number, because there is no flicker to reduce since you obviously can't see the mountains from interiors. The script would then automatically change the value back to a preferred one (the one you have added yourself in Skyrim.ini) when you're in exteriors.

So... all in all the script is attached to the fNearDistance .ini setting and automatically changes it. It needs to detect if the player is in interiors or exteriors. The script also needs to remember what value you originally have added in the Skyrim.ini yourself; if this is not possible, then the script could add its own .ini where you can place your preferred fNearDistance value when you're in exteriors.

Could someone make this script? I, and I'm sure many other people, would appreciate it a lot!
User avatar
Ebou Suso
 
Posts: 3604
Joined: Thu May 03, 2007 5:28 am

Post » Thu Jun 21, 2012 4:56 am

With Papyrus, we can get Game Settings and set INI settings, but we can't set Game settings or get INI settings, so there would need to be some way to accommodate for different INI settings.

Something like...
ScriptName NearDistancePlayerAliasScript extends ReferenceAliasBool bInsideFloat fInsideDistance = 15.0Float fOutsideDistance = 25.0Event OnLocationChange()	If bInside != GetReference().IsInInterior()		bInside = !bInside		If bInside			Utility.SetINIFloat("fNearDistance:Display", fInsideDistance)		Else			Utility.SetINIFloat("fNearDistance:Display", fOutsideDistance)		EndIf	EndIfEndEvent
...should work, with a one time menu to select the desired outside distance value.

One sec and I'll link a pack to try.
User avatar
Hella Beast
 
Posts: 3434
Joined: Mon Jul 16, 2007 2:50 am

Post » Thu Jun 21, 2012 2:17 pm

With Papyrus, we can get Game Settings and set INI settings, but we can't set Game settings or get INI settings, so there would need to be some way to accommodate for different INI settings.

Something like...
ScriptName NearDistancePlayerAliasScript extends ReferenceAliasBool bInsideFloat fInsideDistance = 15.0Float fOutsideDistance = 25.0Event OnLocationChanged()	If bInside != GetReference().IsInInterior()		bInside = !bInside		If bInside			Utility.SetINIFloat("fNearDistance:Display", fInsideDistance)		Else			Utility.SetINIFloat("fNearDistance:Display", fOutsideDistance)		EndIf	EndIfEndEvent
...should work, with a one time menu to select the desired outside distance value.

One sec and I'll link a pack to try.
Thanks a TON for wanting to help :D!
I'll try immediately when you link! It should be quite easy to test because you could set a crazy high exterior fNearDistance value and then go to an exterior space and move close to objects and see if it clips, and then move in an interior space and see if it doesn't clip.
User avatar
Luna Lovegood
 
Posts: 3325
Joined: Thu Sep 14, 2006 6:45 pm

Post » Thu Jun 21, 2012 4:54 am

No prob :) What, would you say, should the allowed max and min values for the setting be?

Min 15, Max 25: http://www.mediafire.com/?8ohgydfa0fvlbcq
User avatar
Sammygirl
 
Posts: 3378
Joined: Fri Jun 16, 2006 6:15 pm

Post » Thu Jun 21, 2012 3:32 am

No prob :smile: What, would you say, should the allowed max and min values for the setting be?
Min value (which is relevant in interiors) should be 15.0000. The max value would be 15.0000 because the player isn't supposed to change this at all. This is the default value and causes no clipping side-effects.

The max value (which is relevant in exteriors) should be 25.0000. The min value in exterior should of course also be 15.0000.

So in short: Interiors should have a value of 15.0000 at all times. For exteriors the player should be able to choose what he/she prefers between 15.0000 and 25.0000.

Value 25.0000 causes some clipping when you look straight into a rock wall when you're extremely close to it. Some people don't even like that (and the problem gets worse if you have a high FOV setting), so they would want to be able to change the fNearDistance value themselves to lower numbers. That's why I think it's good to have an option for people to be able to change their preferred exterior value.
All in all it's about a balance of issues. You have the Z-fighting flickering on one side, and you have the near clipping side-effect on the other side. I think 25.0000 is a good max value. No one would want any higher I think.
User avatar
Robert Devlin
 
Posts: 3521
Joined: Mon Jul 23, 2007 2:19 pm

Post » Thu Jun 21, 2012 6:55 am

Edited above linked setup with 25 as the max.

*goes back to sleep*

Hopefully it'll work as intended. I'll check in after some spatchka.
User avatar
jadie kell
 
Posts: 3497
Joined: Sat Jul 29, 2006 3:54 pm

Post » Thu Jun 21, 2012 9:43 am

Thanks A LOT!! :foodndrink:
I tested it and it worked in some ways but not in other ways. Here's what I found out:

- Before I installed the test you uploaded, I saved two new saves. One in exterior and one in interior. When I installed your test, it worked properly when I loaded the save game I last had saved while being in interior space. However, when I loaded the save game I last had saved while being in exterior space, and then moved to an interior space to test the difference, I still got clipping. The pop-up menu script started in both saves though so that worked at all times.

So, in other words, it seemed that I had to load a game where I was in an interior space for the script to work to force the interior value to 15.0000. It didn't work (it wasn't forced to 15.0000 in interiors) when I loaded a game where I was in exterior space, and then travelled to an interior space in the game.

- Also I wonder if it's possible to make it so you change 1.0 point at a time. When I changed the outside values in game through the pop-up menu, it changed 5.0 points at a time.
- And one last thing, I couldn't find a way to change back the settings once the menu had poped up and I had clicked done. Is there any way the pop-up menu could be attached to a spell or an item or something that you are given, so you can change the outside settings several times (for instance if you regret putting the setting to a certain number)?
User avatar
Chantel Hopkin
 
Posts: 3533
Joined: Sun Dec 03, 2006 9:41 am

Post » Thu Jun 21, 2012 7:11 pm

I tested some more, here's what I found out:

- The forced interior to 15.0000 worked when I loaded the save game in exterior and when I through the pop-up menu changed the outside/exterior value to 15.0000 as well.
- The forced interior to 15.0000 did not work when I loaded the save game in exterior and when I through the pop-up menu did nothing and clicked done (in other words left the outside/exterior value at 25.0000).
User avatar
CArlos BArrera
 
Posts: 3470
Joined: Wed Nov 21, 2007 3:26 am


Return to V - Skyrim