What's worst for the CPU, Size of station or Catchment area?

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 708
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can... Almost 20 years and counting!

What's worst for the CPU, Size of station or Catchment area?

Post by Digitalfox »

Hi.

I'm compiling my own OpenTTD with very small changes, like bigger Loan Maximum.

And since I'm always reaching my CPU core maximum on OpenTTD because of huge stations.

I was wondering for example if I change the Catchment area of Train Station from 4 to 8 titles instead of building a station with 16 * 16 tiles, I now build a station with 12 * 12 tiles, will this help me reduce CPU usage?


Or in other words what is worse in CPU usage, the station size or the Catchment area?


I'm really curious over this :wink:
User avatar
Phreeze
Director
Director
Posts: 514
Joined: 12 Feb 2010 14:30
Location: Luxembourg

Re: What's worst for the CPU, Size of station or Catchment a

Post by Phreeze »

wonder what cpu you have...old PC ? or some singlecore ? never reached cpu limit even on huge maps, even on the old pc which had a Q6600 quadcore.

(btw: if you have ships, they may be the problem ;) )

speaking of catchment area, if you connect stations that are far away from your "main" station, this could result more in CPU usage than huge single-stations
User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 708
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can... Almost 20 years and counting!

Re: What's worst for the CPU, Size of station or Catchment a

Post by Digitalfox »

Phreeze wrote:wonder what cpu you have...old PC ? or some singlecore ? never reached cpu limit even on huge maps, even on the old pc which had a Q6600 quadcore.

(btw: if you have ships, they may be the problem ;) )

speaking of catchment area, if you connect stations that are far away from your "main" station, this could result more in CPU usage than huge single-stations
Old CPU, lol :)

i5 2500, 16GB RAM, GTX 570, not that old ;)

I have in my savegames, more than 1000 trains, 1000 planes, 500 ships, 400 road engines, this +/- my normal savegames. 1024*1024 map.

I spend months on each save + huge absurd stations size, as such I'm trying to reduce their size to avoid so high CPU usage.
User avatar
YNM
Tycoon
Tycoon
Posts: 3574
Joined: 22 Mar 2012 11:10
Location: West Java

Re: What's worst for the CPU, Size of station or Catchment a

Post by YNM »

Actually, size of station ~ catchment area; hence why because we only have fixed catchment area, we limit the station size. But in case you wonder, catchment area is the first that kill - your game can't just die from having too many stations, but might die because too many request and supply are processed via a single station.

Your computer is actually soo high just for OpenTTD. It's 64-bit right ?

EDIT : Just as a comparison, my computer is just standard i3 2100 3.10 GHz dual core, 2GB RAM and 1GB GeForce 210 and I've never making the game really slow. Most of the time it goes weird is because of my deliberate action to change NewGRFs, or because I use TownCars AI with 5000 road vehicle limit.
YNM = yoursNotMine - Don't get it ?
「ヨーッスノットマイン」もと申します。
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: What's worst for the CPU, Size of station or Catchment a

Post by Pyoro »

I'd blame it on the ships. Try sending them all to a depot and check if it makes a difference. Try to keep their routes as short as possible =)
User avatar
V453000 :)
President
President
Posts: 946
Joined: 01 Feb 2011 11:22
Location: Beer

Re: What's worst for the CPU, Size of station or Catchment a

Post by V453000 :) »

Pyoro wrote:I'd blame it on the ships. Try sending them all to a depot and check if it makes a difference. Try to keep their routes as short as possible =)
Stopping the ships should make the same difference but immediately :)
ImageImageImage
User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 708
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can... Almost 20 years and counting!

Re: What's worst for the CPU, Size of station or Catchment a

Post by Digitalfox »

Ok let me get you guys a more detailed explanation.

So here it goes.


I could go the easy way and complain about OpenTTD not being multi-core (yes Sound, Music and Savegames are).

But NO. I've came to accept the limitations of OpenTTD and I'm fighting my own way of playing the game and so improve it's performance.

I'm about to start a new game, already have all the NewGRF (all the latest ones) and settings ready. But again I'm concerned about performance.

That's why, I'm now running x64 builds (I posted in a topic about this), using SSE4 blitter (another post on a topic), using a more organized NewGRF system, where I avoid redundant GRF's, disabled autosave, disabled Sound and Music.

The game I base my experiments is a 2012 savegame that I have last week updated to the current trunk build.

On this game OpenTTD is always using 27, 28 and 29% CPU on normal mode (the core it's using is on full usage), fast forward doesn't even work.

My Savegames normally take about six months of fun gameplay, I start in 1850 and go all to 2020 or 2030 (I use Pause to build).

This savegame is from 2021.


Now today I've made some tests.

First I send every vehicle to the depot and magically, my CPU usage come down to 0%. That was a big shock for me, I thought just by having huge stations it would use maybe 5 or 6% of CPU.

Then I started all Ships, Road vehicles and Planes and my CPU usage started at 8 and 9%, but after 1 month it became 4 and 5%.

So now I know, my main problem is Trains, Trains and Trains. I send to the various depots every vehicle again and started only Trains and my CPU usage went to 27, 28 and 29%.

I changed the pathfinder from YAPF to NPF but no change.

I started stopping some stations to see how if some station was worse, but honestly only after stopping almost half the stations did I see the CPU usage decrease.

And so in my new Game I'm going to try to use smaller stations with a bigger size catchment area.
FarTooLoudEh
Engineer
Engineer
Posts: 4
Joined: 22 Jun 2014 20:41

Re: What's worst for the CPU, Size of station or Catchment a

Post by FarTooLoudEh »

I have a 4770, dont even hit 5%
zooks
Transport Coordinator
Transport Coordinator
Posts: 262
Joined: 29 Jun 2006 08:36

Re: What's worst for the CPU, Size of station or Catchment a

Post by zooks »

I believe path-based signals use more CPU than regular signals. Which one are you using?
User avatar
Dave
Moderator
Moderator
Posts: 17243
Joined: 26 Dec 2005 20:19
Location: North London

Re: What's worst for the CPU, Size of station or Catchment a

Post by Dave »

Train path finding will definitely use some serious brainpower.
Official TT-Dave Fan Club

Dave's Screenshot Thread! - Albion: A fictional Britain
Flickr


Why be a song when you can be a symphony? r is a...
FarTooLoudEh
Engineer
Engineer
Posts: 4
Joined: 22 Jun 2014 20:41

Re: What's worst for the CPU, Size of station or Catchment a

Post by FarTooLoudEh »

Dave wrote:Train path finding will definitely use some serious brainpower.
tested, network hits my 4770 at 28% normal speed 68% fast
User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 708
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can... Almost 20 years and counting!

Re: What's worst for the CPU, Size of station or Catchment a

Post by Digitalfox »

FarTooLoudEh wrote:I have a 4770, dont even hit 5%
How many trains have you and what's their size (of stations also)? 10 titles, 15, 20? :)

FarTooLoudEh wrote:
Dave wrote:Train path finding will definitely use some serious brainpower.
tested, network hits my 4770 at 28% normal speed 68% fast
You're CPU is QuadCore, just like my i5, how can it be using 68% if OpenTTD is mostly Single Core (meaning a use of around 28/29/30%) :?:
FarTooLoudEh
Engineer
Engineer
Posts: 4
Joined: 22 Jun 2014 20:41

Re: What's worst for the CPU, Size of station or Catchment a

Post by FarTooLoudEh »

I was counting total % of my single core and my HT logic core.
User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 708
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can... Almost 20 years and counting!

Re: What's worst for the CPU, Size of station or Catchment a

Post by Digitalfox »

FarTooLoudEh wrote:I was counting total % of my single core and my HT logic core.
Ok got it. :)

But still, how many trains and their (+stations) size on average?
FarTooLoudEh
Engineer
Engineer
Posts: 4
Joined: 22 Jun 2014 20:41

Re: What's worst for the CPU, Size of station or Catchment a

Post by FarTooLoudEh »

Digitalfox wrote:
FarTooLoudEh wrote:I was counting total % of my single core and my HT logic core.
Ok got it. :)

But still, how many trains and their (+stations) size on average?
Atm, i have 462 trains with full size stations. trains are hitting 7 in size.
User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 708
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can... Almost 20 years and counting!

Re: What's worst for the CPU, Size of station or Catchment a

Post by Digitalfox »

FarTooLoudEh wrote:
Digitalfox wrote:
FarTooLoudEh wrote:I was counting total % of my single core and my HT logic core.
Ok got it. :)

But still, how many trains and their (+stations) size on average?
Atm, i have 462 trains with full size stations. trains are hitting 7 in size.
Yeah and there's where my problem lies. I have over 1000+ Trains with 15 to 20 tiles in size (I know I'm nuts).
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: What's worst for the CPU, Size of station or Catchment a

Post by Eddi »

IMHO, the size of stations has almost no effect on CPU usage. likewise, the CPU effect of path signals is questionable at best. especially if you have junctions with lots of branches, path signals may actually reduce CPU usage, as the pathfinder is called once per signal, and not once per junction tile.

trains are often the largest CPU hog, just because you tend to have so many of them. if you have the same number of ships as you have trains, the ships would be heavier on the CPU. also, more smaller trains should be heavier than fewer longer trains. additional wagons only need to be moved, they don't have to find paths.

another significant CPU factor for later maps is the amount of cargo packets, especially if you use cargodist.
User avatar
Phreeze
Director
Director
Posts: 514
Joined: 12 Feb 2010 14:30
Location: Luxembourg

Re: What's worst for the CPU, Size of station or Catchment a

Post by Phreeze »

i think the "normal" user doesn't have that many very long trains ^^ i've never tried out so many long trains, probably that's why my cpu is sleeping all the time ^^
User avatar
Qu@rks
Route Supervisor
Route Supervisor
Posts: 495
Joined: 26 Mar 2006 23:16
Location: Berlin, Germany
Contact:

Re: What's worst for the CPU, Size of station or Catchment a

Post by Qu@rks »

THE CPU NEVER SLEEPS HAHA :P

I wouldn't only blame it on ships. I have huge maps 2k*2k with very many trains (and only trains and some RVs) and CPU load is significantly higher than at the beginning of the game. Things are still running very smoothly but I can definitely see a difference. Station size though does not seem to make much of a difference.
stevetrov
Engineer
Engineer
Posts: 24
Joined: 02 Jul 2013 06:40

Re: What's worst for the CPU, Size of station or Catchment a

Post by stevetrov »

I did some work looking at what my CPU was doing last year. I found that trains were using huge amounts of CPU because each wagon is treated as a separate vehicle, newGRF code is run for every wagon every tick to see whether it needs to update the sprite. This uses a huge amount of CPU I think it is effectively running an interpreted language to calculate this.

So whether or not you are using the standard train set makes a big difference.

And the length of the trains makes a big difference.

I have an I7 Ivy Bridge laptop and that starts to struggle at around 1000 length 5 trains.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 30 guests