Elvas Tower: Load night textures only when needed - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Load night textures only when needed New experimental feature Rate Topic: -----

#1 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,010
  • Joined: 31-December 11
  • Gender:Male
  • Country:

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.

#2 User is offline   disc 

  • Foreman Of Engines
  • Group: Private - Open Rails Developer
  • Posts: 818
  • Joined: 07-October 12
  • Gender:Male
  • Simulator:OpenRails
  • Country:

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)

#3 User is offline   conductorchris 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,345
  • Joined: 24-March 10
  • Gender:Male
  • Simulator:Open Rails - MSTS
  • Country:

Posted 02 October 2014 - 03:11 PM

Yes, thank you for your contribution.

#4 User is offline   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,491
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 02 October 2014 - 11:22 PM

View Postdisc, 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 User is offline   disc 

  • Foreman Of Engines
  • Group: Private - Open Rails Developer
  • Posts: 818
  • Joined: 07-October 12
  • Gender:Male
  • Simulator:OpenRails
  • Country:

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 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,356
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

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.

#7 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,010
  • Joined: 31-December 11
  • Gender:Male
  • Country:

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).

#8 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,356
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

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:

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 User is offline   emufarmer 

  • Apprentice
  • Group: Status: Dispatcher
  • Posts: 40
  • Joined: 22-February 08
  • Gender:Male
  • Location:Near the Beach of Coogee,Western Australia
  • Simulator:Open Rail and MSTS
  • Country:

Posted 06 November 2014 - 04:48 AM

Night textures are not required for any building or object, just read this link
My link

#10 User is offline   R H Steele 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 3,447
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

Posted 06 November 2014 - 01:00 PM

View Postemufarmer, on 06 November 2014 - 04:48 AM, said:

Night textures are not required for any building or object, just read this link
My link


The link appears difficult to use

Is this where you meant to go?

http://msts.steam4me...ight_light.html

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users