Go Back   AnandTech Forums > Software > PC Gaming

Forums
· Hardware and Technology
· CPUs and Overclocking
· Motherboards
· Video Cards and Graphics
· Memory and Storage
· Power Supplies
· Cases & Cooling
· SFF, Notebooks, Pre-Built/Barebones PCs
· Networking
· Peripherals
· General Hardware
· Highly Technical
· Computer Help
· Home Theater PCs
· Consumer Electronics
· Digital and Video Cameras
· Mobile Devices & Gadgets
· Audio/Video & Home Theater
· Software
· Software for Windows
· All Things Apple
· *nix Software
· Operating Systems
· Programming
· PC Gaming
· Console Gaming
· Distributed Computing
· Security
· Social
· Off Topic
· Politics and News
· Discussion Club
· Love and Relationships
· The Garage
· Health and Fitness
· Merchandise and Shopping
· For Sale/Trade
· Hot Deals with Free Stuff/Contests
· Black Friday 2013
· Forum Issues
· Technical Forum Issues
· Personal Forum Issues
· Suggestion Box
· Moderator Resources
· Moderator Discussions
   

Reply
 
Thread Tools
Old 01-30-2013, 03:01 AM   #1
Acanthus
Lifer
 
Acanthus's Avatar
 
Join Date: Aug 2001
Posts: 19,916
Default EA/Maxis Simcity is single threaded.

Wow. Just wow.

If there is one style of game that could benefit from multithreading...

Their programmers must have a tough time with shared states..

https://twitter.com/moskow23/status/296355832998801408

It will utilize dual core, because the rendering is done on its own thread... but the "game" itself runs on a single thread.

This explains the small city sizes and their lack of interest in making it a 64bit app to support more memory.
__________________
::Intel Core i7 2600K @ 5.0ghz (100x50) 1.400v ~ 47% performance increase
::2x4GB Mushkin DDR3-1333
::Gigabyte GA-P67A-UD3-B3
::XFX Radeon 6850 1GB
::OCZ Vertex 4 128GB
::Water Cooling - Swiftech Apogee GTX, Triple 120mm rad, 120GPH pump
Acanthus is offline   Reply With Quote
Old 01-30-2013, 04:13 AM   #2
BrightCandle
Diamond Member
 
BrightCandle's Avatar
 
Join Date: Mar 2007
Posts: 4,492
Default

I know it seems ridiculous but this is how the grand majority of games are written at the moment. Its very hard to go from where the industry is to utilizing more cores efficiently. Don't get me wrong I want bigger cities and better simulations, and maybe this could mean a city 3x the size on a quad core, but its still mighty hard to program this adjustment.
__________________
i7 3930k @4.4, 2xMSI GTX 680, 16GB Corsair 2133 RAM, Crucial m4 500GB, Soundblaster Z
Custom watercooled by 2x MCR 320 and 1 MCR 480
Zowie Evo CL EC2, Corsair K70, Asus Rog Swift PG278Q

Last edited by BrightCandle; 01-30-2013 at 05:41 AM.
BrightCandle is offline   Reply With Quote
Old 01-30-2013, 07:41 AM   #3
SunnyD
Belgian Waffler
 
SunnyD's Avatar
 
Join Date: Jan 2001
Location: Waffle House
Posts: 31,092
Default

Okay... so?

A casual game dev that's designing for greatest common denominator. Big deal.

For the record, MOST games are designed this way. Gameloop/logic in one thread, sound/physics/other in additional threads.
__________________
It's a long story... and trust me, no, you really don't have time.
Need VPN? Cheap hosting? I can do that.
SunnyD is offline   Reply With Quote
Old 01-30-2013, 07:47 AM   #4
Annisman*
Senior Member
 
Annisman*'s Avatar
 
Join Date: Aug 2010
Location: Buffalo NY
Posts: 933
Default

Some other games that never should have been single threaded still work just fine, Sins of a Solar Empire for example. Thousands of units on screen, and somehow even with a restricted engine it's not hard to get respectable frames. Don't sweat it.
__________________
Gigabyte Assasin 2 X79 |3930K @ 4.4 | Crsr H100 p/p | EVGA GTX TITAN 6GB SC | 16gGskill ddr3-2133 | Samsung 830 256g SSD (OS) | 512g Crucial M4 SSD (Games) | WD Black 4TB | Asus Xonar Stx l 650ti Physx l Cooler Master Gold 1K Watt | Win7- 64 | Asus VG248QE 144Hz w/G-Sync | Sennheiser 650 l Cosmos 2
-Christian, Conservative, PC Gamer.-
Annisman* is offline   Reply With Quote
Old 01-30-2013, 08:29 AM   #5
lupi
Lifer
 
lupi's Avatar
 
Join Date: Apr 2001
Location: duh, winning!
Posts: 25,064
Default

And?
__________________
Rift Free Trial:

http://www.riftgame.com/en/products/...=ascend_invite
lupi is offline   Reply With Quote
Old 01-30-2013, 08:59 AM   #6
BrightCandle
Diamond Member
 
BrightCandle's Avatar
 
Join Date: Mar 2007
Posts: 4,492
Default

I think if the worlds weren't so small and the developer hadn't blamed performance on the reason this would be easier to swallow. It might be normal for games to have only two threads and having more might not increase the world size. But Its still not exactly pleasant to find out that a game marketed as a deeper simulation turns out to run just as well on the lowest end of CPUs that match performance of machines made 7 years ago.

Also goes to show you can make a great looking game and otherwise impressive simulation without remotely using the full capabilities of a modern PC.
__________________
i7 3930k @4.4, 2xMSI GTX 680, 16GB Corsair 2133 RAM, Crucial m4 500GB, Soundblaster Z
Custom watercooled by 2x MCR 320 and 1 MCR 480
Zowie Evo CL EC2, Corsair K70, Asus Rog Swift PG278Q
BrightCandle is offline   Reply With Quote
Old 01-30-2013, 09:27 AM   #7
Bateluer
Lifer
 
Bateluer's Avatar
 
Join Date: Jun 2001
Posts: 26,729
Default

Its EA. Did you expect them to make smart moves?
Bateluer is offline   Reply With Quote
Old 01-30-2013, 09:56 AM   #8
Genx87
Lifer
 
Join Date: Apr 2002
Location: Earth
Posts: 35,982
Default

Is it really that difficult to multi-thread these games these days? Shouldnt tools and newer compilers help with this now? It isnt like multi-core CPUs are something new. We are coming up on nearly a decade since they showed up for consumers.
__________________
"Communism can be defined as the longest route from capitalism to capitalism."
"Capitalism is the unequal distribution of wealth. Socialism is the equal distribution of poverty"
"Because you can trust freedom when it is not in your hand. When everybody is fighting for their promised land"
Genx87 is offline   Reply With Quote
Old 01-30-2013, 10:17 AM   #9
darkewaffle
Diamond Member
 
Join Date: Oct 2005
Location: pa
Posts: 7,268
Default

Quote:
Originally Posted by Genx87 View Post
Is it really that difficult to multi-thread these games these days? Shouldnt tools and newer compilers help with this now? It isnt like multi-core CPUs are something new. We are coming up on nearly a decade since they showed up for consumers.
It's got more to do with the underlying logic and design of the software than tools and tech. You can't really just flip a switch and say "ok it's multi-threaded now", kind of like how you can't just take code and run it off a GPU instead of a CPU.

Interesting overview at the difficulties that lie in multicore programming.
__________________
heat ebay
oppa gangnam style
darkewaffle is offline   Reply With Quote
Old 01-30-2013, 10:53 AM   #10
Olikan
Golden Member
 
Olikan's Avatar
 
Join Date: Sep 2011
Posts: 1,822
Default

woot... not even the very popular, separated core for the sound
Olikan is offline   Reply With Quote
Old 01-30-2013, 11:18 AM   #11
PowerYoga
Diamond Member
 
Join Date: Nov 2001
Posts: 4,253
Default

Quote:
Originally Posted by Genx87 View Post
Is it really that difficult to multi-thread these games these days? Shouldnt tools and newer compilers help with this now? It isnt like multi-core CPUs are something new. We are coming up on nearly a decade since they showed up for consumers.
Multi-threaded programming is difficult in general. The technology is there but the logical concept is difficult, and it's very hard to get the core code on 2 different threads executing and playing nicely with each other.

This is why most games typically offload components to other threads like graphics rendering, sound, etc. Stuff that doesn't affect core logic much. Core logic is typically all on a single thread because its easier to do and debug, especially for huge projects.
__________________
Your mouse has moved. Windows will restart to make the necessary changes.
PowerYoga is offline   Reply With Quote
Old 01-30-2013, 11:29 AM   #12
Acanthus
Lifer
 
Acanthus's Avatar
 
Join Date: Aug 2001
Posts: 19,916
Default

Quote:
Originally Posted by lupi View Post
And?
It has crippled the ability for the cities to be large.

Maxis has been fighting complaints about city size, citing performance.

And they've only had 10 years to develop it...
__________________
::Intel Core i7 2600K @ 5.0ghz (100x50) 1.400v ~ 47% performance increase
::2x4GB Mushkin DDR3-1333
::Gigabyte GA-P67A-UD3-B3
::XFX Radeon 6850 1GB
::OCZ Vertex 4 128GB
::Water Cooling - Swiftech Apogee GTX, Triple 120mm rad, 120GPH pump

Last edited by Acanthus; 01-30-2013 at 11:33 AM.
Acanthus is offline   Reply With Quote
Old 01-30-2013, 11:36 AM   #13
OVerLoRDI
Diamond Member
 
OVerLoRDI's Avatar
 
Join Date: Jan 2006
Location: San Francisco, CA
Posts: 5,199
Default

I could understand why this game would be really difficult to multi-thread, but I also see a definite need for more CPU power for this type of simulation. With city simulations the level of complexity is huge because there is so much overlapping dependencies. Because of those dependencies it makes multi-threading operations difficult.
__________________
TROOPER: Caselabs M8, i5 3570k, 16gb DDR3, 2x7970, X-1050
TARDIS: 750D, i5 2550k, 8gb DDR3, 7970, AX850, 8TB storage
CUBE: INWIN BQS656, Celeron something?, 4gb RAM, 32gb SSD
http://heatware.com/eval.php?id=73710
OVerLoRDI is offline   Reply With Quote
Old 01-30-2013, 12:12 PM   #14
BrightCandle
Diamond Member
 
BrightCandle's Avatar
 
Join Date: Mar 2007
Posts: 4,492
Default

Quote:
Originally Posted by OVerLoRDI View Post
I could understand why this game would be really difficult to multi-thread, but I also see a definite need for more CPU power for this type of simulation. With city simulations the level of complexity is huge because there is so much overlapping dependencies. Because of those dependencies it makes multi-threading operations difficult.
The way they have designed the simulation suggests they should be be able to use Agents to get a lot of parallel computation for much of the simulation and the hard stuff (The A* searches). However any updates that have to happen to the game world, like taking a job would need to be synchronised or also based on agents. So you could have 10's of thousands of agents at the core, one for every building, road tile, job and sim. It would potentially scale quite well but it would be a massively more complicated implementation.

Other strategies like Mirrors and immutable data structures wouldn't really be all that efficient for this sort of structure as its quite deep and wide in places, and the rate of update is frighteningly high per frame. When almost every data point is changing an immutable data structure is going to be inefficient for individual updates accumulated. Nice and easy to test but not good for getting parallel behavior in this case. You could also potentially split the world into 4 quadrants and deal with the synchronisation on the edges but the quadrants don't help much as anything that could cross the boundary needs locks.

Unfortunately I can't think of an obvious strategy they doesn't involve a lot of fine grained synchronisation points, which means it would be a nightmare to code this game with multiple threads. Its not a trivial problem as I think it through.

I have a simpler world simulation in development (lots of bouncing balls) and I can tell you its very difficult to multithread that reliably due to the interactions between them and I Simcity is much more complicated.

I am disappointed with the world size but as a programmer I can't see an obvious way to make this better with fine grained task or agent development nor immutable data structures. If I were in the dev team I would have thought hard about it and maybe I would work out a strategy but on the surface its not immediately obvious how you would do it. No general strategy would work across the entire game world, nor is there an obvious boundary for course grained threads.

To say concurrency and parallel computation is a challenge is an understatement, its basically impossible to get right but all the simplest of problems right now. The tools are just so primitive, most people have no idea how error prone it is to write software that uses many threads. I have seen a lot of bad multithreaded code and none that was good, literally zero lines. I suspect in the general case we will never find a solution, I suspect its impossible although I can't yet prove it.
__________________
i7 3930k @4.4, 2xMSI GTX 680, 16GB Corsair 2133 RAM, Crucial m4 500GB, Soundblaster Z
Custom watercooled by 2x MCR 320 and 1 MCR 480
Zowie Evo CL EC2, Corsair K70, Asus Rog Swift PG278Q
BrightCandle is offline   Reply With Quote
Old 01-30-2013, 12:14 PM   #15
dagamer34
Platinum Member
 
Join Date: Aug 2005
Location: Houston, TX
Posts: 2,540
Default

Quote:
Originally Posted by SunnyD View Post
Okay... so?

A casual game dev that's designing for greatest common denominator. Big deal.

For the record, MOST games are designed this way. Gameloop/logic in one thread, sound/physics/other in additional threads.
That denominator doesn't exist anymore. I don't think any system has shipped with a single core CPU in years.
__________________
15" MacBook Pro with Retina Display (Mid 2012) | Mac mini (Late 2012) | iPhone 5 | iPad Air w/ LTE
dagamer34 is offline   Reply With Quote
Old 01-30-2013, 12:17 PM   #16
ViRGE
Super Moderator
Elite Member
 
ViRGE's Avatar
 
Join Date: Oct 1999
Posts: 30,089
Default

Quote:
Originally Posted by Acanthus View Post
It has crippled the ability for the cities to be large.

Maxis has been fighting complaints about city size, citing performance.

And they've only had 10 years to develop it...
Keep in mind however that this is essentially a server-side game. It becomes a performance issue when they need to keep resource usage down so that users' simulations don't overwhelm their servers.
__________________
ViRGE
Team Anandtech: Assimilating a computer near you!
GameStop - An upscale specialized pawnshop that happens to sell new games on the side
Todd the Wraith: On Fruit Bowls - I hope they prove [to be] as delicious as the farmers who grew them
ViRGE is offline   Reply With Quote
Old 01-30-2013, 12:23 PM   #17
BrightCandle
Diamond Member
 
BrightCandle's Avatar
 
Join Date: Mar 2007
Posts: 4,492
Default

Quote:
Originally Posted by ViRGE View Post
Keep in mind however that this is essentially a server-side game. It becomes a performance issue when they need to keep resource usage down so that users' simulations don't overwhelm their servers.
It is not. The grand majority of the simulation is happening on the client, the only server side element appears to be the intercity very course attributes (rubbish in/out, power in/out) etc. That is only there to facilitate the always online DRM and to give the game some minor amount of multiplayer capabilities.
__________________
i7 3930k @4.4, 2xMSI GTX 680, 16GB Corsair 2133 RAM, Crucial m4 500GB, Soundblaster Z
Custom watercooled by 2x MCR 320 and 1 MCR 480
Zowie Evo CL EC2, Corsair K70, Asus Rog Swift PG278Q
BrightCandle is offline   Reply With Quote
Old 01-30-2013, 12:24 PM   #18
DaveSimmons
Elite Member
 
Join Date: Aug 2001
Location: Bellevue, WA
Posts: 37,128
Default

Most PCs shipped now are only dual-core, since laptops only get quad-core with an i7 and i3/pentium desktops are dual.

Writing a casual game with 1 thread for logic and others for sound, UI, etc. makes sense if you're targeting the masses instead of enthusiasts,

Even with perfect scaling you're only looking at less than a doubling of performance (because of other work for sound, graphics, etc.) not some 20x speedup.
DaveSimmons is offline   Reply With Quote
Old 01-30-2013, 01:58 PM   #19
Kalmah
Diamond Member
 
Kalmah's Avatar
 
Join Date: Oct 2003
Location: Michigan
Posts: 3,575
Default

The reason Cities XL is unplayable is because you can have a large city and it's single threaded.
__________________
Jump on my sword now, evil! For I won't be so gentle!
Kalmah is offline   Reply With Quote
Old 01-30-2013, 02:08 PM   #20
blastingcap
Diamond Member
 
blastingcap's Avatar
 
Join Date: Sep 2010
Posts: 5,811
Default

If you don't like it, vote with your wallet.
__________________
Quote:
Originally Posted by BoFox View Post
We had to suffer polygonal boobs for a decade because of selfish corporate reasons.
Main: 3570K + R9 290 + 16GB 1866 + AsRock Extreme4 Z77 + Eyefinity 5760x1080 eIPS

Last edited by blastingcap; 01-30-2013 at 02:11 PM.
blastingcap is offline   Reply With Quote
Old 01-30-2013, 02:18 PM   #21
HarvardAce
Senior Member
 
Join Date: Mar 2005
Posts: 233
Default

Quote:
Originally Posted by BrightCandle View Post
I am disappointed with the world size but as a programmer I can't see an obvious way to make this better with fine grained task or agent development nor immutable data structures. If I were in the dev team I would have thought hard about it and maybe I would work out a strategy but on the surface its not immediately obvious how you would do it. No general strategy would work across the entire game world, nor is there an obvious boundary for course grained threads.
I'll be the first to admit that I'm a novice when it comes to multi-threading, but there are easier ways to multi-thread and there are harder ways. The easiest ways are to split things into threads that are either fully independent of each other or are dependent only in specific and infrequent ways, or are unidirectional/asynchronous when it comes to information flow between threads.

Now, the question is whether anything actually fits one of those conditions that makes multi-tasking easier. While looking at two systems in isolation may make you think so (e.g. power agents and water agents), I can see how those each can affect other agents/entities that would end up affecting the other. For example, if the power agents stop feeding the water pump, now the water agents are affected. That said, it could be that the overlap or eventual child dependency is either well enclosed and can be properly synchronized, or judged to be of minimal significance and can therefore allowed to have a known race condition whose effect one way or the other doesn't have a large enough impact in the larger picture. In the example I gave, you could determine that if one or two more water agents get out the door from the water pump before the power agent affects the status of the pump, it's not the end of the world.

In short, I think the problem is more difficult than people expect (you can't just say "each agent is its own thread" and be done with it), but I also think you can simplify it in certain circumstances to gain some multi-threading capabilities without many of the common pitfalls associated with doing so. At that point, however, are the potential gains from a limited multi-threaded solution worth the additional effort?

Despite what everyone thinks about EA, I would imagine that they have some good software engineers working there who have evaluated this very thing and determined the answer is "no."
HarvardAce is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:51 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.