Brad Wardell's views about technology, politics, religion, world affairs, and all sorts of politically incorrect topics.
What should the Drengin do?
Published on April 8, 2006 By Draginol In GalCiv Journals

The thing about programming a game you enjoy playing yourself is that as you play it, you can keep improving it. So this weekend I continue my never-ending quest to keep improving the computer AI in various ways.

I took care of an exploit today with regards to people "buying" resource starbases from the AI. It was way undervaluing them. 

For GalCiv II, I wasn't really involved on the diplomacy AI. That was a team effort. But since release, I've started looking at how to improve it.  So I've been trying to make it do better deals for itself and also be more reasonable with players on things it is likely to trade.  I'm hoping to eventually get APIs to color code each item in the list so that players can see how valuable each item is to the AI.

But tonight I've been doing a number of things such as updating the AI's "picks" to deal with the changes in 1.1's ability costs and political party choices. 

I think people will find the final 1.1 to be both more challenging at higher levels and more forgiving at lower levels.  Still not perfect, but IMO, the only people who are likely to be able to reliably win at levels above "intelligent" are either taking advantage of an exploit or have found some legitimate but missed loophole in the AI.

That's why the AI keeps needing to be updated.  In multiplayer, loopholes exist too.  But top players have to adapt.  In Total Annihilation, there was a cheese tactic called "Com napping". This is where someone would fly in with a air transport, pick up the enemy commander and then self-destruct the unit. Players would adapt. And so in GalCiv II, the computer AI has to adapt. Hence the updates which I suspect will continue for a long time.

That said, I do plan to eventually have an XML file that people will be able to use to tweak the AI themselves. But that's still in the future.

One of the hardest things for me to do is come up with effective ways for the AI to research tech.  I want to stress something that many people don't know: The GalCiv II AI is NOT SCRIPTED.  Most game AIs are scripted and people take great pleasure in "modifying" scripts.  But I personally find scripted AIs to have a very short lifespan.  I'll go one more step - scripted AIs are one of the reasons why people demand multiplayer in games.

Scripted AIs mean that the AI follows a hard coded set of rules to play effectively. But once the opponent masters the pattern, the game is over and will never be challenging again.  The GalCiv II AI has nothing like that.  I doesn't have any sort of expert system but it does work on a "Doing X resulted in an improved position and Doing Y resulted in a worse position".  My work is often trying to tweak the AI so that it knows better when something is good or bad for it.

So tonight I played my duel (Human vs. Drengin) wars. 

Here's what the AI researched and in the order:

  1. Space Militarization
  2. Xeno Engineering
  3. Xeno Engineering
  4. Planetary Improvements
  5. New Propulsion Techniques
  6. Xeno Economics
  7. Missile Weapon Theory
  8. Stinger
  9. Starship Defenses
  10. Ion Drive
  11. Xeno Communications
  12. Diplomatic Relations
  13. Trade
  14. Soil Enhancement
  15. Basic Logistics
  16. Impulse Drive
  17. Advanced Computing
  18. Armor Theory
  19. Titanium Armor
  20. Enhanced Logistics
  21. Research Centers
  22. Basic Miniaturization
  23. Planetary Invasion
  24. Titanium Armor II
  25. Advanced Logistics
  26. Titanium Armor III
  27. Impulse Drive Mark II
  28. Stinger II
  29. Expert Logistics
  30. Habitat Improvement

At that point I had beaten him.  An interesting set of choices that probably won't happen in a second game quite the same.

 


Comments (Page 1)
2 Pages1 2 
on Apr 09, 2006
I hope this is an error that you made and not something true, xeno engineering is listed two time.
on Apr 09, 2006
That said, I do plan to eventually have an XML file that people will be able to use to tweak the AI themselves. But that's still in the future.

Way cool!

I'm hoping to eventually get APIs to color code each item in the list so that players can see how valuable each item is to the AI.

That will be killer!

But I personally find scripted AIs to have a very short lifespan.

I agree with your opinion of scripts. Those games for me are very short lived. I stopped gaming for a while because of that trend.

Interesting to see the Drengi do research on non-military techs that assist their war effort fairly intelligently - looking at the list I bet you can almost tell when they were at war or peace.

on Apr 09, 2006
I want to stress something that many people don't know: The GalCiv II AI is NOT SCRIPTED.


Maybe it SHOULD BE

As tech trees go, yours isn't exactly complex. In fact, it isn't even a tech tree; it's an ability tree. You don't research "Nanotech Manufacturing"; you're researching Enhanced Factory and whatever else the Xeno Factory tech provides. You don't research something because it's there; you're researching the abilities and powers that the particular tech gives you. Worst case, you're researching some prerequisite to whatever improvement, ship part, starbase module, or civilization ability bonus that you're looking for.

So, it's hardly unreasonable for you to develop a simple list of techs that each AI needs to have early on. There's a right answer to the question of how long a Civ should go before getting Factories (as opposed to Basic Factories). There's a right

Now, after the very early game, the AI should start branching out. It should start developing needs based on the situation, and using tech research to fulfill those needs.

I have a "script" I use for research with my custom civ. Why? Because I know what I need irregardless of planetary bonuses or nearby habitable planets. Hell, some people have the first 10 turns of any game deeply scripted, to the point of knowing exactly how much of what to build/buy and where. And these people are very successful.

It's about making the AI reasonably difficult. And if an early-game script is the most effective way of doing that, then the AI should be scripted, despite your personal distaste for the practice.

AI's following scripts (as opposed to the term "scripted AI", which is typically used to be an AI driven by a scripting language. And scripting languages have C/C++ levels of expressiveness if not more) only becomes a problem with the script has downsides. Early-game scripts don't, because the right moves can be predetermined, as some people have done. Therefore, such a script is the right move, and trying to make the AI "feel" its way around the first few turns is only going to either waste your time (eventually, you'll hit on the algorithm that produces a good answer) or make the AI stupider than it needs to be.

I'll go one more step - scripted AIs are one of the reasons why people demand multiplayer in games.


You seem to have this chip on your shoulder with regard to multiplayer games. Where does that come from?
on Apr 09, 2006
I think people will find the final 1.1 to be both more challenging at higher levels and more forgiving at lower levels. Still not perfect, but IMO, the only people who are likely to be able to reliably win at levels above "intelligent" are either taking advantage of an exploit or have found some legitimate but missed loophole in the AI.


I desperately hope this is the case, at the moment i'm playing at masochistic level. There are many tweaks needed to be made to the AI's because at the moment its huge bonuses aren't enough to make up for certain flaws.

The AI's biggest weakness in my eyes is its inabilty to focus on one thing. I don't just mean its splitting of production on social mil and research at one time which i believe to be a problem. It just doesn't seem to take steps to win the game whether it be cultral, research or conquest victory. It needs to realise how important certain resources are in these steps to victory and if it aquires say two cultral resources then a culture victory would be a good idea of focus. eg building up influence starbases next to weak worlds, building embassies and aquiring culture increasing wonders.

Research wise and colony wise it doesn't seem too bad now. Research wise it seems to be obsessed with maxing minitarization even taking 20 odd turns to complete a tech when theres plenty better it could be doing. I don't even think the AI's are using all the space on there ships in at least beta 2. They all seem to be building the same non optimum obsolete ships. Farms are not always built when they should be which is an issue.

The true test for the AI's is militarily. When the AI's can build ship designs nearly as good as me, use there ecomonic bonuses at higher levels to build a bigger fleets than me and focus those fleets at decent objectives eg planets not worthless range starbases and suchlike. If its winning to focus its strength at the weak point and not give up until it takes those planets and can defend them then you will have a good enough AI.

Hope my post doesn't seem critical, I love Gal Civ 2 it's the best turn based strategy game i've played. The AI is just so important to make it a fun challenging game which you obviously realise. I know the AI will never be able to think just hope you can fool us in to believing it can.

good luck

Lenius.
on Apr 09, 2006
I noticed that he researched stinger II very late. I would have researched it much faster, especially when I'm in 1 vs 1 and I'm the Drengin...
on Apr 09, 2006
Maybe it SHOULD BE


I agree. Chess AI is also purely scripted in the OPENING. Why? Because it is stronger then. And in contrast to Brad the programmers of the chess AI admit that the strategical part of their AI is still retarded. (Chess AIs are able beat humans in strategical sound positions because of TACTICS.)

You seem to have this chip on your shoulder with regard to multiplayer games. Where does that come from?


These repeated justifications become more and more boring. And I think it is even wrong since scripting isnt bad when you know what should be scripted. See alfonse's post.
These justifications just mobilize the SP fans against MP extension here. That's all. It is obviously counterproductive when Stardock has really a MP extension in mind. And thats why I doubt that there will be a MP extension.

Even when MPfans disagree most of them already ACCEPTED Brads decision. They just want finally the option to SIGN UP for MP EXTENSION. IIRC Stardock claimed there will be the option to sign-up the MP extension after release. It seems they wanna wait until most MP interested fans have left their board.
on Apr 09, 2006
You seem to have this chip on your shoulder with regard to multiplayer games. Where does that come from?


I don't think you understand what Draginol is saying here. Scripted AI's, once your learn the patter they follow, are damned easy to beat. Once you create a single strategy that beats the script there is no need to refine you own strategy.

I think, i don't know, that the AI in Gal Civ2 uses a more complicated decision matrix that adjusts for the current situation. It also seems to throw some randomness in there just to throw things off a bit.

What Draginol is saying here is others games seem to be a tad lazy with their AI, they simply write a script and the items are built or researched in that specific order, necessitates the need for multiplayer to keep the game interesting.

With Gal Civ the AI is a bit more sophisticated and the result is multiplayer is not as much of a requirement.

In addition each patch that Stardock comes out with seems to adjust the AI and make it even more sophisticated and keeps the game interesting.

In all honesty this is by far, in my opinion, a better approach. I think it is far better for Stardock to spend its time adjusting and improving the AI than to build a multiplayer interface.
on Apr 09, 2006
I agree. Chess AI is also purely scripted in the OPENING. Why? Because it is stronger then. And in contrast to Brad the programmers of the chess AI admit that the strategical part of their AI is still retarded. (Chess AIs are able beat humans in strategical sound positions because of TACTICS.)


Chess also has a defined starting state (i.e, not a random map) and a finite number of possible choices. It's not the same thing at all.

And Frogboy's point is correct - if they made the early game AI use a script tomorrow, it'd seem more challenging for a few days, maybe even a few weeks. Then you'd figure out what that script is, exploit it, and be back here complaining the AI is too easy again.

Even if somehow they managed to come up with the "perfect" script that could not be exploited - would it really be fun? Right around when my actions become like that script is when I stop playing most strategy games.

on Apr 09, 2006
One improvement I would like to see in tech research is that instead of neutral races now researching Invention Matrix which costs 2000 rp, they should be more likely to research Xeno Ethics (if they haven't already done so) and Neutrality Learning Centers for 1200 rp. NLC costs the same to build as IM, has the same maintenance but can produce 6 more rp/turn. So it's a superior strategy and it would be nice if the AI had a high probability at intelligent level to do this.

It would be extremly cool if all different alignment AI:s could understand when they could take advantage of Xeno Ethics. A good AI for example would research Xeno Ethics if he had need of superior defenses and already had the prequesites for it. An evil AI would do the same once he could research his evil weapons.

I took care of an exploit today with regards to people "buying" resource starbases from the AI. It was way undervaluing them.

Excellent. Please also fix so that they stop give away starbases to other players when they want to help their war-effort. I sometimes see an AI give all it's resource starbases to another, that should never happen.

I think people will find the final 1.1 to be both more challenging at higher levels and more forgiving at lower levels. Still not perfect, but IMO, the only people who are likely to be able to reliably win at levels above "intelligent" are either taking advantage of an exploit or have found some legitimate but missed loophole in the AI.

Like the fact that all AI:s in all my beta games have so far used the exact same weapons and defence.
https://forums.galciv2.com/?ForumID=162&AID=112056
on Apr 09, 2006
You seem to have this chip on your shoulder with regard to multiplayer games. Where does that come from?


It's not a chip, it's that he's the AI guy. People want multiplayer because Ais usually become too easy to beat or too predictable pretty quickly. If you could make an AI that walked like a human and talked like a human then the wish for multiplayer would die a death pretty quick. It's his job to provide an experience good enough to make multiplauyer redundant, and while there isn't the power behind AIs to do that right now, it's his job to give it his best shot.

He's also correct about scripted AIs. They are a dead-end and AI programmers should be moving away from them. Humans don't work like a script unless they discover an exploit, and code written in the manner Brad is speak about should end up doing the same thing if it found a combo more powerful than any other.

The next logical step for GalCiv3 would be for the AI to actually learn from game to game what works and what doesn't. This is an advantage the player has which the AI simply does not match. Brad isn't involved in every game, and he can't exploit a players personal weakness like a learning AI installed on that computer could. Of course, making a good learning AI is insanely hard. IMO, it would need to be a combination of a cluster dedicated to having AIs war each other with various combos finding what beats what in what circumstances, and every client game reporting back its results and a log. If all this fed back to a central database that could in some way interpret the results, it could then send out dedicated AI updates whenever someone connected, with all the latest tactics files for each AI. The more players playing, the better the AI becomes. You also take advantage of the advantage the PC has over the player: pure processing power. It also gives the AI its own forum effect, with them learning from one another, just like players camp on stratery boards.

On the other hand, making that reality.... ouch.
on Apr 09, 2006

I don't think you understand what Draginol is saying here. Scripted AI's, once your learn the patter they follow, are damned easy to beat. Once you create a single strategy that beats the script there is no need to refine you own strategy.

Precisely. I obviously don't have a problem with multiplayer games.  On the contrary, I was justifying why so many people want multiplayer.

My point is that many users have played so many scripted AIs that they feel that once they have figured out the "pattern" of the AI that the challenge is over.

A scripted tech tree would be a disaster because what techs it should research depends on all kinds of different in game conditions.  

For instance, in th game above, if I had been at war with the Drengin, they wouldn't have researched trade because there'd be no one to trade with.  In a game with say 5 opponents, if they're at peace and already strong militarily, then they're more apt to research economic or cultural or some other techs.

on Apr 09, 2006
For instance, in th game above, if I had been at war with the Drengin, they wouldn't have researched trade because there'd be no one to trade with.


To be fair they shouldn't be researching trade in a 1on1 situation anyway their aim should be to conquer there opp as quickly as poss not trade with them.

Noticed they researched defence v mass driver weapons, had you been researching mass drivers? If not it's a flaw the AI's should wait until there most likely adversary has commited themselves to a specific weapon line then counter it by researching the appropriate defence techs.

Lenius.
on Apr 09, 2006
Scripting wouldn't be so bad if they used multiple scripts. That would keep it from being too predictable. Someone used Chess as an example. Even though opening moves are scripted it doesn't play the same opening all the time; there's enough randomness in there to keep it from being too predictable. It also only follows an opening script to a point where it knows that such a script is proven sound. After that it switches to calculating its moves.

Most players have how they start the game basically scripted. I don't see where the first few research items being scripted would be a problem. Especially with 9 different A.I.s presumably using different scripts, and even possibly using multiple scripts for each A.I..

Would it be possible for the A.I. to keep track of how well it did with each research list, and try replaying the ones it did the best with? How about every once in awhile, one of the races copies the last research list of the human player?

on Apr 09, 2006
To be fair they shouldn't be researching trade in a 1on1 situation anyway their aim should be to conquer there opp as quickly as poss not trade with them.

I almost never trade with others but I always research trade fairly early so that I can build an Economic Capital.
on Apr 09, 2006
I can tell you why I can regularly beat the AI on intellegent and above. It is really because they do not value the government techs very much (or at least don't seem to), so they don't get them until late in the game. The earlier you have the Star Republic, Star Democracy, and Star Federation, the more advantage you will have. Each of these gives you an additional 25% to all of the major categories - so the earlier you get them the more powerful you will be.

That being said, my suggestion would be to have some races try to get better goverments early, because it gives them a great long term advantage. Not all of them would need to do this, as some may want to try a quick victory, but this is why I always have an advantage over the computer players. (That and Xeno Ethics, and a few other things but I only wanted to make one suggestion, and this seemed like the biggest thing that the AI could do to get stronger.)
2 Pages1 2