Transport Fever 2

Transport Fever 2

74 ratings
Understanding and addressing game performance
By Tsubame ⭐
This guide is meant to provide an explanation of factors that affect game performance, as well as possible ways to address shortcomings.
2
3
   
Award
Favorite
Favorited
Unfavorite
Introduction
One of the most asked questions and posted complaints in the discussions threads in the Transport Fever 2's forums has to do with performance. The usual problem is lag on late game, slowness on large developed maps, or stuttering while moving about the map.

The guide was created to help you know why that is the case, and what can be done to extend the life of your developed maps without having to start anew due to existing saves being not playable anymore.
Measuring game performance - PC and ingame statistical tools
There are several tools that can be used to measure performance.

Steam has an inbuilt FPS - frames per second - tool that can be activated in the Steam Settings > In-Game setting.

Even better would be a third-party in-depth statistical tool that displays different hardware usage statistics, such as RivaTuner. The following image shows a full array of information including each CPU thread, GPU, RAM, and page file, plus ingame FPS.

VaccumTube has created the following mod that displays extensive information about any specific maps. Of particular interest are information about population, node size - specifically rail and road network length - and building numbers. More on this in the next section.

https://steamproxy.net/sharedfiles/filedetails/?id=2454731512

A game using both RivaTuner and the Advanced Statistics mod would appear like this:

CPU-induced lag
Regions have a population number that is simulated in its entirety. That means on a 15k map, that 15k people are on the move all the time.

As the cities grow, so does population, the number of buildings they can originate or end at, and the paths available to go from one one place to another.

Cargo transported also has an impact, although to a lesser degree as it is only generated when you set up the proper cargo lines, and can only move using your own transportation lines; in contrast, people will just walk or use cars if you do not provide them with passenger lines, and in any case the number of available road paths far exceed the number of lines you will ever provide.

Eventually, the time required to do all the calculations start to be noticeable as in form of lag.

It is noting Transport Fever 2 has no hard cap on any of the parameters mentioned above, as opposed to a game like, for example, Cities Skylines.

If left unchecked, this results in continuous growth that will result in laggy performance even without any transport lines of your own.

The point where lag starts to be noticeable will depend on both map and computer specs, but 1000 km of roads and 30k people is a good guideline. The map will remain playable, but it will be slower and slower as it grows.

The first noticeable issue will be play on the fast forward speeds, which will become slower faster than the regular play; eventually there will be virtually no difference between fast forward and regular play speed. The game will remain playable in some form until 75k-150k people, depending on computer specs; eventually the game not only will be slow but will stutter as well, and be fully unplayable for the average playetr.

Of course, when a bigger road/transport network is desired, fewer people should be placed in the map, and when population is desired, fewer roads should be built.

To increase performance late-game, limiting and lowering the number of paths available for people - and cargo - to take is required. This means limiting the road network size, the number of people, and/or the number of buildings available for people to start and go to.

By default, the game displays population, jobs and shops available only as a graph, and no information on the number of buildings or road length. You can use the Advanced Statistics mod previously mentioned to have an in-depth look at these and much more.

Adressing CPU-induced lag - Population Factor mod (new to mid-game maps)
The following mod will sharply decrease population in your cities. This is best used in a new map, or a map that is not too advanced in development, as a preventative measure, rather than a fix for late game lag, due to the fact it only works in buildings created after the mod is activated ingame. For already existing highly developed maps, use the Town Tuning mod mentioned below.

https://steamproxy.net/sharedfiles/filedetails/?id=2036235984

Note that you will need to change the Settings.lua file to use the purpose. The location of the file is in:

C:\Program Files (x86)\Steam\steamapps\workshop\content\1066780

Make a backup file of the Settings.lua file, then open it.

There is a value called "Factor = 2". The ingame value is by default 1. What this value is is a multiplier of a specific buildings' maximum capacity. So the mod's default value of 2 multiplies the maximum capacity of buildings to twice of the normal value. We definitely do not want that.

Decrease the value to something under 1. A value of 0.5 will halve the maximum carrying capacity of buildings, 0.25 will lower by a quarter, and so on. A value of 0 will make every building ingame have a maximum capacity of 1.

Note that this mod will not take effect immediately once activated in your map, but only in new buildings built after the activation of the mod. It is best used right at the beginning on new maps or in new towns built using the Town Builder tool.

To speed up the process, you can use the Sandbox editor to alter the city RCI values to 50, which should remove a lot of buildings, and then alter it back to the desired value. Alternatively, demolishing buildings manually also works.
Adressing CPU-induced lag - Town Tuning mod
The Town Tuning mod can be used at any time to adjust building population values of specific cities.

https://steamproxy.net/sharedfiles/filedetails/?id=2265952996

It can be used to quickly decrease the population values of buildings inside the city, and be used both as a preventative measure in new and lightly developed maps - in lieu of the Population Factor above - and, most importantly, to quickly bring down population values of already large existing cities, on which the Population Factor is much less effective.

To change the population of the region, simply subscribe to the mod, and load the region. Click in any town, and you will notice there is a new option called "Tuning". On it, there is an option called "Person Capacity" factor, third one from the top. Click on one of the "-" settings to decrease the maximum capacities of cities in the entire region. This will take a couple of minutes to effect.

https://steamproxy.net/sharedfiles/filedetails/?id=2879318359
https://steamproxy.net/sharedfiles/filedetails/?id=2879318399

https://steamproxy.net/sharedfiles/filedetails/?id=2879318451
https://steamproxy.net/sharedfiles/filedetails/?id=2879318476

On new and lightly developed maps, the advantage of this mod over the Population Factor mod is that does not require modifying any mod files as required by the latter.

The downside is that even at the maximum decrease level, buildings may still have 2 or 3 maximum capacity, so if an even lower population is desired, the Population Factor mod at a setting of 0 should be used. The Town Tuning mod can certainly be used to bring the population down of already highly populated maps, before effecting the Population Factor mod.

It can also be used to adjust lower a town's cargo demands, which will also improve performance.
Adressing CPU-induced lag - Restrict growth of cities
A very quick and easy to implement solution is to use the No Town Development mod to fully disable city growth.

Once added, no more buildings will be created in cities, and hence, cities will stop growing in population, no matter what the city's target population says.

https://steamproxy.net/sharedfiles/filedetails/?id=2044636379

Another solution is to use Sandbox Mode, and fiddle with the cities' residential/commercial/industrial values. Once the values are dialed down, the game should automatically remove excess buildings, as per the below pictures.



Adressing CPU-induced lag - Restrict available pathways
Use the game's road tool to convert city roads to player owned. Once converted, these roads will not spawn more roads, and hence will limit sprawl and new buildings from appearing.

Similarly, convert all highways to player owned to prevent them from being converted by the game to city roads where buildings can be built.

Removing highways and roads between cities is a possibility if your focus is solely on your own transport network. This will sharply reduce the number of paths available by each person ingame to take, and increase performance. It will also curtail city growth until you connect it with other cities with your own transport lines. Note that intercity bus and truck traffic will not possible unless you setup dedicated roads for them, fully separated from the game's road network.
GPU-induced lag
The game needs to visually display multiple assets on screen. Each asset needs to be processed by the graphics card. Heavily built up areas may require hundreds, if not thousands, of assets, to be displayed at any given time. This also includes trees and other nature-related assets.



Graphics-related lag in Transport Fever 2 occurs when the game maxes out the graphic cards' memory - vRAM. Once this is used up, regular RAM and then page file memory is used instead, and things start to slow down from there.

The manifestation of this lag occurs as stuttering when moving across the map. The more assets the game has to display on screen, the more lag will be noticeable. Hence, this lag is most noticeable when zoomed out and trying to quickly move around.

Note that the assets may only be on line of sight of the monitor to start to affect performance, even if they are blocked by things like ingame topography, other assets, or fog. For this reason, this type of lag is especially pronounced when the camera view is close to ground level and looking parallel to the ground - for example, first-person view.



Resolution and other graphic-related settings that can be modified in game also have a noticeable impact, in particular, playing in 4k resolution.

Modded Transport Fever 2 on heavily built areas is one of the most intensive vRAM games available. A heavily built area zoomed out in 4k resolution and maximum graphic settings will quickly max out whatever vRAM your computer has, even 24 GB of it.

Addressing GPU-induced lag
You can use the following mod by okeating; this mod reduces the amount of stuff rendered on screen, especially the ones that are too far to be seen. The mod effects will be more noticeable when zoomed out, or low to the ground but looking towards a large area - i.e. mountain or skyscraper panoramic view, cab rides, etc.

https://steamproxy.net/sharedfiles/filedetails/?id=2850163097

On heavily built areas, avoid scrolling through the map suddenly and quickly, especially if zoomed out. Best to do this with the game on pause.

Limiting physical city size, or sprawl - as noted above - will reduce the number of buildings and assets the GPU will have to process.



Avoid placing too many trees - and other optional decorative assets - or delay it as much as possible, when much of the desired infrastructure is already built. If decoration is desired, try to place as few as possible over an area, instead of swarming it until none can be placed anymore.

Be careful with mods that affect game visuals. For example, Sunset 1.2 sharply increases terrain and asset shadows, while Increased Render Distance increases the distance the game will render assets that are in the line of sight.

If building a region to use first-person rides, only develop the areas immediately around the rails to be traveled - no point developing areas that you will not see during your train ride.

It is not ideal but reducing graphic settings like Shadows, Textures, Grass, etc. may be required, depending on your hardware and game objectives.
RAM and page file
Computers use "memory" to store things that it may be needed for immediate usage. This is done through RAM and page filing.

RAM is "quick-access" dedicated memory used by the CPU to store and access files it needs to use. Obviously, more RAM and faster RAM is better.

A page file is used to store memory on a disk drive when the amount of RAM is not enough to cover the CPU's memory requirements. It is significantly slower to load, and even more so if on a hard drive compared to a SSD, but will cover the game's memory requirements.

If your computer's RAM+page file cannot cover the game's memory requirements, the game will freeze and crash. Remember other instances like Windows services also will be using RAM+page file as well.

On a normal map with no mods, RAM will usually not be an issue.

However, it could be in large maps with lots of development, and especially if mods are used. Transport Fever 2 mods can be quite large, especially vehicle mods, which individually can be 100 MB+ in size.

If you are planning on playing very large maps and/or use lots of mods, it is recommended to set up a decent amount of page file that will cover at the very least the mods used in the game. Usually Windows will set up a page file automatically, but at times this does not work properly, and to ensure enough space is available, it is recommended to set a minimum/maximum amount manually.

This is done through right-clicking "My PC" > select "Properties" > Advanced system settings > "Advanced" tab > Under virtual memory, click in "Change". Ideally both should be the same, so that this value is fixed an unchangeable, and a value at least 1.5 times your RAM, upwards to 4x times your RAM.

Disk storage
Storage should ideally be SSD, as this will noticeably decrease loading times, up to 3x compared to a conventional hard drive.

Do not forget to leave enough space in the storage device for the page file described above to be used. This entails keeping your storage device organized, and deleting unused applications from time to time.

If your computer has both a SSD and a conventional HDD, then install the game on the SSD, even if your primary Steam installation folder is on the HDD.

On HDDs, you can use a disk optimization application like Windows Defrag to organize the data in the storage, and prioritize commonly used files.
General hardware considerations
It should go without saying, but do not have other applications open at the same time, especially if they are resource-intensive as well.

Make sure your device is well cooled. This includes keeping filters and fans clear of dust. In general, it is best to keep CPU and GPU temperatures under 70C, ideally under 60C. If your CPU or GPU overheats, it will start to throttle - that is, it will significantly reduce its performance in order to decrease temperatures. This will invariably result in performance reductions, not to mention possible hardware damage over time. Liquid cooling is a consideration for those who can afford it, as it is significantly better than air cooling.

Overclocking - increasing CPU and GPU workloads beyond their default ratings - is a possibility for those willing to fiddle a little with their own hardware. In moderation it is fairly safe, but here is an increased risk of overheating, and requires your computer to have proper cooling.

If you are thinking of upgrading hardware for the game, CPU should in general be given priority, but GPU could be worthwhile if planning on building larger cities with lots of assets with lower population, or if using first-person rides a lot.
Conclusion
Any constructive comments, additions or criticism is welcome.

Have fun playing!
15 Comments
bottle 23 Mar @ 9:59am 
Some more tips:

Game has an in built tool for viewing GPU workload. Enter debug mode then - AltGr + I (https://www.transportfever2.com/wiki/doku.php?id=modding:ingametools)

Vehicles:
- Removing modded buses and trains has a very small impact. Not worth it in my opinion. Quantity has a bigger impact than variety so keep those mods unless you've got too many in which case your ram will thank you for a bit of cleanup Marie Kondo style...
- Trains with a lot of different (modded) wagons did have a minor fps impact vs single type wagons
- Removing cars added to road traffic actually dropped frame rate by 2 - 7 fps. Not sure why: Maybe while it was converting placeholder cubes into cars?

Stations:
- One or two stations types were fps heavy but most are fine and are not in enough quantity on screen to severely impact performance
bottle 23 Mar @ 9:57am 
Great guide, really helpful! GPU was my bottleneck. Some other tips that worked for me:

General improvements:
- Reducing population: I had 86k, reducing to 60k was a big improvement. There’s plenty of tips above on how to reduce it, but here's another one: When loading a game, in the tab next to where you enable mods you can reduce town growth percentages
- No Smoke mod: https://steamproxy.net/sharedfiles/filedetails/?id=2033185194
- No animals mod - every little helps. Not worth doing unless you hate animals.

In game solutions: Focus on areas where you notice stuttering when moving camera:
- Move fps heavy models/assets out of a city to an area with no cities -> e.g. highly detailed assets (looking at you hugedragonyk) or your massive cargo depot with loads of trains.
- Bridges are resource heavy. Replace with tunnels. You can't see, you can't render
- Removing trees had low impact: Built up areas usually don't have a lot of trees
- Reduce city size (mentioned in guide)
Aegyssus 26 Jun, 2023 @ 8:13am 
Perfect Guide !

- below is not an original performance solution and maybe is quite mundane but it works.

In task manager set priority : high
and affinity : un-check cpu 0

If at times I have issues (only after long game times) then set priority : above normal.
Or restart PC and again "high" minus one cpu core.

hope is helpful.

extra:
- dust off regularly all cooling-blocks of the cpu, ram and vga. and pc in general.

- usb stick with 32 gb dedicated v-ram
graphitepaddle 18 Jun, 2023 @ 3:00pm 
Thanks for the RAPID reply Tsubame (you have really good that way, with regards to questions posted in the forum),

So it's the mods that really tax a computer for TF2 ; played with no mods, not so much.

Interesting that this game is not core-happy, the way that Distant Worlds 2 is.

Even if you base it strictly on games, setting specs for a computer system is always tricky. Spec it for your current games, and what happens in 6 months, when Transport Fever 3 , or some other must-have game comes out? (NOTE: Used ' Transport Fever 3 ' as an example. I have NO IDEA if Urban Games are even pondering the 3rd version.)
Tsubame ⭐  [author] 18 Jun, 2023 @ 2:32pm 
@graphitepaddle:

More cores would not benefit the game as it only uses a handful, may be useful if you multitask like streaming, etc. In that aspect it would not help performance too much, and be the answer to your question.

The simulation benefits a lot from faster clock speed.

For RAM and vRAM, the game may benefit from more if you play very heavily and with mods, but should have little impact in your average plathrough with no to relatively few mods - i.e. around 50 to 100. 8 GB vRAM and 32 GB RAM should be adequate for most purposes.

You may see some to significant benefit from more vRAM and/or RAM when playing on experimental maps with tons of development and mods though.
graphitepaddle 18 Jun, 2023 @ 1:24pm 
Curious where the point of diminishing returns would on a new system? (i.e. Going to the next hardware level, only improves TF2 performance marginally.)

* - CPU: More cores or faster clock speed?
* - RAM: 32G or 64G?
* - VRAM: 8G, 24G, 48G?

Agreed that installation on an SSD is the only way to go.
Jorik 6 Feb, 2023 @ 1:33pm 
TF2 has unstable lightsources and its binaries are compiled with GCC with (possible) missing dependencies. It's LICENSE file contains more information you should be able to if you know the Linux platform what dependencies you might need. Some of the LICENSE file's software are GNU software and they have dependencies you might see skipped over in "Result not Available" when pressing Alt+i.

the Sun should be fixed relative to the world. That might fix 'all the issues'. Right now if you are above water you can see the environment moves with the viewport.

*Something went wrong here ...*
Tsubame ⭐  [author] 13 Dec, 2022 @ 4:49pm 
@DesAnderes (Lime): the bulk of calculations is done in two threads, though it will hand off what it can to other threads. https://steamproxy.net/app/1066780/discussions/0/2639605881176754722/

Personally, as reference, I see a very noticeable difference between my rig with a 12900K and a 11700K, as fast-forward simulation on a specific highly developed map has yet to slow down in speed in the former, while it already slowed down, and stutters at times, on an older version of this same map.
DesAnderes 12 Dec, 2022 @ 1:46pm 
Hey, I'm planning to Upgrade my CPU. Is there some common knowledge with how many cores the game scales?
Is there still profit from a 12 core over an 8 core CPU?
Sir devee 3 Dec, 2022 @ 8:24am 
Woah this is an incredible guide. Though I can completely bear the lag even at 10fps, this really helps. Thank you!