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 2)
2 Pages1 2 
on Apr 09, 2006
Regarding the government techs- I'd like to see in the expansion events (mostly bad) that increase in frequency once you get to later governments...

As for scripting- I like the AI to have some variation in its tactics- but I always have the same research build for the first four techs- Labs, Xeno Comm, Universal Communicator, diplomatic relationships...
I also always rush-build at least two colony ships.

I guess I'm scripted.

I would like to see the AI understand victory conditions better- trying to stop research if they see someone building Discovery Centers, etc...

Also if the human is massacring the other races- try to go for a tech victory if they feel they have a shot at it...
on Apr 10, 2006
I almost never trade with others but I always research trade fairly early so that I can build an Economic Capital.


Don't get me wrong in most games trade is an almost essential path to take in Gal Civ 2. But not in this situation in a 1on1 prob small map, getting your pop levels up, production to build ships, equipment for military (impulse drive + weapons), transports and enough but not too much logistics are prioritys. Anything else is a waste of time and will prob end up giving the opp the advantage.

The ultimate goal for the AI's should be to evaluate the situation, decide the best course of action and put it into affect.
on Apr 10, 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.)


Right, and tactics are based on search algorithms and those are NOT script based.

Opening books are not as important as most people think they are. It's simply that historically, programmers have used opening books so they don't borther tuning their evaluation functions and search algos to handle openings. After all humans do the same, they memorize openings, so why shouldn't a computer benefit from that too?

Even then computers are no slouch without opening books. After all, it is easy enough to play a move not in their opening books and bring them out of book. And they still beat you! Still don't believe me? Turn off your opening books in Rybka,Fruit, Fritz, Chessmaster, Shredder, Crafty etc so they have no 'scripts' at all, and see if you still get thrashed

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.


Fischerchess or chess960 is a chess variant that is played with a random arrangement of pieces (not pawns), there are supposedly 960 possible positions so opening books become useless. It might or might not suprise you to know that computer engines that play Chess960 benefit more from this randomness than humans.

[Quote]
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.

I have to agree that is exactly the strength of Chess AI. It is not scripted. To simplify it a lot to the point of being somewhat wrong, It looks at all the possibilities it can , then it calls an evaluation function that tries to score each of the position reached. Then it decides which one it wants to go for.

From what little hints, I have seen, SD's AI is something like that, but given the HUGE number of possibilities, the fog of war, etc Stardock has a much more difficult task than Chess programmers, So what they have done is amazing!!!







on Apr 13, 2006
In v1.0X the AI does not value speed or sensors. Based what I have read (I have not played the v1.1 Betas) the AI now values speed but still ignores sensors. Speed, sensors, and attack strength (weapons and logistics) are key to exploiting the HUGE attack advantage. That is how I have won each of the Dread Lord's campaigns (to date, I'm currently winning on the one after Apocalypse) on level Tough without losing any combat ships. If you can see the enemy and have faster ships you can avoid stronger fleets and attack weaker fleets. By attacking you take the first shot and can often take out the enemy before he can fire. As you gain XP you level up and gain HPs.
2 Pages1 2