Skyrim Astronomy Sun position skse plugin bugs

fixing bugs
  • Author
  • Message
Offline
Posts: 11
Joined: 28 Aug 2017, 20:14

Skyrim Astronomy Sun position skse plugin bugs

Hi,

I'm working on an skse plugin version of the Daylight Hours astronomy mod for Skyrim (http://www.nexusmods.com/skyrim/mods/71319). This mod uses real-world calculations to find the correct dawn/dusk times and the position of the sun. The update converts the plugin to an skse dll in order to dynamically update the sun position in game. And it adds additional features such as moon light percent depending on moon phase, moon shadows in the correct position, and making the stars rotate around the north pole instead of above the player.

It's getting pretty close to release but unfortunately, there are some bugs when using an enb. But I was able to fix the bright sky at night bug by switching back to vanilla sun position at night. I also created an enb dllplugin to update the enb dawn/dusk times to the correct time calculated by this mod.

But there is still a bug where the enb sun effects/sunrays do not work during the day.

So I was wondering, now that it's an skse plugin, if the sunray bug is something that I could fix. Is there something I could do to make this mod compatible with enb? If it helps, I can access the sun NiNode or NiDirectionalLight, as well as all the sun/moon/sky c++ classes from the skse source code. Otherwise, would it be possible to create an enb dllplugin to update enb with the correct sun position to draw the sunrays?

Thanks,
LogicDragon

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17427
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: Skyrim Astronomy Sun position skse plugin bugs

Im not at home and will not be soon, so cant check sources. But as i remember, sun path on sky used as time of the day detection when no enbhelper.dll installed. Sun and moons have certain properties when rendered and i use them to detect which sky object it is. If remember, its at least distance to camera. If you change sky hemisphere, it also lead to incompatibility bugs.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
Posts: 11
Joined: 28 Aug 2017, 20:14

Re: Skyrim Astronomy Sun position skse plugin bugs

Ok, thanks for the reply.

Offline
Posts: 11
Joined: 28 Aug 2017, 20:14

Re: Skyrim Astronomy Sun position skse plugin bugs

Hi, how is it going? I just wanted ask if you had time to look into my request yet?

I think enb is detecting the sun object using the y-offset from the camera (the offset is set to the fSunYExtreme game setting, default 40). If that is the case then would it be possible to add the ability to change the value the enb is using in an enb dllplugin? Thanks.

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17427
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: Skyrim Astronomy Sun position skse plugin bugs

Hi. Sorry, i forgot about this already, so checking just at this moment.
Distance between sun and camera is detector of it (otherwise it's moon). I don't remember this code, but definetly 40 have something to do about it:

Code: Select all

if ((temp1._42 > 39.98f) && (temp1._42 < 40.02f))
{
	issun=TRUE;
} else
{
	issun=FALSE;
}
Then, if helper pluging not used to read game time, i get angle of sun to horizon and from table retrive time of the day. But i can't understand now how angle calculated, in world space (so if sun is not in zenith in northen areas of planet, then angle is lower) or after rotating sun in it's own space. I guess you can try to keep sun at same distance and check how time of the day in statistics of my mod works, if time close enough to real game time (enbhelper.dll must not be installed for such test).
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
Posts: 11
Joined: 28 Aug 2017, 20:14

Re: Skyrim Astronomy Sun position skse plugin bugs

So if I read this correctly, you are using a table to retrieve time of day depending on angle of sun to horizon. But if the maximum sun angle is lower then it can't retrieve the time of day correctly. And this causes some issues with the enb.

Is this the reason the sun rays do not work? Do sun rays depend on the time of day? If it does not depend on time of day, would it be possible to add a compatibility setting to set the camera offset from the sun in order to get sun rays to work?

Maybe the sun angle could be calculated using only the x and z position (and ignore y)? Even if the z value is not at maximum when x is zero, it should still work. This could also support mods that change the sun position in Skyrim SE.

Thank you for your time.

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17427
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: Skyrim Astronomy Sun position skse plugin bugs

I will never support mods which modify sun direction, because then it's impossible to detect time of the day precisely enough and without reading game time from process (game still patching, damn bethesda). But sun rays have only dependency from sun distance to camera, if it is not same as in vanilla game, then sun not detected, so no rays.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
Posts: 11
Joined: 28 Aug 2017, 20:14

Re: Skyrim Astronomy Sun position skse plugin bugs

Just to be clear, my mod is for the original Skyrim, not Skyrim SE. I just thought you could also implement it for Skyrim SE to add compatibility with mods that change sun position.

So sun position only depends on distance to camera, will you add a setting to the original Skyrim enb to set the sun position? Thanks.

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17427
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: Skyrim Astronomy Sun position skse plugin bugs

If i'll do such setting, users will bother me much because they share their own configs in presets. The only thing i can do is to read config of your mod, so users will never know about this file and not try to put them in public. But anyway, why to do that? Sun position from camera have no impact on anything which user see, why you can't keep it on same place and modify just direction?
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
Posts: 11
Joined: 28 Aug 2017, 20:14

Re: Skyrim Astronomy Sun position skse plugin bugs

It does not need to be a setting in a config file. I just need some way to access the setting in an enb dllplugin so it does not need to be visible to the other users. It needs to be in an enb dllplugin because my mod updates the sun y position in every frame.

I think there is some confusion, because changing the sun position does move the sun in game? A similar bug occurs when changing the fSunYExtreme game setting. But my mod changes the y position every frame. If you can get sun rays to work on a modified fSunYExtreme setting in an enb dllplugin then it should work for my mod as well.
Post Reply