Brad Wardell's views about technology, politics, religion, world affairs, and all sorts of politically incorrect topics.
Published on September 5, 2006 By Draginol In GalCiv Journals

For testing the release candidates of GalCiv II 1.3 I've been playing all kinds of different sizes and scenarios.  In the process, I've been making tweaks and enhancements to the computer AI, uncovering mild logic bugs in my code and adding new abilities to try to keep the AI evolving as players evolve.  If you play at the lower intelligence levels, you won't see much difference but at the higher levels, players will likely see a significant change in the computer players with the final 1.3.

1.3 has a lot more re-balancing in it than previous versions.  Over the last several months, based on player feedback, we've made adjustments to how the game plays to improve the player experience.  But this has made some fundamental alterations of how the mechanics work that are sometimes subtle.  For instance, with 1.1, we made it so that you could only have 4 starbases in a sector. This change hasn't been really reflected in how we balance the starbase modules.  In 1.3, rather than starbase modules becoming increasingly more powerful (to encourage fewer but more powerful starbases) we now have a system where we know players won't build more than X starbases per sector so we could re-evaluate the numbers for the starbase modules in a way that we think will make the game more fun (it's certainly made it more enjoyable for me).  For example, building a starbase factory assist module no longer pumps out a piddly 2% improvement. Instead it does 5%.  But at the same time, the higher end factories aren't nearly as powerful.  But the important thing is that early game you can start to get an early boost.

What you're going to see is not going to be a complete game because it's being played on a Gigantic galaxy.  Instead, the goal is to watch how well the computer players play and see if they're doing things more intelligently now.

So what does "Allow AI to use CPU-Intensive algorithms" do?  Basically it allows the AI to design new ships more often and allows it to do some predictive branch analysis on what will happen in future turns. Does it make a huge difference in difficulty? Hard to say. It will mean more in Dark Avatar when I start to put in a lot more AI work. But I think it probably does make a mild difference. It doesn't affect Metaverse scores either way (so if you're really into maxing your score, you don't need to use it).

Here's an area that I did make a change today. It wasn't a bug fix per se but it might as well be one given how unintuitive the behavior was. The difficulty level was based on the intelligence level of smartest player.  So you could play a "suicidal" game where 1 player was really smart and the rest were set to completely brain dead. Then, once in, just set the galaxy so that the really smart one was in an isolated pocket while you fed on the easy players, then mop up.  One wonders how many "suicidal" games were done that way.  No more.  Now it's based on the average of the intelligences.

In this test game, I'm going to see how the Drengin, the Terran Alliance, the Altarians and the Torains do.  These are the 4 main AI personalities. The other players have derivative AIs (i.e. subclasses) of these 4. It's also why it drives me nuts when someone says "The AI did X" since it usually tells me nothing since there's literally 4 independent  (and even the others have their own code)  AIs in the game.  They ain't going to do the same thing. When I wrote them, I intentionally wrote them with very different algorithms. They may do similar things but not because the code's the same. 

It's a large galaxy after all...

Tight clusters, very large galaxy. I'm going to be cheating the whole game using the debugger so I can see everything they're doing at all times.

Opening Moves

The Drengin cranked out a factory and started a second one along with a scout and then started on a constructor since there's nothing good nearby (the constructor could be used to extend the range for the Drengin).

The Torians built a lab. Not what I would do but..

The Altarians have power built. On turn 3, they've got 2 factories and a research lab.  I'm looking into why they have 0 social spending right now.

The humans fast-buit a factory and then started on a second factory. They fast-built a scout and are now building a constructor.

As for me...

I fast-build a factory and a lab and start on a factory while building a constructor and a colony ship.

Watching the AI blindly send out scouts to see if it can find planets to colonize.

Turn 25

By turn 25, the AI has done a pretty good job on its home planets. Playing at "tough".


The Terran Alliance


The Torians


The Altarians


The Drengin

and for comparison -- me:

Their choices, other than the Drengin who built an Embassy, are similar to mine. I'm making a tad bit more money than they are but the Altarians are doing the best overall.

Me vs. Top players.  The Torians building that manufacturing planet really helped things as you can see.

End of first year

At the end of the first year each side is on its own unique strategy. Let's start with the Torians.


A pretty boring home planet but pretty effective. They could be making more money if they moved their taxes further up.


The Altarians have the right idea. This is probably the best home world right now overall. The Altarians don't get a second starting planet but they're doing well with the class 12 they get.


The Drengin are doing pretty well too. The embassy was an odd thing but still pretty impressive. They could stand to raise taxes further.


I have mixed feelings about the Terran Alliance.  They have their taxes up and are making some good money but they're clearly out of money. They could also stand to focus more on colonizing or else they'll lose some real opportunities.

 


And for comparison. I think it's safe to say that in terms of home planets, I'm doing the best. I have the highest income of any of them right now. Of course, I also made some different set up choices to have better morale.  The challenge is always translating "duh" strategies into a fast algorithm that doesn't do "stupid" things in other circumstances.

I'm doing pretty well overall.

End of Year 2

By the end of the second year, I'm doing pretty well. (gray line).

The Terran Alliance AI is clearly the weakest at this piont. It had the best starting position and is still blowing it.  So I'm looking into that.

Now I'm going to sit back awhile and see how the players handle themselves. Warfare should be particularly interesting because a good portion of my weekend went into making the AI more effective at waging war at higher levels. So in theory, they should be better at effectively wiping each other out.

Much later

By 2231, the Drengin are long gone.

The Terran Alliance have a small niche and the Altarains have their own corner of the galaxy. They all have friendly relations with each other at this point though the Torians could easily crush the humans.

Doing some analysis on what the AI has done..

While the Torians are dominating, I'm disappointed in a couple of the things they did.  First, while they are making a lot of money, they could be making a lot more. Their tax rate is lower than it could be. And they have a planet that they're not doing anything on. Why is that? (turns out they were just between turns).

Moreover, no starbases. I shouldn't say no starbases but very few. Resources are maxed out but there are very few economic starbases around. That's silly. With such a powerful military, the Torians should be shoring up their production.

I am generally satisfied with the AI's handling of their planets, however. While they may make a few different decisions, the overall results are pretty good.

 


Comments
on Sep 05, 2006
Thanks for all your work on the AI, it's very welcome!
on Sep 05, 2006
The amount of information you make available to the forums is appreciated. If this work is for a game update, I'm excited to see what you will have in Dark Avatar.
on Sep 05, 2006
Thanks for all your work on the AI, it's very welcome!


I second this. Since the original version of the game to 1.11 to 1.2 the AI has got better. It provides a constant challenge, if I do not concentrate or be lazy with my turns, I will regret it later when the AI stomps me.  Never seen another game before where the AI (Arceans at the time), ruthlessly destroyed everyone of my ships, starbases in less then half a dozen turns...ouch!  

The Terran Alliance AI is clearly the weakest at this piont. It had the best starting position and is still blowing it. So I'm looking into that


This has been noticable throughout GC2, from the original version to 1.2. U say there r 4 main AI classes with subclasses. Would the Thalans, Drath or Iconian Refuge be a subclass of this main AI script? I ask because all those 4 AI's (Terran alliance included) have always been easier to play against. They r no where near as aggressive as the other AI's, seem to expand slower as well. I call them the 'chilled' out AI's, they r half hearted in there conquest of the galaxy.  

the AI has done a pretty good job on its home planets


Since the start of 1.3, AI planetary development has improved considerably, I would say u have done a really good job here. I would have rated it has poor, now I rate it has very good.

The difficulty level was based on the intelligence level of smartest player. So you could play a "suicidal" game where 1 player was really smart and the rest were set to completely brain dead. Then, once in, just set the galaxy so that the really smart one was in an isolated pocket while you fed on the easy players, then mop up. One wonders how many "suicidal" games were done that way. No more. Now it's based on the average of the intelligences.


Glad u have fixed this. However in all my suicidal games, all opposing AI's were really at ultimate intelligence/unknown relations. Did not even know u could do this till now. Strictly no cheese...

Keep up the good work.

on Sep 05, 2006

This has been noticable throughout GC2, from the original version to 1.2. U say there r 4 main AI classes with subclasses. Would the Thalans, Drath or Iconian Refuge be a subclass of this main AI script?

The Thalans, Drath, and Iconians are derivatives of the Terran Alliance AI. 

on Sep 05, 2006
Glad u have fixed this. However in all my suicidal games, all opposing AI's were really at ultimate intelligence/unknown relations. Did not even know u could do this till now.

Same for me. Oh, all those missed opportunities!
on Sep 05, 2006
I have alot of questions, but one in particular that drives me nuts. What poses the AI to build an influence starbase in the middle of my territory, when they complain about the slightest "build up" that they percieve from me? (I am playing 1.2). I mean, I am unable to remove it without a war, so is it a sign from them that they want war???
on Sep 05, 2006
I'm curious about one thing: Do you have a favourite AI? Or one that you consider hardest to play against?
on Sep 05, 2006
I'm curious about one thing: Do you have a favourite AI? Or one that you consider hardest to play against?


I would guess that Brad/Frogboy's/Draginol's favourite race is the Drengin. Reasons r they (stardock) have a strong bias for evil in GC, probably the most original GC race, all the packaging has images of the Drengin on them, the stories centre around the Drengin (and the Terrans of course) and its had the strongest AI from the start of GC2 (in my opinion). Of course I could be wrong, as the Terrans feature heavily as well (worst AI however), this is probably due to a hangover from GC1 where u could only play the Terran alliance, so no need for AI code for the race.

My personal fav. is the Altarian's, they r just mad...at pretty much everyone...good race, yea right, exactly the same way the Vorlons were a 'good' race.
on Sep 05, 2006
Regarding the Torians and starbases, I've noticed in general (in 1.2, mind, but this sounds like the first major re-work of the AI coding since then, of course, I'm relatively new here so I might be utterly horribly wrong ;>P) that I don't get to blow up as many green starbases as other colors (especially blue- one thing the Terrans are good at is attempting to slow down their destruction by offering tasty underdefended starbases, including at times putting them in really odd places, like economy bases near a system I hold. Yeah we're on friendly terms and all but not allied so even "giving an ally UP-induced aid" covers that... I'd go for a milbase or influencer as a big probe if that's what they're for). How does the AI decide when to put bases up? You make it sound like it should be able to make a correlation between relative power and having the time (and maintenance bill) to flush out their economy, but perhaps it spends more time looking for taxes to purchase with (I've noticed all the AIs seem pretty spend-happy at the shipyards, at least compared to my preference for high production with my budget for emergency buys and starbase upgrades) and views the cost of the starbase as less useful than the cost of Torian Defender 4228953?

It just seems to me that the AIs gear up for taxes/troops and seem to spend a lot of time buying ships (I rarely find high-industry worlds unless there were a lot of bonus tiles, and even then the 1.2 AI only seems really concerned about making proper use of food tiles... lots of labs on precursor mines and stuff like that. This is at across-the-board "Challanging"), and econ bases usually only seem to crop up along trade routes.

As an aside to all this third-guessing the way the AI is written- is it at all exposed for modifying? That's one thing I haven't noticed (mainly as I haven't looked yet), it'd be interesting to see how it is set up to deal with certain things. One thing I DID notice is that if you're playing around with the improvements and you remove the upgrade target for something, the AIs won't upgrade it themselves (like, say, having factories not override basic factories so early pursuit of the industry techs doesn't lead to super-slow colony development- all of the AIs' "early" worlds still had basic factories sitting around during the "let's research tech victory just for the heck of it" stage of the game), made me wonder if I could go in and re-wire the behavior a bit so it could pick between several options like that so a convenience tweak like that wouldn't be so devistating).
on Sep 05, 2006
The Thalans, Drath, and Iconians are derivatives of the Terran Alliance AI.


That's interesting. Why would it be that the first three (Terrans, Thalans, and Drath) always stop expanding after they have colonized a few systems, but the Iconians often become a decent-sized power and sometimes really kick butt?

I wish the first three would not behave the way they do. It always makes me feel a little sad when I roll over a faction and take all of their planets in one turn.
on Sep 05, 2006
In regards to Economic starbases- I noticed in the most recent build of 1.3 (beta 3) that when I harvested an Economic resource it seemingly made no difference to my economy or provided any bonuses. Where should I look to find this? Perhaps the computer AI realizes this as well...
on Sep 05, 2006
The Thalans, Drath, and Iconians are derivatives of the Terran Alliance AI.


That's interesting. Why would it be that the first three (Terrans, Thalans, and Drath) always stop expanding after they have colonized a few systems, but the Iconians often become a decent-sized power and sometimes really kick butt?

I wish the first three would not behave the way they do. It always makes me feel a little sad when I roll over a faction and take all of their planets in one turn.


The Thalans are actually pretty hardy despite the AI because they can hold thier own and often the last to be conquered, they have become pretty strong in a few games.

The Iconians are generally content to only grab a couple of worlds and stay that way, for me thier military is generally weak and not a threat. I've never seen thier military become very strong

on Sep 06, 2006
When I play I tend to see the Torians building lots of large fleets (they seem to favour small/mid sized hulls) but few starbases. Maybe they need their priorities tweaking a little to use slightly smaller fleets but more starbases. At the moment they go ship crazy.

I'm surprised that the Thalan are using the Terran AI branch. I seem to always find that the Thalan have absolutely lethal missile tech. I cant figure out how they get such nasty weapons so fast but they seem to do it everytime. On the other hand they do have a knack for slow expansion. In my experience they either fail to expand and try to hold off invaders with weirdly advanced weapons (but not much economy to build/replace losses) or they manage to break out of their rut and wreak havoc. But usually they sit in their corner stroking their shiny warheads.

edit - thinking about it the drath can show similiar sit in the corner tendencies. The times they have become a threat they seem to have managed to build up undisturbed and finally gain momentum.

I'm now thinking that the Terran based AI's are slow starters attempting to build up slowly for a big end game. If they get hit early on or become boxed in by neighbours too soon they collapse and aren't aggressive enough to recover. If they get a quiet part of the galaxy to build up in undisturbed they can develop quite the power house over time.