Multi-core support please!

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

User avatar
Expresso
Tycoon
Tycoon
Posts: 1760
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

Re: Multi-core support please!

Post 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.
Last edited by Expresso on 28 Jul 2015 21:11, edited 1 time in total.
leifbk
Chairman
Chairman
Posts: 821
Joined: 23 Dec 2013 16:33
Location: Bærum, Norway

Re: Multi-core support please!

Post 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?
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Multi-core support please!

Post 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.
User avatar
Expresso
Tycoon
Tycoon
Posts: 1760
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

Re: Multi-core support please!

Post 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.
leifbk
Chairman
Chairman
Posts: 821
Joined: 23 Dec 2013 16:33
Location: Bærum, Norway

Re: Multi-core support please!

Post 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.
User avatar
TimeLapse1357
Traffic Manager
Traffic Manager
Posts: 132
Joined: 10 Mar 2015 07:13
Location: Southern California

Re: Multi-core support please!

Post 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.
Transportman
Tycoon
Tycoon
Posts: 2792
Joined: 22 Feb 2011 18:34

Re: Multi-core support please!

Post 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...
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
Mister_X
Engineer
Engineer
Posts: 54
Joined: 27 Apr 2005 18:40
Location: The Netherlands

Re: Multi-core support please!

Post 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.
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Multi-core support please!

Post 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.
Roslav
Engineer
Engineer
Posts: 59
Joined: 19 May 2014 21:50
Location: Slovakia

Re: Multi-core support please!

Post 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.
User avatar
Sylf
President
President
Posts: 957
Joined: 23 Nov 2010 21:25
Location: ::1

Re: Multi-core support please!

Post 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:
Baldy's Boss
Tycoon
Tycoon
Posts: 1397
Joined: 23 Feb 2014 22:02

Re: Multi-core support please!

Post 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?
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: Multi-core support please!

Post 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.
Being a retired OpenTTD developer does not mean I know what I am doing.
Baldy's Boss
Tycoon
Tycoon
Posts: 1397
Joined: 23 Feb 2014 22:02

Re: Multi-core support please!

Post by Baldy's Boss »

So would adding GPU support improve OpenTTD performance more than adding multi-core CPU support?
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Multi-core support please!

Post by Eddi »

no.

because OpenTTD doesn't do any fancy 3D stuff. and the stuff that OpenTTD does do, GPUs are not optimized for.
Baldy's Boss
Tycoon
Tycoon
Posts: 1397
Joined: 23 Feb 2014 22:02

Re: Multi-core support please!

Post 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?
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Multi-core support please!

Post 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.
leifbk
Chairman
Chairman
Posts: 821
Joined: 23 Dec 2013 16:33
Location: Bærum, Norway

Re: Multi-core support please!

Post 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.
Baldy's Boss
Tycoon
Tycoon
Posts: 1397
Joined: 23 Feb 2014 22:02

Re: Multi-core support please!

Post 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?
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7425
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Multi-core support please!

Post 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.
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 2 guests