Load night textures only when needed New experimental feature
#1
Posted 02 October 2014 - 12:02 PM
This was something I desired (also for myself) since long time.
In release 2551 I have added an experimental option that loads night textures only when needed. This means that any scenery object is loaded from first morning hours till to late afternoon (sun position is taken into account) is loaded without its night texture. If the player is still playing some time before sun disappears, the missing night textures are loaded, so they are ready when needed. Day textures remain loaded.
For the many activities and explore routes that are fully run at daytime, this is a net improvement, especially for people with 32 bit Windows computers and for heavy routes. The memory gain can exceed 100 MB.
Loading night textures before sun disappears does not slow down very much the computer. However after that moment both day and night textures are present in memory, so the memory gain disappears. However a better strategy would be to load the night textures in groups, to activate them and to unload the related day textures. So the memory usage would be quite the same also after swap. But this is more complicated and I don't know if I will go in this direction.
Loading the pack of night textures before sunset in heavy routes can lead to memory overflows in computers with few memory (the same would happen also at daytime without this option). I noticed some memory overflows that affected also program execution, but I didn't get real crashes except when using the Debug section of the F5 HUD. To be tried.
In release 2551 I have added an experimental option that loads night textures only when needed. This means that any scenery object is loaded from first morning hours till to late afternoon (sun position is taken into account) is loaded without its night texture. If the player is still playing some time before sun disappears, the missing night textures are loaded, so they are ready when needed. Day textures remain loaded.
For the many activities and explore routes that are fully run at daytime, this is a net improvement, especially for people with 32 bit Windows computers and for heavy routes. The memory gain can exceed 100 MB.
Loading night textures before sun disappears does not slow down very much the computer. However after that moment both day and night textures are present in memory, so the memory gain disappears. However a better strategy would be to load the night textures in groups, to activate them and to unload the related day textures. So the memory usage would be quite the same also after swap. But this is more complicated and I don't know if I will go in this direction.
Loading the pack of night textures before sunset in heavy routes can lead to memory overflows in computers with few memory (the same would happen also at daytime without this option). I noticed some memory overflows that affected also program execution, but I didn't get real crashes except when using the Debug section of the F5 HUD. To be tried.
#2
Posted 02 October 2014 - 02:06 PM
This is a useful feature. Perhaps you can do the same with the seasonal textures (as i remember currently all summer textures are loaded, on non-summer season even if there is winter/spring/autumn alternatives for that texture)
#4
Posted 02 October 2014 - 11:22 PM
disc, on 02 October 2014 - 02:06 PM, said:
This is a useful feature. Perhaps you can do the same with the seasonal textures (as i remember currently all summer textures are loaded, on non-summer season even if there is winter/spring/autumn alternatives for that texture)
I don't believe that's the case - AFAIK we only load the appropriate season/weather textures - but if you can demonstrate otherwise we'll have to fix it.
#5
Posted 03 October 2014 - 02:49 AM
Don't know, i just see 100-300 mbytes more memory usage at winter on same route same path same activity.
#6
Posted 03 October 2014 - 09:05 AM
For some years now I've asked for a feature to be added to the .sd file that would specify when to turn on and turn off night textures (the specified time of day has to be hours plus minutes relative to sunset to handle the differences from seasonality). Adding a randomizer of some few minutes could be useful in adding a bit more variety. The specific time would be calculated on initial load and a periodic check to compare those values against the game clock is all that's necessary to switch them on and off again.
Long term such information could transfer from the .sd file to the .w file entries where they could be editable in the same way as ESD_Display_Level.
Long term such information could transfer from the .sd file to the .w file entries where they could be editable in the same way as ESD_Display_Level.
#7
Posted 04 October 2014 - 07:02 AM
With release 2559 improvements have been inserted. Attempt of loading of night textures before sunset is now conditioned to the fact that some memory is free (to avoid a bunch of out of memory exceptions). If no memory space is there, a new attempt is made as soon as the tile composition changes.
I also added a sort of pseudo-random time for switch from day texture to night texture at sunset. So not all shapes switch from day to night at the same moment. This is simpler for users and of immediate use than inserting a parameter in the .sd file (that is anyhow a possible option).
I also added a sort of pseudo-random time for switch from day texture to night texture at sunset. So not all shapes switch from day to night at the same moment. This is simpler for users and of immediate use than inserting a parameter in the .sd file (that is anyhow a possible option).
#8
Posted 04 October 2014 - 08:28 AM
Yes, it is easier I suppose but there is a bigger issue here too.
IMO there are great opportunities available in the .sd file -- what I think of as the Shape Description file. OR could use that file to record all sorts of things about the shape that cannot be recorded within the mesh file. For static shapes there is no other file that can be used for this purpose (KUJU had so much data that couldn't go into the mesh file for locomotives and cars they went right past the .sd and created specific shape description files called .eng and .wag).
And so IMO the time of day to turn on & off night textures is just one example. It seems perfectly reasonable to me that the .sd file could also be used to substitute texture file names:
It might not be used too often of static shapes but for .wags and .engs I think it would really make a big difference for reskinners.
The same data format could be use on change as LOD distances too (there a lot of models out there w/ poorly defined LOD distance values).
Using night textures to set things up to expand the purpose of the .sd file is a good opportunity to get this started.
IMO there are great opportunities available in the .sd file -- what I think of as the Shape Description file. OR could use that file to record all sorts of things about the shape that cannot be recorded within the mesh file. For static shapes there is no other file that can be used for this purpose (KUJU had so much data that couldn't go into the mesh file for locomotives and cars they went right past the .sd and created specific shape description files called .eng and .wag).
And so IMO the time of day to turn on & off night textures is just one example. It seems perfectly reasonable to me that the .sd file could also be used to substitute texture file names:
TextureReplacement ( Texture ( OriginalTexture ( xyz.ace ) ReplacementTexture (abc.ace) ) Texture ( OriginalTexture ( 123.ace ) ReplacementTexture (789.ace) ) )
It might not be used too often of static shapes but for .wags and .engs I think it would really make a big difference for reskinners.
The same data format could be use on change as LOD distances too (there a lot of models out there w/ poorly defined LOD distance values).
Using night textures to set things up to expand the purpose of the .sd file is a good opportunity to get this started.
#9
Posted 06 November 2014 - 04:48 AM
#10
Posted 06 November 2014 - 01:00 PM
emufarmer, on 06 November 2014 - 04:48 AM, said:
The link appears difficult to use
Is this where you meant to go?
http://msts.steam4me...ight_light.html