Efficient running of OpenTTD

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

Moderator: OpenTTD Developers

User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7241
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Efficient running of OpenTTD

Post by Redirect Left »

Howdy.

I tend to run my maps for (real life) months towards years, and its now got to the point where the game runs fairly sluggish and the speed up button has very little difference.

The first thing I did was turn off animation, which made a minor difference. I have tried disabling 'full detail' which made no noticeable effect on running speed.

Is there anything I can do as a player to run OpenTTD with largeish (usually 1024 x 1024 or 2048 x 2048) and a buttload (upwards of 1000) trains. I don't use buses, boats or planes in my map, sometimes i use trams to link stations together (i guess that's probably treated as a 'bus' or road vehicle anyway).

Side note, i'm planning on getting a new computer soon anyway, probably to an i9-7940X from my current i5-4690. As i understand it, it won't have much effect on OpenTTD as its single threaded and doesn't utilise the gorgeous pristine other <many> cores, is this correct? Furthermore, is there any intention on improving that situation if accurate?
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: Efficient running of OpenTTD

Post by Leanden »

This is something id like to know as well.

I like the bigger maps, but even now with no trains on my max size map, the tile loop alone makes the ff button useless.
Image
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Efficient running of OpenTTD

Post by Alberth »

Newer PCs lack the raw computing power of a single core, unless you specifically buy such a processor. The reason for this is that most consumers don't use the power, and less power means longer battery life, greener computing, etc. A second reason is that newer computers now have GPUs which don't talk to the CPU very fast (compared with directly accessing the video memory). Since OpenTTD renders the screen at the CPU, all video data must be sent to the GPU for display, which is slow.
A third reason is that OpenTTD does 32bpp rendering by default (configurable in openttd.cfg), which quadruples the amount of data that needs to be transferred. Finally, a fourth reason is that people buy screens with higher resolution, which means more pixels which means more data to send.

Mapsize has some influence, but the map size in itself is probably not that important. What's more important is that the number of industries and cities gets much much larger, and people run more trains to get a certain capacity between two points at the map. (300 tonnes / month 50 tiles away needs less trains than 300 tonnes / month 2000 tiles away).
Being a retired OpenTTD developer does not mean I know what I am doing.
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: Efficient running of OpenTTD

Post by Leanden »

Which setting disables 32bpp rendering?
Image
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Efficient running of OpenTTD

Post by Alberth »

The "blitter" option in the openttd.cfg.
The list available blitters can be queried by running openttd with a "-h" option, which produces around a page of output:

Code: Select all

$ ./openttd -h
...

List of blitters:
        32bpp-anim: 32bpp Animation Blitter (palette animation)
   32bpp-optimized: 32bpp Optimized Blitter (no palette animation)
      32bpp-simple: 32bpp Simple Blitter (no palette animation)
        32bpp-sse2: 32bpp SSE2 Blitter (no palette animation)
        32bpp-sse4: 32bpp SSE4 Blitter (no palette animation)
   32bpp-sse4-anim: SSE4 Blitter (palette animation)
       32bpp-ssse3: 32bpp SSSE3 Blitter (no palette animation)
    8bpp-optimized: 8bpp Optimized Blitter (compression + all-ZoomLevel cache)
       8bpp-simple: 8bpp Simple Blitter (relative slow, but never wrong)
              null: Null Blitter (does nothing)
              
...
Being a retired OpenTTD developer does not mean I know what I am doing.
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7241
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Efficient running of OpenTTD

Post by Redirect Left »

and which of those is generally considered the 'best' for efficiency and good speed running on modern computers?
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
Drury
Tycoon
Tycoon
Posts: 2168
Joined: 09 Dec 2008 16:20
Skype: yes
Location: Slovakia
Contact:

Re: Efficient running of OpenTTD

Post by Drury »

Well since it's been said 32bpp rendering quadruples the communication volume between GPU and CPU, I'd go for the optimized 8bpp one. Also sounds like you'd get better performance at an oldschool resolution like 800x600.
Image

Only dumb people quote themselves, and only the truest retards put such quotes in their forum signatures
-Drury
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7241
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Efficient running of OpenTTD

Post by Redirect Left »

I've set blitter to 8bpp-optimized, but notice no (maybe a tiny bit of difference, not sure if that is just willing myself to believe it).


Is there a console command to verify what openttd is currently using for its blitter?
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: Efficient running of OpenTTD

Post by Leanden »

I changed to 8bpp-optimized and all my station graphics disappeared...
Image
User avatar
Sylf
President
President
Posts: 957
Joined: 23 Nov 2010 21:25
Location: ::1

Re: Efficient running of OpenTTD

Post by Sylf »

Check openttd.cfg for this line too. I think it needs to be flipped to yes.
support8bpp = no
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: Efficient running of OpenTTD

Post by Leanden »

invalid value "yes" for support8bpp... got an error ;)
Image
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Efficient running of OpenTTD

Post by Alberth »

Some systems believe that 8bpp has no value, and dropped all support :(
Being a retired OpenTTD developer does not mean I know what I am doing.
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7241
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Efficient running of OpenTTD

Post by Redirect Left »

Alberth wrote:Some systems believe that 8bpp has no value, and dropped all support :(
Is there anything OpenTTD can do to overcome that, or any pre-requisites that can be installed to bring back old support?

My game is really struggling, and its irritating me to the point where I'm considering a new map, even though in 6 month time i'll be back here and "uuugh!"
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Efficient running of OpenTTD

Post by Pyoro »

Would you mind sharing your save? I'm kind of curious what causes such troubles ;)
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Efficient running of OpenTTD

Post by Alberth »

Redirect Left wrote:Is there anything OpenTTD can do to overcome that, or any pre-requisites that can be installed to bring back old support?
It's the computer system itself that doesn't do 8bpp, as in, we ask "can you display 8bpp?" and the system says 'no'.

We could refuse to run at such systems, so technically OpenTTD would run at systems that have old support, but that doesn't do much good either, is my guess.
Being a retired OpenTTD developer does not mean I know what I am doing.
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: Efficient running of OpenTTD

Post by Leanden »

Leanden wrote:invalid value "yes" for support8bpp... got an error ;)
But this error came from within openttd, not my operating system.

And it was only the graphics from auzstations that seemed to he effected by the change of blitter

What are the valid values for support8bpp in the cfg?
Image
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Efficient running of OpenTTD

Post by Alberth »

Leanden wrote:And it was only the graphics from auzstations that seemed to he effected by the change of blitter
If it uses standard non-animated palette colours, conversion is done on the fly without you noticing, since 8bpp colours are a subset of 32bpp colours. Zoom calculations may make a mess here, but don't know (I use default size graphics or smaller only).
Leanden wrote:What are the valid values for support8bpp in the cfg?
The table file suggests there are 3 different values

Code: Select all

static const char *_support8bppmodes = "no|system|hardware";
I guestimate that "no" means no, "system" means processor does it, and "hardware" means the video card does it, but not sure.
Of course "hardware" cant be used if your video card doesn't have a 8bpp mode.
Being a retired OpenTTD developer does not mean I know what I am doing.
User avatar
Sylf
President
President
Posts: 957
Joined: 23 Nov 2010 21:25
Location: ::1

Re: Efficient running of OpenTTD

Post by Sylf »

Sylf wrote:Check openttd.cfg for this line too. I think it needs to be flipped to yes.
support8bpp = no
Alberth wrote:

Code: Select all

static const char *_support8bppmodes = "no|system|hardware";
That sounds like one of the problem - I didn't know what the proper supported values were for that setting. I added the entry to the wiki page.
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7241
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Efficient running of OpenTTD

Post by Redirect Left »

Just replying to this, as i'm still having issues.

I've tried all of the noted support8bpp, all of them worked (or maybe ignored if not compatible?) but there was never any sort of noticeable increase in speed.

I use JGR patchpack mostly, but I have recreated the same sort of general performance issues with similar games on trunk.
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
viator2
Engineer
Engineer
Posts: 3
Joined: 09 Apr 2017 14:04

Re: Efficient running of OpenTTD

Post by viator2 »

What I miss in this discussion (and other likewise discussions) is the effect of the graphics card.
I like the artwork so I use mainly 32bpp by means of an older (cheap) gtx960 graphics card.
All sizes, all types games are running very smooth on a 4K-screen (3840x2160).
I'm not sure to which extend this is (also) caused by using the 64bit version of OpenTTD.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 8 guests