Major optimizations: loading and RAM! v5.32
[p]
[/p][p][/p][p]It might not be very glamorous or exciting, but optimization is a REALLY important part of game development and it's great to spend some time making improvements every now and then. [/p][p]This update is entirely focused on optimization, specifically around RAM (memory) usage and speeding up the map loading process! [/p][p][/p][p]These changes especially improve loading large maps with a lot of track, and when testing some famously large maps (like Beaumont, Nevada Arizona & Utah, Continental United Sates V2, Thunder Mountain Line) the improvements have been amazing:[/p][p]Nevada Arizona & Utah:[/p][p]RAM usage: 3.4gb -> 1.6gb of (52% reduction)
Load time: 15 seconds -> 10 seconds (33% reduction)[/p][p]Beaumont:[/p][p]RAM usage: 7.3gb -> 3.4gb (53% reduction)
Load time: 57 seconds -> 41 seconds (28% reduction)[/p][p]Continental United Sates V2:[/p][p]RAM usage: 4.2gb -> 2.5gb (40% reduction)
Load time: 41 seconds -> 20 seconds (51% reduction)[/p][p]Thunder Mountain Line:[/p][p]RAM usage: 5.3gb -> 3.4gb (35% reduction)
Load time: 45 seconds -> 31 seconds (31% reduction)[/p][p][/p][h3]That's a massive 45% average reduction in RAM usage and 35% average reduction in load times! [/h3][p][/p][p]These optimizations come from two main places:[/p]
[/p][p][/p][p][/p][h3]And thank you to all my Patreon supporters![/h3][p]
GaugeGang: SmokeStream[/p][p]Rolling Line enjoyers: Helga Nordgren[/p][p]Model railroaders: Lutz, Jayton Hawkins, TheAmazingRyry, CAMOGUY54321, Jonathan Ginsburg[/p][p]Railfans: TrainTiny, Thomas Merolla, Don Willis, Leto Gloas, Outertoaster, Nathan Perez, TrainMann, Railraider, Garst, Richard Prior, Joblogh, Detroit_, Ben Burch, Gustavo Sanchez, Michelle chan, Jack Fruh, Lynk_Wyland, KathalLasagna[/p][p][/p][p]You can join the Patreon to help support me to keep making free updates![/p][p]
[/p][p][/p][p][/p]
Load time: 15 seconds -> 10 seconds (33% reduction)[/p][p]Beaumont:[/p][p]RAM usage: 7.3gb -> 3.4gb (53% reduction)
Load time: 57 seconds -> 41 seconds (28% reduction)[/p][p]Continental United Sates V2:[/p][p]RAM usage: 4.2gb -> 2.5gb (40% reduction)
Load time: 41 seconds -> 20 seconds (51% reduction)[/p][p]Thunder Mountain Line:[/p][p]RAM usage: 5.3gb -> 3.4gb (35% reduction)
Load time: 45 seconds -> 31 seconds (31% reduction)[/p][p][/p][h3]That's a massive 45% average reduction in RAM usage and 35% average reduction in load times! [/h3][p][/p][p]These optimizations come from two main places:[/p]
- [p]Changes to how track is loaded. Only the bare minimum track data is loaded when opening a map (just waypoint position data for the trains to use) and no visual meshes or textures are loaded. Instead the visuals for track are dynamically loaded as you move around the map in the same way props are. Basically track can now exist in either a "partially loaded" or "fully loaded" state. [/p]
- [p]Changes to how mesh data is stored and managed. I've done a huge deep-dive on where mesh data is being duplicated and improperly handled, and I found several great optimizations where mesh data could be reduced. This kind of "unnecessary mesh duplication" bloat builds up in the background and can be hard to spot, so tracking this down and improving it makes a big difference on large maps. [/p]
- [p]Improved RAM management for loading screen custom images[/p]
- [p]Loading screen images can now have any aspect ratio and will correctly scale to fit any sized screen[/p]
- [p]Fixed flickering/flashing when loading in distant chunks while moving around the map [/p]
- [p]Improved map startup loading in several ways[/p]
- [p]Fixed bug where people using the old inventory selection system would experience issues when saving the game from the menu[/p]
- [p]The item held in your hand is now correctly re-equipped when exiting a 2D menu[/p]
- [p]Added new loading screen step for "reading save data file" when loading very large save text files[/p]
GaugeGang: SmokeStream[/p][p]Rolling Line enjoyers: Helga Nordgren[/p][p]Model railroaders: Lutz, Jayton Hawkins, TheAmazingRyry, CAMOGUY54321, Jonathan Ginsburg[/p][p]Railfans: TrainTiny, Thomas Merolla, Don Willis, Leto Gloas, Outertoaster, Nathan Perez, TrainMann, Railraider, Garst, Richard Prior, Joblogh, Detroit_, Ben Burch, Gustavo Sanchez, Michelle chan, Jack Fruh, Lynk_Wyland, KathalLasagna[/p][p][/p][p]You can join the Patreon to help support me to keep making free updates![/p][p]