What your multi-core system brings to computer AI

imageWhy are computer players so often so dumb? The answer is that we expect computer players to make complex, intelligent decisions super-fast.

When we make computer games, we know that players have a very low tolerance for waiting for computer opponents to “think”. Historically, that has meant that computer players either cheat like crazy or are play terribly (or both).

In one of the minor video game history footnotes, Stardock’s Galactic Civilizations was the first commercial computer game to have a multi-threaded computer AI. This meant that while the player was taking their turn, the computer players could generate their strategy in the background.

The last version of Galactic Civilizations came out 6 years ago and a lot has changed. These days, most people have computers with multiple cores. Dual-core. Quad Core. 6-core, etc. Each core is, effectively, its own CPU. When it came time to design the computer AI for Stardock’s upcoming Elemental: Fallen Enchantress, I had the opportunity to think about how to make of all these cores.

The result is that not only do computer players "think” while the player is taking their turn. It can “think” all the time because each computer players gets its own core (ideally) or at least is shuffled off onto another core. So your animation and mouse input and sound can play on various CPU cores and the computer players are explicitly sent off to other cores so that their thinking doesn’t slow down the game.

This extra CPU horse power matters because Fallen Enchantress is a fantasy strategy game. Fantasy strategy games are notorious for having terrible computer players because the number of choices a computer player faces every move is massive. Fantasy games usually involve having to cast spells, deal with units that have special powers, deal with Heroes/Champions who are leveling up or upgrading.

If you’re playing Diablo 3, or have played some other RPG, you can probably appreciate the challenge in deciding the “right” powers, abilities, and spells to use. Now, imagine having to make those decisions in less than 30ms. Now imagine having to do all that except instead of controlling one unit you’re controlling 1,200 of them.

It seems a bit ironic that it’s not first person shooters or other seemingly cutting edge games that benefit the most from these hardware advances but rather good old fashioned strategy games. Smile

50,785 views 17 replies
Reply #1 Top

So The Fallen Enchantress is going to be multithreaded, am i reading this right? And you cant do the same with Rebellion why exactly? 

Reply #2 Top

Quoting Timmaigh, reply 1
So The Fallen Enchantress is going to be multithreaded, am i reading this right? And you cant do the same with Rebellion why exactly? 
End of Timmaigh's quote


Because Fallen Enchantress was designed, from the beginning, to support multithreading. It also has different requirements (e.g. no multiplayer). Implementing a multithreaded program isn't simply a matter of taking a single-thread, sequential program and "multithreading" it.

Reply #3 Top

Hooray for multi-threading!!!  I finally get to work my hexa-core machine with a game.  (Much more enjoyable than video encoding).

Reply #4 Top

Why are computer players so often so dumb? The answer is that we expect computer players to make complex, intelligent decisions super-fast.

When we make computer games, we know that players have a very low tolerance for waiting for computer opponents to “think”. Historically, that has meant that computer players either cheat like crazy or are play terribly (or both).

In one of the minor video game history footnotes, Stardock’s Galactic Civilizations was the first commercial computer game to have a multi-threaded computer AI. This meant that while the player was taking their turn, the computer players could generate their strategy in the background.

                                                                                     o  o  o

It seems a bit ironic that it’s not first person shooters or other seemingly cutting edge games that benefit the most from these hardware advances but rather good old fashioned strategy games.
End of quote

This is fascinating stuff ... for people like me, who are not solidly, technically, oriented.  I really appreciate being able pick up (learn) these sorts of things, on this site.  As you explain it, it makes perfect sense; but in the absence of your explanation, I really would not have guessed these things.  Thanks for the education !

 

Reply #5 Top


It seems a bit ironic that it’s not first person shooters or other seemingly cutting edge games that benefit the most from these hardware advances but rather good old fashioned strategy games.

End of quote

This is what I'm saying all the time to my friends. They see FPS games that look amazing and wonder how much better computers we "really" need. But strategy games can put any development to good use. I mean, why 1200 units in TBS and not 120 000 units in real-time? Imho, the future of PC gaming is in hard-core strategy games. There's a reason they're already so much more fun to play than any FPS that has to lower itself to console standards.

Reply #6 Top

I'm going to be building a new pc in a month with 6 cores, 32gigs of ram and a 690gtx gpu with Win 7 (64 bit of course). Happy Brad? *_*

Reply #7 Top

Quoting TheProgress, reply 6
I'm going to be building a new pc in a month with 6 cores, 32gigs of ram and a 690gtx gpu with Win 7 (64 bit of course). Happy Brad?
End of TheProgress's quote

I don't know if Brad's happy but I'm jealous!

Reply #8 Top

Just makes me want to know when the next GalCiv is coming

Reply #9 Top

Indeed, it's about time :)

Reply #10 Top

Why not ask them to make the entire series from GalCiv 4 to 14 while you're at it?

:rolleyes:

Reply #11 Top

Quoting zigzag, reply 2

Quoting Timmaigh, reply 1So The Fallen Enchantress is going to be multithreaded, am i reading this right? And you cant do the same with Rebellion why exactly? 

Because Fallen Enchantress was designed, from the beginning, to support multithreading. It also has different requirements (e.g. no multiplayer). Implementing a multithreaded program isn't simply a matter of taking a single-thread, sequential program and "multithreading" it.
End of zigzag's quote

So does Fallen Enchantress have completely new engine from ground up? Is it not reused engine from some older game (Elemental?), just with reworked AI part to be multithreaded? 

I am not a programmer, therefore i ask.  

Reply #12 Top

The new GalCiv is being made by Amplitude Studios and will be out this summer. It is almost wholly a sequel. Bought damn time!

Reply #13 Top

Quoting Timmaigh, reply 11
So does Fallen Enchantress have completely new engine from ground up? Is it not reused engine from some older game (Elemental?), just with reworked AI part to be multithreaded? 

I am not a programmer, therefore i ask.  

End of Timmaigh's quote

Both Fallen Enchantress and War of Magic use versions of the Kumquat engine. From what I can gather, Kumquat was designed to support multithreading but not to the extent that it's implemented in Fallen Enchantress

Regardless, not all engines are equally suited to support increased multithreading. Depending on the architectures and algorithms used, Sins may be much more difficult to multithread.

Reply #14 Top

Quoting Timmaigh, reply 11

Quoting zigzag, reply 2
Quoting Timmaigh, reply 1So The Fallen Enchantress is going to be multithreaded, am i reading this right? And you cant do the same with Rebellion why exactly? 

Because Fallen Enchantress was designed, from the beginning, to support multithreading. It also has different requirements (e.g. no multiplayer). Implementing a multithreaded program isn't simply a matter of taking a single-thread, sequential program and "multithreading" it.

So does Fallen Enchantress have completely new engine from ground up? Is it not reused engine from some older game (Elemental?), just with reworked AI part to be multithreaded? 

I am not a programmer, therefore i ask.  
End of Timmaigh's quote

The FE code is vastly different from the Elemental code. The Elemental code was the basis for the FE code, but so much more has been changed than just reworked AI.

Reply #15 Top

Good A.I is about man hours and not multi cores.

Reply #16 Top

Quoting Heavenfall, reply 14

Quoting Timmaigh, reply 11
Quoting zigzag, reply 2
Quoting Timmaigh, reply 1So The Fallen Enchantress is going to be multithreaded, am i reading this right? And you cant do the same with Rebellion why exactly? 

Because Fallen Enchantress was designed, from the beginning, to support multithreading. It also has different requirements (e.g. no multiplayer). Implementing a multithreaded program isn't simply a matter of taking a single-thread, sequential program and "multithreading" it.

So does Fallen Enchantress have completely new engine from ground up? Is it not reused engine from some older game (Elemental?), just with reworked AI part to be multithreaded? 

I am not a programmer, therefore i ask.  

The FE code is vastly different from the Elemental code. The Elemental code was the basis for the FE code, but so much more has been changed than just reworked AI.
End of Heavenfall's quote

Why the Iron engine could not been changed in similar manner for Rebellion then? We have been hearing things like making Sins multithreaded, 64bit,etc... would be too much work, not cost-effective, etc... and now, out of blue, this is not the case with Fallen Enchantress... Why? Are they expecting to sell more copies of FE than Rebellion? Or, as Zigzag suggested, is it the thing, that reworking the Kumquat to be multithreaded is far easier thing to do than in case of Iron engine?

Reply #17 Top

 Its 2 different development teams. 2 different engines. And if thats not enough, i'm sure that the main reason why FE gets these things is cuz Brad wants em and he has alot of power in the company. If thats not enough, Brad is so bad at leadership he ends up doing all the work himself! 

 

I hope that soon that people will stop using XP and 32-bit and single-core cpus and we can start taking advantage of technology thats 10 years old when making games.