From technology to politics to video games; these are the random thoughts of a geek with too much time on his hands
I'm sorry Dave, I can't let you move that ship there.
Published on December 13, 2006 By Zoomba In GalCiv II News
One of the most touted features of Galactic Civilizations II: Dread Lords was the artificial intelligence, which can give even the best players a run for their money.  The AI was written by Brad Wardell, who took some time recently to write up some of his thoughts on the AI in the upcoming expansion, Dark Avatar, for an IGN Developer Diary.

It's an interesting look into AI and how technology like the new dual and quad core processors open up a lot of potential for better AI in games without causing noticeable performance hits.  Be sure to check it out!


Comments (Page 1)
3 Pages1 2 3 
on Dec 13, 2006
Very exciting developments. The inner workings will always come through, no matter how many layers of makeup they add.

---
on Dec 13, 2006
If my choice is to play a strategy game online against strangers or against computer opponents that play as intelligently and randomly as human players, I tend to believe I'd probably end up playing mostly against the computer. It doesn't disconnect or swear at me -- yet.


LOL! "It doesn't swear at me...yet" That would be funny to have the AI swear at you in Drengin!

Brad just took out the main Drengin fleet:
Lord Kona: "I hope you rot in QPUTE!!...you Vywrp!!
Brad Wardel: "What did the Develperes put in your mouth? I'll have to fix that!"
on Dec 13, 2006
A nice piece of text! I think that AI quality can't be brought to attention enough, both for developers and players (often unaware of "good AI" vs. "cheating AI").
on Dec 13, 2006
Even with my 1.99ghz CPU I am still interested. As it stands I can see AI opponents in GalCiv2 "thinking" even if they still have blind spots and get hung up on things (like having five battleships chasing my invincible freighter half-way across the galaxy and back).
The possibilities in terms of AI is what appeals to me in Turn-based strategy games. Extra system resources can be devoted to AI, resulting in more "thought" and deeper strategies. When I play Civilization IV I don't get the same sense of respect for the AI that I do with GalCiv2. Maybe it is the strategies, or maybe it is just the dialog. I don't know what you did, but you people sure did it right.

In all honesty I would fork over $20 just for an AI upgrade. I wouldn't do that for any other developer.
on Dec 14, 2006
Thats nice and all. But the reality is that the AI in GC2 isn't really doing a lot of the basic things that I would expect it to. Things that in my opinion don't take a super computer to figure out.

1) planetary management. There doesn't seem to be any solid feedback mechanisms or control of what is being built on planets. Often the AI sits and struggles to build anything since it doesn't decide to quick build a factory. (or manage the build queue what-so-ever) (like building PQ bonuses before other improvements)

2) there also doesn't seem to be any feedback in what planets are building when I start attacking. Building a new transport won't do them squat. When attacked, the AI needs to reconsider everything it's doing.

3) using autopilots deep into my territory is just silly, especially since I can see where they're going. Come on. You need to re-evalulate where those fleets are going on a turn by turn basis.

4) tech research. Is there any solid feedback in what the AI researchs vs what it needs as far as weapons and defense ? (or soldiering) Granted if you get into an extended conflict with the AI, by the time you conqueor it's last planet it will be using a small amount of the right defense... And soldiering, my god if I'm getting clobbered, researching just one soldiering tech can seriously slow that down, but the AI doesn't seem to care about soldiering.

5) Speed. Nevermind here. Supposedly a fix in the works for this. (may have to buy DA to see it though.) This continues to be a HUGE weakness for the AI.

6) Ship design. The AI doesn't redesign, or upgrade nearly enough. Often you'll see the AI popping out ships that are pathetic compared to what it could build. The mechanics of the game are that 1 good ship is better than 50 not quite as good ships. Fix the mechanics, or build the best ship period.

7) Economy. The Ai consistently fails to build a decent economy. (probably ties into why item 6 is a problem.) Look at any decent players strategy, and you'll see plenty of stock exchanges. The AI at most will build a few here and there. (and usually won't even get to stock exchanges on a normal tech speed)

8) Morale. How often do you see the AI do a good job of managing morale ? My 1k troop ships are usually all I need, because of bad morale, and even worse soldiering. Further bad morale generally implies lower taxes, weaker economy.

9) Defending resources. Supposedly it was decided that starbase defenses wouldn't be great, and that a fleet would be the way to go to defend a starbase. Fine, teach the AI this. (or make starbase defenses worthwhile)

What kills me, is these problems shouldn't take a super computer. The AI is amazing in what it does, but it just doesn't play using all the mechanics. I would personally think that just deciding how to move ships around (which it does amazingly well), would be orders of magnitude harder than any of these problems. These problems tend to scale with how powerfull you are, and therefore with galaxy size. I'm personally beginning to think that large/gigantic should be removed from the game. The AI just doesn't handle them. On smaller maps the AI plays much stronger, and these weaknesses are not as apparent. (esp at maso with all their bonuses)

The answer you always hear is, play at higher level. To me that is complete BS. The whole point of GC from the beginning is that AI played fairly. Above maso, for me, I can feel the AI's cheating and it just isn't fun. Before you go talking about how great quad CPUs are, why don't you take care of the some of these basic issues ?
on Dec 14, 2006
In all honesty I would fork over $20 just for an AI upgrade. I wouldn't do that for any other developer.


I concur. I'll probably forever be a fan of Stardock games, if for no other reason than because AI is so near and dear to Brad's heart. You probably won't find his dedication to improving the AI in *any* other strategy game on the market today, and maybe not ever again.

Now I just have to finally upgrade my bloody machine and get myself a quad-core....  
on Dec 14, 2006
Sounds interesting but I can't help but notice comments like, and I'm paraphrasing here, "when the majority of my playerbase gets the relevant hardware".

I trawl a lot of strategy game forums and I think we all realise that Brad is seminal in his approach to AI. He IS at the forefront of his craft every bit as much as Peter Molyneux or John Carmack, perhaps more so because their best work now seems behind them.
t
I see a lot of "in the future" comments, which is great but I'd like to know what is definitely in for DA as regards AI improvements. There was a list of "questions that the AI asks" that seems to have been included from the IGN article.

Are these definitely in? Will some of the AI improvements in DA be exclusive to multi-core CPU platforms?

Just to clarify my position: I'd pay £50 for an AI upgrade. Forget the gfx, forget mining, spies, etc., just give me a better AI

Brad: You clearly have you're business head on here, you're differentiating your offering from the market through enhanced quality. There IS a market for this. Keep up the excellent work!
on Dec 14, 2006
Gal,

I ask again, would you care to name a single strategy game of similar complexity which doens't cheat and does maximize its economy to peak efficiency given heavy change in circumstances? I doubt you can.

And I also have a feeling you have no clue what you are talking about as to how difficult it is for the computer to maximize its build strategy given changes in the tactical situation and given limited cpu ability; weak ships relative to ai tech has been stated over and over again to have been atleast partially a function of hardware limitations.

The only type of person who this would 'kill' would be a childish moron who has never played another single player strategy game and has a truly astounding sense of entitlement.
on Dec 14, 2006
Whatever. Without addressing such basic issues, you could have 10 super computers running and it wouldn't matter. That was my point.

I never said maximize, or peak efficency. I have a very old computer, and the game still runs hella fast so I don't buy the "hardware limitations" crap. If that's really true, i'd rather they took 30 seconds on the end of turn to do thier thing.

The reality is that the planetary management for the AI is a mess. You still regularly see planets with 4-5 factories, but no starport. (oh, but they do have an orbital fleet manager.) You never see the AI build economy worlds. WHY ? If this aspect alone was fixed, the AI would be much much stronger.

Brad has as much admitted that the planetary management code is a mess. (said he had to completely rewrite it for DA, and the guy who wrote it in the 1st place has left (or fired ? ))
on Dec 14, 2006
The point is that such 'basic' issues are not as 'basic' as you seem to believe. Building an specialized economic world? That would require the a.i. to have some awareness of the placement of their specialty worlds relative to an evershifting tactical threat; human players can easily defend such intricate planet set ups with their superior tactical ability, the a.i. has no such option.

The reason a.i. planet managment is so generic is because that is the build that brad or the former programmer has taken to work best given other a.i. limitations. Of course, it could always be better, but if it were really as basic as morons like you seem to think it is, it would have already been fixed, and the system wouldn't have had to be built from the ground up for DA.

My basic point is that your dumbass attitude that comes through with 'what kills me' is 'what kills me'.
on Dec 14, 2006
And might i add that just because you are willing to take a greater amount of time between turns for what would likely be a marginal at best improvement doesn't mean that the majority of players would, thus the need for technical advances.
on Dec 14, 2006
@gallagher

I think you're not understanding the difference between a new AI algorithm, and how an AI priorities things. The prioritizing is a set of values based on other values, and is a data change. The algorithm (which is the topic of discussion) is the actual development end. You could spend years trying to balance values and still not get them perfect for every given scenario. You could spend weeks writing a new algorithm and a couple more debugging it that would have a noticeable and significant impact right away.

Also, I've done some concurrent programing (in java not C++ like these guys write in, but logic is the same), and I will say that you don't necessarily need dual cores to do AI. Dual cores can really only be taken advantage of in Video rendering, since there is that much data to process, and you do *want* to use as much CPU as possible to get the job done quickly.

In this case, it's more of an urge to the gamers to upgrade their PC's. Not necessarily to meet the dual core standard, but to say, "Hey, look at this awesomely powerful top of the line stuff. That means there is older stuff that is more powerful than most of your PC's, maybe it's time for a budget upgrade."

A single processor has more than enough power (and he admits it) to run all these algorithms. I will say, though, that although hardware boosts can make a sloppy implementation look fine, a properly designed system is fully capable of taking on these tasks at a lower CPU level.

-Singleton design pattern on your thread manager, and possible memory sections that are allocated.
-Allocate fixed memory sizes for different threads.
-Share memory for threads that aren't likely to run simultaneously, avoiding starvation.
-Make sure your threads do not starve in the presence or absence of contention.
-Avoid making everything mutually exclusive. Yes, mutual exclusion improves accuracy on a shared resource, but always ask yourself the "Do the potential race conditions actually affect my end result"
-avoid excess in monitors. Semaphores are implemented by observer-observable, which is much less process intensive
-if applicable, if you can animate your solution and watch it, you may catch starvations you didn't see in the code
-diagram deadlock scenarios. don't waste precious processor power on deadlock detection
-Flyweight Flyweight Flyweight


just my 2bc, not condescending any developers
on Dec 14, 2006
The answer you always hear is, play at higher level. To me that is complete BS. The whole point of GC from the beginning is that AI played fairly. Above maso, for me, I can feel the AI's cheating and it just isn't fun. Before you go talking about how great quad CPUs are, why don't you take care of the some of these basic issues ?


I agree that the AI can be a little "frisky' when it comes to economy tweaks. I don't know, but they can get a 200% bonus to their economy when put on ultimate. I want them to play better with the resources they have instead of getting morew to work with.
on Dec 14, 2006
JubJub and Gal,

Simply, put, your standards are too high. It is unlikely any realistic a.i. update will have anything more than a marginal effect on difficulty. For those who do want some challenge the, are resource bonus is perfectly reasonable.
on Dec 14, 2006
Jasamcarl. Just go away. You haven't said anything of value.

n0v4k4n3, I get what you're saying. Don't get me wrong this AI handles things very well. Especially all the different starting conditions, tech mods, ect that you can throw at it. I have immense respect for what Brad has accomplished.

I personally don't see how some of the highly non-linear aspects of this game can effectively be weighted though. Some things probably just need to be scripted. (like building a starport, parking a fleet on your resources, sometimes quick building a factory here and there, etc)

Like I said before it may just be a matter of improving the AIs planet building skills that will be the key to fixing most of this. I'd love to see the AI at least prioritize what it's building/improving.

3 Pages1 2 3