Advertisement
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION V > Civ5 - General Discussions

Notices

Reply
 
Thread Tools
Old Sep 19, 2011, 11:24 PM   #1
gladoscc
Warlord
 
Join Date: Aug 2011
Posts: 122
1UPT rules out multicore AI

The long turn speeds is because of one reason: 1 unit per tile.

In Civ 4, it doesn't matter if there is a unit on tile X. The AI can move units in any order, in parallel, and at the end check for collisions between different armies (combat). Think of it like this:

Core 1: Best move for unit A.
Core 2: Best move for unit B
Core 3: Best move for unit C
Core 4: Best move for unit D

Civilization V:

Core 1: Best move for unit A
Core 2: Cannot calculate, because unit A needs to move first otherwise there will be stacked units
Core 3: Sitting idlely
Core 4: Sleeping

Unit movement speeds have just quadrupled on a four core.
gladoscc is offline   Reply With Quote
Old Sep 20, 2011, 12:19 AM   #2
Menzies
Emperor
 
Menzies's Avatar
 
Join Date: Apr 2007
Location: Australia
Posts: 1,669
...so, which online university did you do your computer science course at?

Moderator Action: if you disagree with a user's post you are welcome to criticize/discuss the content of the post, attacking the user themselves is unacceptable. - ori
Please read the forum rules: http://forums.civfanatics.com/faq.php?faq=updated_rules_2011
__________________
The man said ,"I wouldn’t vote for you if you were the Archangel Gabriel", to which Menzies replied "If I were the Archangel Gabriel, I’m afraid you wouldn’t be in my constituency".

Last edited by ori; Sep 20, 2011 at 12:36 PM.
Menzies is offline   Reply With Quote
Old Sep 20, 2011, 12:51 AM   #3
GenocideBringer
King
 
Join Date: May 2005
Posts: 628
Quote:
...so, which online university did you do your computer science course at?
Harsh, but sadly true. OP, there's a thousand things wrong with your presumptions about how Civ IV works.
GenocideBringer is offline   Reply With Quote
Old Sep 20, 2011, 02:30 AM   #4
XRW175P6MQ4
Warlord
 
Join Date: Apr 2011
Location: Earth
Posts: 226
Quote:
Originally Posted by GenocideBringer View Post
Harsh, but sadly true. OP, there's a thousand things wrong with your presumptions about how Civ IV works.
Really? I only spot one thing wrong with OP's statements. Civ 4 doesn't use multi core processors. The game engine can only handle the one processor.
XRW175P6MQ4 is offline   Reply With Quote
Old Sep 20, 2011, 03:19 AM   #5
Talq
Chieftain
 
Join Date: Sep 2011
Location: Sydney, Australia
Posts: 5
If the AI in CiV worked like the OP thinks it does (and I know enough to know it doesn't), then one could note that his CiV AI could use multiple cores by the simple expedient of each core moving units in different areas of the map.
Talq is offline   Reply With Quote
Old Sep 20, 2011, 04:26 AM   #6
Windsor
Flawless
 
Windsor's Avatar
 
Join Date: Feb 2008
Location: Norway
Posts: 921
1UPT does make pathfinding require more resources (and therefore longer TBT), but it's not like the AI can't use multicore CPUs and having a quadcore instead of a dualcore will shorten the TBT.
Windsor is offline   Reply With Quote
Old Sep 20, 2011, 05:23 AM   #7
Crdnl Richelieu
Warlord
 
Crdnl Richelieu's Avatar
 
Join Date: Sep 2005
Posts: 137
One thing I've never understood is how Civ 1 on my Amiga was markedly quicker than Civ 5 is on a speedy PC. I understand that the game is more complex these days, but given the 1,000fold increase in processor power between the two PCs, I don't think the game is 1,000 times more complex.

Is it just laziness from programmers that they think they don't need to optimise things cos computers are so much faster and people are simply used to relatively long turn times?
Crdnl Richelieu is offline   Reply With Quote
Old Sep 20, 2011, 06:36 AM   #8
eris
Prince
 
eris's Avatar
 
Join Date: Mar 2004
Location: On this forum
Posts: 562
Empirical evidence argues against you. I can set up system monitors that report usage. The NVIDIA drivers seem to have a good report tool. It does show the system using all 4 cores in between turns. I am not saying they are being used efficiently, but they seem to be in use.

Your programming algorithm assumptions seem off to me. If the AI is already aware of a simultaneous turn algorithm for Multi Player, (however badly that may function) then there is nothing that prevents it from using that same code for in between turns on Single Player. Why invent two sets of AI codes?
__________________
If you aren't confused,
You don't understand
eris is offline   Reply With Quote
Old Sep 20, 2011, 06:41 AM   #9
GenocideBringer
King
 
Join Date: May 2005
Posts: 628
Quote:
Really? I only spot one thing wrong with OP's statements. Civ 4 doesn't use multi core processors. The game engine can only handle the one processor.
Well for one, the whole idea that he claims to know exactly how Civ's AI is programmed and presumes that one, single supposition to account for the entire turn delay difference between two different games.

But more than that...You don't move units X and Y independently. The best move for unit X often depends on where you're putting unit Y and unit Z. If it worked the way the OP suggests it would, then the AI would be completely incapable of using units in a coherent manner because they would constantly be moving all over the place.

Finally, it assumes that there are absolutely no other tasks at around the same time that could be done in parallel. If the AI is currently moving its units around, then it cannot think about anything else in its turn other than moving those units in that singular location around.


Quote:
One thing I've never understood is how Civ 1 on my Amiga was markedly quicker than Civ 5 is on a speedy PC. I understand that the game is more complex these days, but given the 1,000fold increase in processor power between the two PCs, I don't think the game is 1,000 times more complex.
Complexity is not a linear thing. Many things will increase the load on the processor exponentially or faster. When's the last time a duel map with 2 civs took any amount of time between turns?

Last edited by GenocideBringer; Sep 20, 2011 at 06:49 AM.
GenocideBringer is offline   Reply With Quote
Old Sep 20, 2011, 06:58 AM   #10
DavidCAD
Chieftain
 
DavidCAD's Avatar
 
Join Date: Sep 2011
Posts: 82
Quote:
Originally Posted by eris View Post
Empirical evidence argues against you. I can set up system monitors that report usage. The NVIDIA drivers seem to have a good report tool. It does show the system using all 4 cores in between turns. I am not saying they are being used efficiently, but they seem to be in use.

Your programming algorithm assumptions seem off to me. If the AI is already aware of a simultaneous turn algorithm for Multi Player, (however badly that may function) then there is nothing that prevents it from using that same code for in between turns on Single Player. Why invent two sets of AI codes?
While there are a few threads in Civ5 (game/AI, render, sound) only a single thread is running the AI, each AI action is a decision that depends on the previous ones. What your report tool is showing, beyond the render and sound thread, is the Windows kernel shuffling the AI thread between cores - this is normally a good behavoir (though it reduces the effectiveness of Intel's Speedboost unless there is enough load for all the cores) because it prevents one core from being run hard while the others sit idle.
DavidCAD is offline   Reply With Quote
Old Sep 20, 2011, 07:28 AM   #11
Psyringe
Scout
 
Psyringe's Avatar
 
Join Date: Dec 2001
Location: Berlin, Germany
Posts: 3,393
Quote:
Originally Posted by Crdnl Richelieu View Post
One thing I've never understood is how Civ 1 on my Amiga was markedly quicker than Civ 5 is on a speedy PC. I understand that the game is more complex these days, but given the 1,000fold increase in processor power between the two PCs, I don't think the game is 1,000 times more complex.

Is it just laziness from programmers that they think they don't need to optimise things cos computers are so much faster and people are simply used to relatively long turn times?
Civ1's AI was only quick because it was also abysmally bad. The AI of recent Civ games has not only to deal with much more complex decisions, it also can't get away any more with making as many bad decisions as the Civ1 AI did. Twenty years of computer games development have risen the bar of what's deemed acceptable. Unfortunately, very simple AI improvements may require lots of processing power.

Releasing a strategy game today whose AI adheres to the standards from 1991 ... would be like releasing a shooter with VGA graphics.

Last edited by Psyringe; Sep 20, 2011 at 07:31 AM.
Psyringe is offline   Reply With Quote
Old Sep 20, 2011, 07:47 AM   #12
headcase
Limit 1 Facepalm Per Turn
 
Join Date: Aug 2011
Location: Ontario, Canada
Posts: 1,038
Man... you would have each core working on a different facet of unit A. After that's done, each core would work on a different facet of unit B.

Or each core would in fact manage several units in tandem since they all have to take each other into account (ideally).

If anything 1UPT would make multicore more beneficial, I couldn't imagine a universe where it would make it less.
headcase is offline   Reply With Quote
Old Sep 20, 2011, 08:00 AM   #13
MkLh
King
 
Join Date: Jul 2008
Location: Finland
Posts: 835
Quote:
Originally Posted by gladoscc View Post
Civilization V:

Core 1: Best move for unit A
Core 2: Cannot calculate, because unit A needs to move first otherwise there will be stacked units
Core 3: Sitting idlely
Core 4: Sleeping
That's why it can't be done like that. A better way to do it would be more like:

Core 1: Best move for unit A partition 1
Core 2: Best move for unit A partition 2
Core 3: Best move for unit A partition 3
Core 4: Best move for unit A partition 4

That is, divine the path finding problem of an unit to four partitions that each take roughly the same time to finish.

Btw. the whole approach of calculating movement for one unit at a time, independently from movements of other units, is flawed if you want the AI to be competitive (although that is the way it's probably done, and that's why the AI throws its ranged units and generals in front etc.).
MkLh is offline   Reply With Quote
Old Sep 20, 2011, 08:21 AM   #14
binhthuy71
Emperor
 
binhthuy71's Avatar
 
Join Date: Nov 2003
Location: Southern California foothills
Posts: 1,849
Quote:
Originally Posted by headcase View Post
Man... you would have each core working on a different facet of unit A. After that's done, each core would work on a different facet of unit B.

Or each core would in fact manage several units in tandem since they all have to take each other into account (ideally).

If anything 1UPT would make multicore more beneficial, I couldn't imagine a universe where it would make it less.
As far as I know, Civ, like most games, isn't programmed to take advantage of SMP (Symmetric Multiprocessing). That means that it cannot take full advantage of multicore CPUs.

The main advantage, and the main perceived speedup from running Civ on a multicore machine seems to stem from the fact that hardware interrupts and CPU calls from other processes running in the background are less likely to deprive Civ of a CPU core.
__________________
If you need to look up one of our many Civ-related acronyms (UA, CKN, MPM, NC, etc) or terms try the Civ5 Guide to Acronyms and Terms.
binhthuy71 is offline   Reply With Quote
Old Sep 20, 2011, 08:24 AM   #15
dexters
Gods & Emperors
 
dexters's Avatar
 
Join Date: Apr 2003
Location: Canada
Posts: 2,522
Images: 3
Ironic considering that Civ5 is the first Civ game to take advantage of multi-core CPUs.

LOL.
dexters is offline   Reply With Quote
Old Sep 20, 2011, 10:50 AM   #16
Crdnl Richelieu
Warlord
 
Crdnl Richelieu's Avatar
 
Join Date: Sep 2005
Posts: 137
A couple of fair points re: the Amiga v Fast PC issue.

Although I will say this - I don't remember the AI being really bad in earlier Civs - especially Civ 1. Of course, I was obviously not as experienced as I am now - but I do remember being shocked and pleasantly surprised when I was playing a game on the highest level and all of a sudden, a supposed friend turned up on my doorstep out of the blue and took out my cities with battleships and tanks. I'm guessing this was because I'd recently shipped my entire army to the end side of the world to take out a mutual enemy.

I realise this isn't really representative, but I've never seen that in the latest CiV!
Crdnl Richelieu is offline   Reply With Quote
Old Sep 20, 2011, 11:22 AM   #17
GenocideBringer
King
 
Join Date: May 2005
Posts: 628
Keep in mind that whenever you add new mechanics, the AI has to be taught to use them. Even back in the 90s, a computer was able to beat one of the best chess players in the world, because Chess is fundamentally a simple game. Even with such a simple game, the AI that beat Kasparov was run on an extremely powerful supercomputer.

Civs 1 and 2 were far simpler, as far as number of mechanics goes, than Civ IV or V. Creating an AI that can properly take advantage of all of these mechanics is going to be way, WAY more demanding on the processor. It's not that the Civ V devs are just incompetent at designing AIs, it's just that there's a limit to what modern processing power can do and any AI improvements need to be done with that in mind. A good human player in a game with as many mechanics and nuances as Civ V is going to rape the face off of any AI that could actually feasibly run on a modern computer. What you're seeing isn't the Civ V devs being incompetent, it's the limitations of AI.


Of course, the AI can still be made better - it can always be made better. It's just that the idea of a truly intelligent AI, being able to compete one on one with an experienced Civ player, is a pipe dream.

Last edited by GenocideBringer; Sep 20, 2011 at 11:30 AM.
GenocideBringer is offline   Reply With Quote
Old Sep 20, 2011, 12:23 PM   #18
dexters
Gods & Emperors
 
dexters's Avatar
 
Join Date: Apr 2003
Location: Canada
Posts: 2,522
Images: 3
Quote:
Originally Posted by GenocideBringer View Post
Keep in mind that whenever you add new mechanics, the AI has to be taught to use them. Even back in the 90s, a computer was able to beat one of the best chess players in the world, because Chess is fundamentally a simple game. Even with such a simple game, the AI that beat Kasparov was run on an extremely powerful supercomputer.
.

This is my biggest concern. Alpha Centauri is often lauded for its depth, but it had a lot of features the AI couldn't handle.

So features discussions always comes with issue on whether the AI can handle it. And the Civ franchise from III on has had a fairly mixed/positive record on this. On one hand, there is a stated commitment to provide symmetry between human and AI, on the other hand, gameplay preferences tend to create things like vassals, religion, right of passage agreements that the AI can't fully handle and can only be forced to use in a very restricted way.

Civ5 have issues where the AI get to do things, like taunt, ask for gifts, that human players can't do.

Those things always annoy me. But I think this will be a struggle we'll have forever as long as Civ is a commercially facing franchise that prioritizes sales and gratification of fans over fairness and total balance (ie: As Soren noted, providing some slack in the AI can give more fun than having a tight game that's restrictive ) But it's definately a balancing act, and I feel there's a tendency in the fan community to go completely for fun features and it's far easier to argue for vassal states,colonies and all that stuff than to say 'no we can't do it; let's imagine those same things more abstractly using known limitations and taking into account what the AI can handle'
dexters is offline   Reply With Quote
Old Sep 20, 2011, 01:26 PM   #19
Psyringe
Scout
 
Psyringe's Avatar
 
Join Date: Dec 2001
Location: Berlin, Germany
Posts: 3,393
Quote:
Originally Posted by Crdnl Richelieu View Post
I don't remember the AI being really bad in earlier Civs - especially Civ 1. Of course, I was obviously not as experienced as I am now - but I do remember being shocked and pleasantly surprised when I was playing a game on the highest level and all of a sudden, a supposed friend turned up on my doorstep out of the blue and took out my cities with battleships and tanks. I'm guessing this was because I'd recently shipped my entire army to the end side of the world to take out a mutual enemy.
Well, the biggest advantage of Civ1's AI is probably that it was played against by people who didn't yet understand AI programming well enough to peek behind the curtain.

Civ1's AI had a line in its code that literally said "If the year is 1900, and if the player is in the lead, attack him." It was very crude. But most players simply didn't have the necessary experience to evaluate an AI and attributed a level of reason to it that was far beyond the real thing. In your example, you "assume" that the AI had a good reason for its decision, when in fact it may just have triggered the very crude line of programming I quoted above. (Actually I doubt that the Civ1 AI had any concept about where the player's armies were, but I'm not 100% sure.)

Another example is that Civ1 tried to bring trailing AIs back into the game by gifting world wonders to it. It's blatant cheating, but as players, many of us assumed that the AI had actually built that wonder, when in fact there was just an algorithm that decided "This AI has fallen behind, I'll grant it a free world wonder so that it can catch up."

If such an AI were released in a modern strategy game, people would criticize it heavily. They would recognize (and rightfully criticize) that an "attack player when he's leading" algorithms devaluates peaceful approaches - no matter what you do, the AI will eventually be out to get you, even if you were partners for millennia, even if it's against the best interests of the AI. They would also identify the "free world wonders" as blatant cheating (in hindsight, it would have been easy to identify in Civ1 too, as the AI often "built" wonders in cities that had no way of providing the necessary amount of shields).

This can actually be seen in players' reactions towards the Civ5 AI, which in several ways was a step backwards to the Civ1 AI (at least on release, I don't know if and how much it has improved by now). But exactly the same things that were okay for Civ1's AI were heavily criticized in Civ5, and rightly so. It simply isn't acceptable to go back to the primitive and crude ways of AI design from 20 years ago (especially not if the AI _still_ takes a lot of time to process its actions, even on modern hardware).
Psyringe is offline   Reply With Quote
Old Sep 20, 2011, 01:42 PM   #20
Psyringe
Scout
 
Psyringe's Avatar
 
Join Date: Dec 2001
Location: Berlin, Germany
Posts: 3,393
Quote:
Originally Posted by dexters View Post
This is my biggest concern. Alpha Centauri is often lauded for its depth, but it had a lot of features the AI couldn't handle.

So features discussions always comes with issue on whether the AI can handle it. And the Civ franchise from III on has had a fairly mixed/positive record on this. On one hand, there is a stated commitment to provide symmetry between human and AI, on the other hand, gameplay preferences tend to create things like vassals, religion, right of passage agreements that the AI can't fully handle and can only be forced to use in a very restricted way.
Agreed. Alpha Centauri is a good example for a game that was full of interesting features, but the AI could handle only a fraction of them. Another example in the same vein is "Master of Magic": Great concept, amazingly diverse and complex features, but the AI couldn't grasp them at all and needed absolutely insane bonuses to offer a challenge.

On the other end of the spectrum, you have games like "Galactic Civilizations". The AI in these games works quite well, but the game was designed from scratch with the goal to be manageable for contemporary AI algorithms. As a result, the games end up as favorites of players who want strong AIs, but are criticized by other players for feeling bland and formulaic.

For the time being, if you design an AI, you have to find some middle ground between a game that's rich in interesting features and a game that features a strong, competitive, non-cheating AI. You can't have both. The best way of doing it is (imho) the way that Civ4 chose: Ship with a decent AI, but release the AI code so that the community can improve it. The casual players will be satisfied with the original AI, and the hardcore players (who won't be) are free to improve it.

(Side note: I think that even contemporary AIs _could_ be much better than they are if AI programming was seen as more important by game designers and especially publishers. But this is wishful thinking, as Jon Shafer revealed during that now famous talk round, in which he fully acknowledged that publishers have no reason to invest in a good AI as it wont increase their business. While I do disagree with this statement, it accurately reflects the current line of thinking among the people who finance game development.)
Psyringe is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION V > Civ5 - General Discussions > 1UPT rules out multicore AI

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



Advertisement

All times are GMT -6. The time now is 10:25 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR