Page 1 of 2

OS X and 1.9.0 version

Posted: 02 Apr 2019 09:38
by keromudo
Good afternoon,

My PC is Macbook Pro 2018 in base build and version openTTD 1.8.0 is working totally fine. As soon as I open the new 1.9.0 version the CPU usage is sky high. I have all software updated. Any tips? :shock:

Re: OS X and 1.9.0 version

Posted: 02 Apr 2019 10:11
by planetmaker
keromudo wrote:Good afternoon,

My PC is Macbook Pro 2018 in base build and version openTTD 1.8.0 is working totally fine. As soon as I open the new 1.9.0 version the CPU usage is sky high. I have all software updated. Any tips? :shock:
does it work though? does it drop back after some time?
What exactly is the difference in cpu usage (same savegame)?
what OS version do you use?

Re: OS X and 1.9.0 version

Posted: 04 Apr 2019 09:12
by dimaloop
i have the same problem

1.8 works fine, but 1.9 and all 1.9 pre-release versions works with freezes
Yes, it drop back after some time, but then can freeze again
If i change window size to smaller - it work better as i remember

Had no no much time experience with 1.9, because i always rolled back to 1.8 after each new 1.9

iMac (Retina 5K, 27-inch, 2017)
3,8 GHz Intel Core i5, 24 Gb 2400 MHz DDR4, Radeon Pro 580 8 Gb
Mohave 10.14.4

Re: OS X and 1.9.0 version

Posted: 04 Apr 2019 11:07
by planetmaker
It would be really helpful, if possibly one of you could grab the source code, compile it and get a backtrace as to see where exactly it hangs. We are somewhat missing people who can do that on OSX.

Re: OS X and 1.9.0 version

Posted: 04 Apr 2019 14:53
by dimaloop
thank you for answer!

I think my skills are not enough for this (
but i will try download sources from github and compile them

maybe there is a built-in debug console or logs with standard build of openttd?

Re: OS X and 1.9.0 version

Posted: 04 Apr 2019 17:11
by dimaloop
ok, compiled and run last version from github with make CXXFLAGS='-std=c++11'
same freezes...
it was a new game with default preferences and map size

what i need to say - after resizing window to a smaller size mouse cursor moves ok
but when resize to full (or near) size of screen - freezes occurs again

tested on 27'' 5k retina (default resolution)

Re: OS X and 1.9.0 version

Posted: 04 Apr 2019 17:34
by _dp_
You can also try CityMania patchpack. It's fully compatible with regular OpenTTD and has one significant performance-related change in 1.9.0.

Re: OS X and 1.9.0 version

Posted: 04 Apr 2019 18:27
by dimaloop
_dp_ wrote:You can also try CityMania patchpack. It's fully compatible with regular OpenTTD and has one significant performance-related change in 1.9.0.
sorry, no change

Re: OS X and 1.9.0 version

Posted: 04 Apr 2019 18:55
by _dp_
dimaloop wrote:sorry, no change
Oh, well, at least we know it's not #7247 then.

Re: OS X and 1.9.0 version

Posted: 04 Apr 2019 21:02
by Expresso
Perhaps this is related to sdl. Have you tried with the sdl2 pr?

Re: OS X and 1.9.0 version

Posted: 05 Apr 2019 07:10
by planetmaker
Expresso wrote:Perhaps this is related to sdl. Have you tried with the sdl2 pr?
OSX does not use and build with SDL - unless you force it by the appropriate command line options on compilation. Last time I checked (some years ago) the user experience with SDL on OSX was worse than with the native cocoa drivers.

Re: OS X and 1.9.0 version

Posted: 05 Apr 2019 07:50
by dimaloop
Expresso wrote:Perhaps this is related to sdl. Have you tried with the sdl2 pr?
no, by default is compile with Cocoa

configure log:
[+] Spoiler
./configure
checking awk... awk
detecting OS... OSX
checking build system type... x86_64-apple-darwin18.5.0
checking host system type... x86_64-apple-darwin18.5.0
checking universal build... no
checking build cc... gcc
checking host cc... gcc
checking build c++... g++
checking host c++... g++
checking strip... disabled
checking builtin depend... yes
checking makedepend... disabled
detecting cpu-type... 64 bits
detecting SSE... found
checking static... no
checking unicode... no
using debug level... no
using desync debug level... no
using link time optimization... no
checking OSX sysroot... no (use system default)
checking Allegro... OSX, skipping
checking SDL... OSX, skipping
checking COCOA... found
checking whether to enable the Quartz window subdriver... yes
checking Quickdraw window subdriver... disabled (64 bits)
checking GDI video driver... not Windows, skipping
checking dedicated... not selected
checking console application... not Windows, skipping
checking network... found
checking squirrel... found
checking translator... no
checking assert... enabled
checking zlib... found
checking liblzma... found
checking lzo2... found
checking Uniscribe text layout... not Windows, skipping
checking libxdg-basedir... not found
checking libpng... found
checking freetype2... found
checking libfontconfig... OSX, skipping
checking icu-lx... not found
checking icu-i18n... not found
checking libtimidity... not found
checking fluidsynth... not found
checking direct-music... not Windows, skipping
checking xaudio2... not Windows, skipping
checking sort... sort
suppress language errors... no
checking stripping... skipped
checking distcc... no (only used when forced)
checking ccache... no (only used when forced)
checking grfcodec... not found
checking nforenum... not found
detecting ppc970 (G5)... no
checking revision... no detection
WARNING: there is no means to determine the version.
WARNING: please use a subversion, mercurial, or git checkout of OpenTTD.
WARNING: you can only join game servers that have been compiled without
WARNING: version detection.
WARNING: there is a great chance you desync.
WARNING: USE WITH CAUTION!
checking iconv... found
checking if iconv has non-const inbuf... yes
checking whether to link to iconv... yes
personal home directory... Documents/OpenTTD
shared data directory... /Library/Application\ Support/OpenTTD
installation directory... /
icon theme directory... none
manual page directory... share/man/man6
menu item directory... none
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
using CFLAGS_BUILD... -fno-strict-aliasing -Wall -W -Wextra -Wno-unused-parameter -Wno-unused-value -Wno-multichar -Wno-self-assign -Wno-parentheses -Wno-sign-compare -DOSX -D_FORTIFY_SOURCE=2 -O1
using CXXFLAGS_BUILD...
using LDFLAGS_BUILD... -rdynamic
using CFLAGS... -O2 -fomit-frame-pointer -fno-strict-aliasing -Wall -W -Wextra -Wno-unused-parameter -Wno-unused-value -Wno-multichar -Wno-self-assign -Wno-parentheses -Wno-sign-compare -DOSX -D_FORTIFY_SOURCE=2 -DWITH_SSE -isystem/opt/local/include -DNO_QUICKTIME -DUNIX -DWITH_COCOA -DENABLE_COCOA_QUARTZ -DWITH_ZLIB -DWITH_LZMA -I/usr/local/Cellar/xz/5.2.4/include -DWITH_LZO -D_SQ64 -I/Users/dima/Downloads/OpenTTD-master/src/3rdparty/squirrel/include -DWITH_PNG -I/usr/local/Cellar/libpng/1.6.36/include/libpng16 -DWITH_FREETYPE -I/usr/local/opt/freetype/include/freetype2 -DWITH_ICONV -DENABLE_NETWORK -DWITH_PERSONAL_DIR -DPERSONAL_DIR=\"Documents/OpenTTD\" -DWITH_SHARED_DIR -DSHARED_DIR=\"/Library/Application\ Support/OpenTTD\" -DGLOBAL_DATA_DIR=\"/usr/local/share/games/openttd\"
using CXXFLAGS...
using LDFLAGS... -lstdc++ -lc -F/System/Library/Frameworks -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -lz -L/usr/local/Cellar/xz/5.2.4/lib -llzma -llzo2 -L/usr/local/Cellar/libpng/1.6.36/lib -lpng16 -lz -L/usr/local/opt/freetype/lib -lfreetype -liconv -rdynamic -framework Cocoa
Generating Makefile...
Generating lang/Makefile...
Generating setting/Makefile...
Generating grf/Makefile...
Generating objs/Makefile..

Re: OS X and 1.9.0 version

Posted: 10 Apr 2019 18:02
by pirogronian
It's not OSX only. I just searched if someone else have problems with high CPU usage in version 1.9*. I noticed it on my Archlinux, after making and installing own package of version 1.9.1. I just continued previously saved game and CPU loads changed from 17-20% to 40-45%. After some time it picks to 80-100% (probably due to processor thermal reclocking). I lowered cargo distribution accuracy but without change. I noticed also immediate drop of animation smoothness. CPU load drops immediately when paused. IMHO there is something with drawing code.

Maybe it's related to this: With lots of vehicles, PerformanceAccumulator has a large performance impact itself

Re: OS X and 1.9.0 version

Posted: 12 Apr 2019 06:29
by _dp_
As I already said CityMania client has PerformanceAccumulator disabled for vehicles so it's unlikely to be the cause of OSX perfermance drop. But it may help on Linux though, at least it did for me.

Re: OS X and 1.9.0 version

Posted: 13 Apr 2019 13:46
by pirogronian
Indeed. I built CityMania client and run my gamesave without any performance issue.

Re: OS X and 1.9.0 version

Posted: 23 Apr 2019 09:36
by dimaloop
with 1.9.1 CityMania client on OS X still cause performance issues, even on "start" screen with menu (mouse pointer moves)
when a window with openttd app is active (focused) - mouse moves with freezes
when i switch to another window - mouse moves without any issues over openttd app until i click on it to focus

here i share small screencast:
https://www.youtube.com/watch?v=BK6_QZ0 ... e=youtu.be

Re: OS X and 1.9.0 version

Posted: 27 Apr 2019 16:44
by 2thicc2furious
Wanted to drop in and mention I am running into this issue on OS X 10.14.4 as well.

1.9.x runs with very poor performance, which seems to effect GFX as well as mouse cursor.

Re: OS X and 1.9.0 version

Posted: 27 Apr 2019 17:42
by jfs
Can you try taking a screenshot of the framerate window when the game is running poorly? (Open it via the ? button on the main toolbar.)
Or if it's impossible to navigate to a new game so you can open that, then try opening the console and type the "fps" command and post a screenshot of the output.

@dimaloop: It looks like you're using a high-resolution 32bpp graphics set. Can you try with OpenGFX (or original) base graphics instead?

Re: OS X and 1.9.0 version

Posted: 27 Apr 2019 19:27
by dimaloop
@dimaloop: It looks like you're using a high-resolution 32bpp graphics set. Can you try with OpenGFX (or original) base graphics instead?
sure, i switched to OpenGfx and got same poor performance

Re: OS X and 1.9.0 version

Posted: 27 Apr 2019 20:42
by jfs
Very interesting, it's not any of the measured components that cause the slowness. At the timings measured you should be able to easily get 800 fps if it was uncapped. What happens if you turn on fast-forward?