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

One of the most frustrating parts of the GalCiv AI for me has been the planetary improvements.  It is the single biggest piece of the code I didn't write and to be honest, my C++ skills are relatively basic. I'm an algorithm guy, not a particularly good coder. The result is, I've always had a hard time working on the improvement code because it's hard for me to understand (it was implemented as a quasi-SQL database as opposed to say a linked list or an array).

So anyway, while playing this weekend, I finally came to understand the single biggest problem with the computer AI with planetary improvements: It doesn't check to see if it is already building a super project or achievement on one of its other planets.

This is a pretty big deal because what will happen is that if it wants to build an economic capital, odds are, quite a few planets may have the same idea. But when the other planets try to put that into the queue, it gets rejected (without the AI knowing it).  As a result, during that entire time, the AI is building nothing.  So players would come across AI planets with hardly anything built.

Now, this doesn't stop the other pet peeve - the AI building stupid things on a planet (like 10 morale buildings or something).That, I still haven't figured out but I'm working on it.


Comments
on Mar 25, 2008
So anyway, while playing this weekend, I finally came to understand the single biggest problem with the computer AI with planetary improvements: It doesn't check to see if it is already building a super project or achievement on one of its other planets.


Is this why we might find that the AI placed structures like super projects on worlds that is less than ideal, or is it one of the leading causes?

In any case, it annoys me to capture a low quality world from my enemies and to find a research capital, or other like structures, on it without the bonus tiles needed to justify placing it on such a low quality world.
on Mar 26, 2008

One thing I would love to see a game like GalCiv do is make the AI user replaceable. Perhaps create an AI API that lets you build your own DLLs that the main game can call to get all AI decisions based on the state of the Univers (as it can see it).

I know it's totally impracticle, won't make you any money and in general probably not a good idea from a business standpoint.

A guy can dream, though.

Note: I know of games like Mind Rover and some of the other AI games that let you build your own and pit them against other peoples. As neat as those are, they aren't anywhere on the scale of GalCiv.

on Mar 26, 2008
Well, I hope that some of these improvements can be ported to a final version of Dread Lords.
on Mar 26, 2008
Oh damn, that might mean I'll need to step back down from obscene to... I think maso comes below it?

I can play obscene, hanging by my fingernails...
This will probably snap those clean off...

Good work!
on Mar 26, 2008
One thing I would love to see a game like GalCiv do is make the AI user replaceable. Perhaps create an AI API that lets you build your own DLLs that the main game can call to get all AI decisions based on the state of the Univers (as it can see it).
I know it's totally impracticle, won't make you any money and in general probably not a good idea from a business standpoint.


That is exactly what Civ IV did. (Well, the one in Civ IV also lets you change the gameplay rules also). Maybe this idea isn't as impractical as you think.

on Mar 26, 2008
Now, this doesn't stop the other pet peeve - the AI building stupid things on a planet (like 10 morale buildings or something).That, I still haven't figured out but I'm working on it.


I presume that the AI checks to see if the planet already has a morale building before it starts building?

Does the AI look at all the stats for the given planet and make a judgement call to say for example I have 100% morale and have two morale buildings, I may be able to upgrade one to give me more industry say.

Does the AI look at its research level for example to check if it has all the beam techs, once it has those convert all but one research building to industry???

Is there anyway for the community to help with the AI without your giving away too many of stardocks intellectual achievements?
on Mar 26, 2008
Hopefully there will also be a cure of the dreaded 'tech capital on an industry tile' syndrome. The proper buildings being placed on the proper tiles will be nice...with the exception of farms...

Also, the Thalan 'pink blob of doom' I think should be negated if the AI learns to replace buildings if they aren't needed or if more other buildings are needed.
on Mar 26, 2008
Wow, has this bug been there since DL? Great find there. This should toughen up the AI a treat!
on Mar 26, 2008
Nice find, Draginol. As a fellow coder (unfortunately, not video games) I know what an unexplainable relief it can be to find a solution to a nagging problem. Congrats!
on Mar 26, 2008
That would be a great improvement to the game. I did wonder about why some AI planets could be almost empty of improvmevet even in the late game. And, I think everyone has seen the AI doing the stupid-build thing. Even the 10 morale improvment one, but at least you can build over them. I once invaded a planet that nothing but manufacturing centers on it,like 8 of them, not even a starbase was built, so the planet was building a whole lot of nothing, fast. I still have the screen shot somewhere.

So once the AI builds better I'll have to tone down the difficulty level. lol.


As a side question here, is it possible for the program to recognize improvments that are on bonus tiles so that when it goes to upgrade due to a new tech it would upgrade those first? I usually go to each planet and adjust the queue so i get the structure on something like a 300% research tile upgraded before one on a blank tile.
on Mar 26, 2008
I'm wondering, does the random auto upgrade problem still exist? I haven't checked to see if it still does since it was too much of a pain to bother with. The problem is, you can place structures found in the old tab on worlds, but sometimes these structures will randomly decide to try to upgrade themselves every so often. It makes it a pain to try to develop new colonies using cheap, quick to build factories, only to find that they start making industrial sectors instead, turning a quick development process into a slow one and wasting all existing work done.

________________

Since we are talking about tile management at this point, do you think we can make a change to how terraforming works. At this time, tiles to be terraformed need to be in que before they they can be turned into usable tiles. Terraformable tiles, once done, turn into empty tiles, something that doesn't do you much good until a structure is placed into them.

Considering that these tiles might be selected while trying to choose what structures to build (happens on world you colonize after you get some terraforming techs), you may end up with a few terraformable tiles being placed into the que before useful structures like markets, or factories. Having structures like factories being built first helps in speeding up planet development, so you usually want them to be built before empty tiles.

________________

I have 2 suggestions:

----

1. Auto terraform when que is empty.

Since these tiles can get in your way when you have to place them in the que yourself, why don't we have an option for worlds that have empty ques to automatically start terraforming? The game should still let us know when its finished building everything else like it still does, but it should also let us know when it starts terraforming, and when its done.

----

2. Que terraforming by placing structures.

An alternative is to be able to que structure development by placing them on terraformable tiles. When the que gets to the structure in question, it will first terraform the tile, and then start building that structure.

This option would allow us to plan a planet up to the point we can currently develop it. We wouldn't need to come back to it just so we could add a few additional structures to it.

________________

Sorry if this is a long read. I can get on a roll sometimes.
on Mar 27, 2008

That is exactly what Civ IV did. (Well, the one in Civ IV also lets you change the gameplay rules also). Maybe this idea isn't as impractical as you think.

Wow. I wasn't aware that Civ IV had that. I knew the Civ series always had a large amount of modability, just didn't know they'd taken it to that extent. Guess it's time to dust off the disc and reinstall it.

on Mar 27, 2008
I'm wondering, does the random auto upgrade problem still exist? I haven't checked to see if it still does since it was too much of a pain to bother with. The problem is, you can place structures found in the old tab on worlds, but sometimes these structures will randomly decide to try to upgrade themselves every so often. It makes it a pain to try to develop new colonies using cheap, quick to build factories, only to find that they start making industrial sectors instead, turning a quick development process into a slow one and wasting all existing work done.________________Since we are talking about tile management at this point, do you think we can make a change to how terraforming works. At this time, tiles to be terraformed need to be in que before they they can be turned into usable tiles. Terraformable tiles, once done, turn into empty tiles, something that doesn't do you much good until a structure is placed into them. Considering that these tiles might be selected while trying to choose what structures to build (happens on world you colonize after you get some terraforming techs), you may end up with a few terraformable tiles being placed into the que before useful structures like markets, or factories. Having structures like factories being built first helps in speeding up planet development, so you usually want them to be built before empty tiles.________________I have 2 suggestions:----1. Auto terraform when que is empty.Since these tiles can get in your way when you have to place them in the que yourself, why don't we have an option for worlds that have empty ques to automatically start terraforming? The game should still let us know when its finished building everything else like it still does, but it should also let us know when it starts terraforming, and when its done.----2. Que terraforming by placing structures.An alternative is to be able to que structure development by placing them on terraformable tiles. When the que gets to the structure in question, it will first terraform the tile, and then start building that structure.This option would allow us to plan a planet up to the point we can currently develop it. We wouldn't need to come back to it just so we could add a few additional structures to it.________________Sorry if this is a long read. I can get on a roll sometimes.


Im pretty sure auto terraform is already an option through governers, but I like the terraform que idea.