Multiplayer tips

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
yorkie
Transport Coordinator
Transport Coordinator
Posts: 354
Joined: 11 Oct 2004 00:38

Multiplayer tips

Post by yorkie »

A group of us tried a multiplayer game but after a while it became slow.

Does anyone know how much of an effect each factor has on the game, for a example:
- should maps be kept to a reasonably small size (how large can we get away with?)
- should we limit the number of concurrent connections?
- should we be more selective in which NewGRFs to use?
- is the problem more likely to be down to having a high number of vehicles in the game?
- should we avoid having large station catchment areas or train lengths? I understand these can make a difference, butninwoildnt have thought they would make much difference?

Is the issue more likely to be processing power from the host, or the clients? Or is bandwidth more of an issue?

Many thanks.
User avatar
jfs
Tycoon
Tycoon
Posts: 1757
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Multiplayer tips

Post by jfs »

Large maps absolutely make a huge difference. I recommend no larger than 1024x1024, or equivalent like 2048x512 or 4096x256.
There are many things in the game that need to run on every tile of the map every so often, and since a 4096x4096 map has 16 times as many tiles as a 1024x1024 map, the processing time for every simulation tick will also be 16 times longer.

Number of connections/players in the game has little effect, as far as I know, other than that more companies typically mean more active vehicles.

Some NewGRFs can definitely cost lots of processing power. However I don't have any handy list of "known slow" ones.

More vehicles = more processing (pathfinding) needed per tick, so yes that's an important factor. Previously ships and road vehicles could be really bad for performance, but since we added some route caching mechanisms in 1.10.0 those have much less impact than they used to.

Large stations or long trains should not affect performance significantly.


The performance of the host/server determines the speed the game runs at for everyone. (Clients run in lock-step with the server.) However, if there are any clients connected that can't keep up with the simulation speed of the host, I think they can end up being kicked out for being too slow.
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: Multiplayer tips

Post by Eddi »

an important piece that often gets overlooked, is the amount of cargo packages travelling around on the map, especially when cargo distribution is active
LaChupacabra
Route Supervisor
Route Supervisor
Posts: 389
Joined: 08 Nov 2019 23:54

Re: Multiplayer tips

Post by LaChupacabra »

By orange color I marked what may cause a significant increase in the load of the game and a decrease in its speed or the inability to enter the server.

Basically, the number of vehicles in the game is the most important. Also the number of elements that the vehicle has (wagons, trailers) have singnificant impact for the game speed. A lot more load will be caused by 100 trains with 20 grids length than 500 with a length of 2. There are also sets of trains, where each wagon consists of 2 elements, one of which is invisible - these are all wagons with a length greater than 0.5. Similarly with articulated vehicles. The speed at which vehicles move is also important.
In the past ships could actually cause a heavy load on the game, today it's much better.

What most affects the number of vehicles is the industrial set used and the way cities grow and how they generate passengers.
In the case of industry, unfortunately, but the worst in terms of performance is FIRS 3 and AuzInd. Both due to the very large production, which requires the use of a large number of vehicles. For this reason FIRS 1 is still used on one of the most popular servers with the map of Poland, which had significantly lower base productions. The newer version of the map will contain FIRS 3 but with the blocked possibility of new industry creation and manually reduced production of all over 300 enterprises - this is the only way to keep an acceptable game load with large number of players.
For cities, the basis is setting a linear method of generating passengers. A good idea is also to use one of the scripts that change the conditions of city development and slow it down, so that cities do not grow too much and do not generate millions of passengers at each station.

As jfs wrote, the third important factor is the map size - the indicated sizes (1024x1024 or smaller) are the most optimal.

Since version 1.9, a very useful load and speed measurement tool is available in the game, so you can check for yourself what causes the greatest load.

You can find them under the question mark icon
Show frame rate tool.PNG
Show frame rate tool.PNG (27.41 KiB) Viewed 1829 times
jfs wrote: 30 May 2020 16:36 Large stations or long trains should not affect performance significantly.
I can't believe that you are writing it... :roll: The number of wagons (elements) has a very large impact on the load on the game.
jfs wrote: 30 May 2020 16:36 Previously ships and road vehicles could be really bad for performance, but since we added some route caching mechanisms in 1.10.0 those have much less impact than they used to.
Unfortunately, this doesn't work well. There is a bug in the pathfinder I wrote about earlier - it has not been eliminated.
Here you have to save with an example of a player from the Polish forum who had such a problem:
PKP, 5 lut 1977.sav
(1.84 MiB) Downloaded 111 times
Look at the pink AI - it has 193 vehicles, and the game load that it causes is huge. You can ignore the lack of newGRF because it doesn't have much impact here. See what happens after removing this AI with its vehicles (repurchase of company does not help - it's pathfinder's fault not AI)
I am sorry for may English. I know is bed.
User avatar
jfs
Tycoon
Tycoon
Posts: 1757
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Multiplayer tips

Post by jfs »

What I meant to say was, 1000 trains with 20 cars each or 2000 trains with 10 cars each should not make a significant difference in performance. If anything, the 1000 longer trains should simulate faster since there are fewer vehicle heads, and only the vehicle heads perform pathfinding.
_dp_
Transport Coordinator
Transport Coordinator
Posts: 278
Joined: 18 Dec 2013 12:32

Re: Multiplayer tips

Post by _dp_ »

While technically pretty much everything affects performance I'm yet to see a game that's lagging (in simulation) because of anything else than a large number of vehicles (~5000) or bugs.
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 27 guests