Page 8 of 9

Re: Multi-core support please!

Posted: 28 Jul 2015 20:26
by Expresso
Openttd has a huge performance improvement that you are forgetting or disregarding in your equation. On top of that you forget/disregard/aren't aware of the memory bandwidth required by openttd.

If you want to make openttd happy with a huge, busy map, make sure you have fast memory and a huge L1 and L2 cache on a very good and fast mainboard. Openttd handles LOTS of data every second.

In my knowledge there's no game that comes even close to what openttd could be made to cope with. Openttd cannot make any assumptions about a game being played. Behavior and art assets can be modified completely (ok, you can't turn openttd into an fps or a platformer) before the game is started by the player, in optionally a huge completely random world, which can be edited completely during play.

Re: Multi-core support please!

Posted: 28 Jul 2015 20:35
by leifbk
Mister_X wrote:Since the original game, a lot of game limits are improved. [...]
The maximum number of vehicles are increased from 500 to 20.000.
Number of network players are increased to 15 and all traffic is fully synchronized.

The most improvements will cost more CPU power. For example, we could use 15 x 20.000 = 300.000 vehicles in one map and that's 6000 times more than the 500 vehicles in the original version.

For the original version, we needed 60 MHz for 500 vehicles. So for 300.000 vehicles, we need at least a CPU speed of 60x6000 = 360.000 MHz = 360 GHz !
Which of course is total bulls***.

Firstly there is a sea of difference in performance between the 32 bits 486 and a modern 64 bits i7. The CPU clock speed is only one of several dimensions. The amount of stuff that can be cached in RAM is also vastly different from when we typically had 4 MB of it and everything above had to be swapped back and forth to the HDD.

Secondly, and probably even more important: How do you manage 20.000 vehicles? And how do even 15 of you manage to cram 300.000 vehicles into one map?

Re: Multi-core support please!

Posted: 28 Jul 2015 21:18
by Eddi
btw. "clock speeds" today are more like marketing numbers and have basically nothing to do with at which speed your CPU actually runs.

Re: Multi-core support please!

Posted: 28 Jul 2015 21:49
by Expresso
leifbk wrote:And how do even 15 of you manage to cram 300.000 vehicles into one map?
On a map of 4096x8192 (maximum mapsize) = 33554432 (number of tiles on a map of that size) / 300000 (number of vehicles) = 111 (number of tiles for one vehicle). So, there is actually space on the map.

However, I guess it would be safe to assume that openttd would be unplayable on even multi-core cpus, if it used multiple cores, with that many vehicles, simply because of memory bandwidth issues.

Re: Multi-core support please!

Posted: 28 Jul 2015 22:06
by leifbk
Expresso wrote:On a map of 4096x8192 (maximum mapsize) = 33554432 (number of tiles on a map of that size) / 300000 (number of vehicles) = 111 (number of tiles for one vehicle). So, there is actually space on the map.
Yeah, that would even leave some space for towns and industries :P

I wasn't really thinking about space on the map, but how you would go about with the sheer work of deploying all those vehicles in a limited amount of time, and then manage them in a meaningful way. I'm an elderly guy and play a game to relax, not to buzz around like a hamster on amphetamine.
However, I guess it would be safe to assume that openttd would be unplayable on even multi-core cpus, if it used multiple cores, with that many vehicles, simply because of memory bandwidth issues.
Indeed.

Re: Multi-core support please!

Posted: 29 Jul 2015 03:00
by TimeLapse1357
Expresso wrote:In my knowledge there's no game that comes even close to what openttd could be made to cope with.
SimCity4 Rush Hour.


most laptops and 'on motherboard' video systems use shared memory. the video chip and the CPU cannot access memory at the same time. reduces frame rate and slows performance.


the advantage of multi-core/hyper-threading is being able to run the game AND WinAmp, Excel, Paint, IE/firefox(multiple tabs) and custom .NET APPs, all at the same time.

Re: Multi-core support please!

Posted: 29 Jul 2015 05:12
by Transportman
Mister_X wrote:For the original version, we needed 60 MHz for 500 vehicles. So for 300.000 vehicles, we need at least a CPU speed of 60x6000 = 360.000 MHz = 360 GHz !
This calculation is a little but overstated of course, but I want to explain here that due to all improvements now and in the future the game needs more and more CPU speed to run this game.
I wish you good luck with cramming 300.000 vehicles in a map that still makes some sense from a play-wise perspective...

Re: Multi-core support please!

Posted: 29 Jul 2015 16:02
by Mister_X
My calculation with extreme values was only to show you that the game limits are increased an won't run anymore at slow computers.

I've given up a lot of multiplayer games because the performance of the game was too bad with a huge number of trains (4 players with about 1.800 trains each).
OpenTTD is consuming 25% of my quad core CPU running at 2.7 GHz so a full core is used for OpenTTD and it's displaying 1fps. Making the screen smaller will reduce the CPU usage a little bit, but I've 3 cores left to do something else.

Re: Multi-core support please!

Posted: 29 Jul 2015 17:48
by Eddi
the thing with multiple cores is... it won't make it multiple times faster.

there have been experiments with multithreading in openttd, which resulted in something around: on dualcore computers it gets 20% faster, on singlecore computers it gets 20% slower. you're better off with the builtin feature of most multicore processors that can overclock one processor when the others are idle.

and maintainability goes down the drain... desync debugging is already hard enough.

Re: Multi-core support please!

Posted: 06 Aug 2015 19:58
by Roslav
kamnet wrote:From what I've read in recent discussions, the bottleneck is not the single core processing, but the fact that video driver support has moved from hardware to software. Your newest PC likely has a built-in video card with mostly software driving the video, where your PC from 10 years ago had all of that working on a separate hardware video card.
Built-in card = hardware video card. AFAIK the problem is, that OpenTTD does not use graphics hardware acceleration (computing video on built-in card), because the graphics framework (sdl1.2) does not support it. To increase performance, OpenTTD graphics layer needs to be upgraded to sdl2.

Re: Multi-core support please!

Posted: 06 Aug 2015 20:07
by Sylf
Roslav wrote:Built-in card = hardware video card. AFAIK the problem is, that OpenTTD does not use graphics hardware acceleration (computing video on built-in card), because the graphics framework (sdl1.2) does not support it. To increase performance, OpenTTD graphics layer needs to be upgraded to sdl2.
Are you volunteering? :mrgreen:

Re: Multi-core support please!

Posted: 07 Aug 2015 04:46
by Baldy's Boss
Since I installed my video card my monitor has been plugged into it.Are you saying OpenTTD somehow ignores the GPU?

Re: Multi-core support please!

Posted: 07 Aug 2015 05:06
by Alberth
Yep, OpenTTD sees video cards as dumb "display my generated pixels" devices.

More modern games,, in particular all 3D-ish games see video cards as "convert my spatial collection of surfaces to the display". The GPU does a lot of 3D calculations in the latter case in dedicated hardware, much faster than a CPU can do it.

Re: Multi-core support please!

Posted: 07 Aug 2015 18:34
by Baldy's Boss
So would adding GPU support improve OpenTTD performance more than adding multi-core CPU support?

Re: Multi-core support please!

Posted: 07 Aug 2015 20:27
by Eddi
no.

because OpenTTD doesn't do any fancy 3D stuff. and the stuff that OpenTTD does do, GPUs are not optimized for.

Re: Multi-core support please!

Posted: 07 Aug 2015 20:55
by Baldy's Boss
So if additional cores are ignored and GPUs are ignored and clock rates aren't "real"...what hardware improvements DO affect OpenTTD performance?

Re: Multi-core support please!

Posted: 07 Aug 2015 22:04
by Eddi
Baldy's Boss wrote:So if additional cores are ignored
they are not ignored, but none of the existing features are likely to be ever recoded to make use of them in a meaningful way (new features like CargoDist do use them)
and clock rates aren't "real"...
there's the unit of "MIPS" [million instructions per second], which is sort of relevant, but it's nearly impossible to compare this value between computers of different architectures.

but even between "not real" clock speeds, a higher number usually means better performance. but there's probably no point in comparing this number between, say, AMD and Intel processors.

Re: Multi-core support please!

Posted: 07 Aug 2015 22:51
by leifbk
CPU speed is certainly "real", but it's only one of several dimensions. I haven't been into current computer architecture for many years, but parameters like memory speed, cache size, bus speed, and number of memory channels certainly count.

I have built my own computers for 15 years, and I still consider my 5 year old rig with an i7 Quad running at 2.8 GHz / 6 GB RAM as adequate. But I'm seriously considering a CPU/Mobo/RAM upgrade soon, - because the components are aging and may be expected to go flaky sooner or later. My disks (2x1 TB in RAID-1 for the system, 4x2 TB in RAID-5 for /home) are 3 years old and probably will suffice for another couple of years. And yes, I'm running other things beside OpenTTD :)

My graphics card is rather low-end, a fanless ASUS GeForce GT 640 which does a very decent job of throwing pixels at my 2560x1440 32 inch screen. But then, I'm not into any fancy 3D games and stuff. It works fine for both HD movies and my regular text work.

Re: Multi-core support please!

Posted: 08 Aug 2015 00:16
by Baldy's Boss
I have an i7-3770K (3.5GHz base) with 8 MB of RAM (was supposed to be 16MB but the motherboard seems to only see one of the two modules) and 2 4-TB drives plus a 240GB SSD.My graphics card is a Radeon HD 7770 model from ASUS.
I previously played OpenTTD on a Dell Poweredge 2650 with 4GB RAM and a 3.06GHz Xeon (32-bit,twin-thread core) and Transport Tycoon in DOSBox on a Compaq 6350US with a 2.4GHz Pentium 4 with 512MB RAM,having started playing TT on a AMD 486 DX4-120 with 32MB.
I'm getting the picture that OTTD would play just as well on just about any CPU still sold as on what I've got?

Re: Multi-core support please!

Posted: 08 Aug 2015 00:23
by Redirect Left
Baldy's Boss wrote:8 MB of RAM (was supposed to be 16MB but the motherboard seems to only see one of the two modules)
You may wish to revise that line. Otherwise it's a miracle you have a modern operating system and are able to browse the internet.