1. Rolling Line
  2. News
  3. Major Optimizations! v4.0

Major Optimizations! v4.0



A common problem indie games run into is that they get more and more bloated and unoptimized as updates get added. Seeing developers get roasted for not spending time on optimization and "Cleaning up the game code" is a tale as old as time.

Well that's exactly what this update is all about!
Rolling Line is over 3 years old now, and has had 126 total updates so far, so It's fair to say that the core structure of the game has gotten pretty messy over time.

So over the last few months I've been putting time towards finally re-organising and cleaning up the code of the game!

This pretty much sums it up:



The end result is a much, much more stable game and significantly faster loading times.

Specifically, the startup time between launching the game and getting to the main menu is up to 4x-5x faster!
In fact the game can launch in about 3 seconds with a fresh install (no mods) on a decent PC.



The process of loading mods is now much faster too, and the game now stays responsive while loading! (instead of freezing).
Before this update the game would just freeze and hang unresponsive till the loading was all done, but now it will remain responsive during the load process, and show progress.

This means the load screen will actually tell you exactly what it's loading.
e.g.
"loading save files 1/20"
"finding mods 6/542"
"loading skybox 89%"



[h3]Please keep in mind that this ONLY AFFECTS STARTUP! [/h3]
The process of loading save files has not changed and will not be much different than it was before.
Although it will still be a little bit faster thanks to the improved loading times for mods.

I am planning to do an update in the near future which entirely focuses on the way the game loads maps, which will involve some similar optimizations for that too!

[h2]This update also vastly improves RAM usage[/h2]

Launching to the main menu has gone from using around 3.5GB of ram down to 1.5GB in some tests, and the amount of RAM used by having lots of mods and save files is greatly reduced.



[h2]Organising the games structure [/h2]

This update is focused on more than just speeding up load times.
I've actually made massive changes to the core structure of how the games programming is organized and structured. While this isn't something you'll see on the surface, it's something that makes a MASSIVE difference to how hard it is to track down bugs and issues. It also helps immensely for future updates.

And knowing that the game's code isn't a jungle of chaos anymore helps me sleep at night.
ːwinter2019happyyulː

As an example of what I mean by "Cleaning up the game's structure", here is what the Unity scene hierarchy looks like both before and after this update.
In fact RL actually now launches from an empty scene, and all of this data shown is set up through code!



Overall this update has far too many background changes to list, but here are a few things that you will actually see as the player:
  • Easter egg scenes are now loaded differently, and exiting a scene and returning to the game is much faster (the game is no longer reset).
  • The "resume" option for loading a save now works much better at selecting the right save. e.g. loading workshop saves or backups will not mess it up.
  • The wheels in photo mode will no longer show up in low detail.
  • Backups over a month old are now automatically deleted when the backup folder gets too large.
  • The mountain props now no longer snap to the surface angle (so they face upright by default).
  • Trains that were placed on the old legacy "Top of the south" layout are no longer loaded in save files.
  • The "Dark mode" setting is removed, and dark mode is now the only loading screen style.
  • The debug option to show "paint colors in file" has been removed, as this has long since been unused and broken.
  • Fixed a glitch where the tutorial menu would bounce around if the train was derailed during the tutorial.
  • Added a launch tag "-iwanttobelieve" which makes the UFO easter egg show up 100% of the time, just for fun.


And that's the bulk of it!
This update has been a massive undertaking, and It's something I've been worried about and putting off for years.
But it feels so good to finally take the time and clean up this behemoth of a game.

I recently figured out that September 10th, 2017 is the closest thing to Rolling Lines birthday as there is, since that was the day I first started officially working on developing it. And that means that some of the code in the game is almost 4 years old!

After 4 years of development and updates, it's no wonder it got so messy.
Rolling Line has grown into a larger game than I ever could have imagined!

This has been a pretty exhausting last couple of months, so now that this is all wrapped up, I think it's time for a nice and relaxing layout competition for the next update!
So keep an eye out for that ːsteamhappyː