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

Work log on AI for this weekend.

1) Adjust AI strategy for when g_pGalaxy->abGameOptions[GAME_OPTION_DISABLE_TECH_TRADING] == TRUE

2) Regarding speed of ships.  Player ignusss writes:

This is now my understanding of how the AI uses his different military shipclasses:
Tiny:
Fighter: No engines. Attacker.
Small:
Defender: No engines. Defending planets.
Heavy Fighter: No engines. Attacker.
Escort: Multiple engines (often see them with two). Defending transports.
Medium:
Frigate: 0-1 engines. Attacker.
Cruiser: 0 engines (at least I don't remember having seen any). Attacker? Defender? Maybe both?
Large:
Battleship: 1 engine (haven't seen any with no engines yet). Attacker.

No engines on defender is IMO fine. I have no opinion on no engines on fighter because I never build those. Heavy fighter would benefit from an engine though since the AI otherwise wouldn't have any fast attack ships before Medium hulls. Cruisers are okay as planetattackers if they have faster attackers screening their advance, would also be good defenders, otherwise probably not much use.
Now frigates should IMO always have one extra engine but they don't.

Here are the Drengins different generations of frigates that I could see in my current game (he has lots of old ships left as you can see):
gen. weapons. defense. speed
M2-2. missile+2.
M2-11. mass+2. 1*warp=+3
M3-4. mass+3
M4-1. beam+6. armor+1. 1*warp=+3
M4-10. mass+4. armor+1,shields+1. 1*warp=+3
M5-3. mass+5,beam+2. shields+2
M6-2. missile+8,beam+4. shields+2
M7-1. missile+12,mass+1. armor+2. 1*warp=+3

Sometimes he skips the extra engine in favour of more weapons/defense which is dumb if I'm correct about cruisers, because then it becomes identical to one.
I've noticed that the Terrans in the same game builds incredible many frigates, almost exclusive. This makes them IMO much more dangerous than the Drengin whom also builds lots of heavy fighters and cruisers. Even though the terrans military is much smaller.
And the terrans frigate M7-2 is so much fun
mass+24 (3 nanorippers) armor+2 speed+3
Almost as good as my best medium hull, the Death Dealer:
beam+24 (2 psyonic beam), armor+2, speed+6

I also noticed something odd with Drengins latest transport M5-3. It has 3 ion drives, 3 adv. troop mods and 1 extended support. It could have had 3 warp drives instead of the ion drives because they are both size 10 on a cargo hull which would have made his transports 6 parsecs faster per turn.

This is a good analysis overall of the AI's typical design desisions.  He also notes how different AIs have different strategies.  The Terran Alliance tends to go for larger, but fewer, ships.

The issue isn't so much the need for extra engines but better engine technology sot hat the engines aren't so big.  That's what I'm going to be testing.

3) Regarding planet use: Brillig writes:

Planet utilization:

The AI should place much higher priority on putting the appropriate building on special tiles. I would argue that nothing, no Galactic Wonder/Trade Good/Super Project is better than having a factory on a 700% bonus production tile, for example. The same for a 700% research tile (although I've never seen one). With regard to 300% tiles, the difference is a little softer. Personally, I would never put anything but the appropriate building on one of these tiles either (except for the food bonus tile).

I think the AI should begin to keep track of a parameter which I call the "state of colonization". This refers to how much of the galaxy has been claimed - it should be possible to come up with an AI estimate for this even without cheating based on using the galaxy map to look at influence.


No manufacturing/economic/research capital should ever be built on a poor (low PQ) world. As Brad said the AI isn't scripted, I believe it should be able to project, based on it's current situation, how the worlds under it's control will look like when fully developed. It should place the capitals based on that projection, with the likelyhood of actually doing the construction based on how close the "state of colonization" is to complete. Once a capital is built, the AI should have a bias toward building the appropriate structures (e.g. factories for a manufacturing capital) on that world. A small bias is probably fine, I don't think we need to see a fourteen factory+manufacturing capital world.

I agree with this.  However, I'm constrained by the APIs I have.  For instance, if the AI is putting super projects on 700% production tiles, then that's a bug. That should never happen.  The only time a super project or whatever might go on a special tile might be on a food tile.

But since people are seeing this, I'm putting in checks to try to understand why that would happen.

4) Regarding starbase placement.

Different AIs have very very different ways of handling their starbases.  Some of them are not nearly as good as others.  The Terran Alliance probably has the most sophisticated AI for handling this at this time.  I'm going to be improving all this  and trying to upgrade the other AI players as well.

Hopefully we'll see a much more effective use of starbases.

 

5) Tech Researching.

Each AI has its own values on what should be researched.  Based on feedback, I'm going to be adjusting these and seeing how much things improve in AI vs. AI games. This is going to be time consuming though to since what is the best techs and what order is tough. Moreover since the AI isn't scripted, there is no "Research this, then this, then this." Ironically, sentient human players are more likely to have scripted "research build orders" than the computer players.  Hopefully, human players will start putting their brain SDKs available for download.

6) AI fleet organization and concentration

I'm going to upgrade a couple of the AIs to send their fleets on patrol of their territory.  This should spread our their forces a bit and make them less vulnerable to human player tactics.

7) Working on AI to be better at dealing with enemy starbases.  One of the things that some people need to recognize about AI development is that it's easy to sit there and say "They AI should take out those military starbases." Well Duh.   But in the AI code, I'm dealing with weightings, numbers, priorities, and APIs that have to interpret my preferences.  For instance, as the AI designer, I want the AI to go after those starbases.  And I want the AI to recognize that it may have to sacrifice ships to wear it down. But at the same time, I don't want a death train of ships uselessly hitting a starbase either.  So much of what's been mentioned are things I agree with, it's just a matter of tweaking it so that it does it more.

So if I say if(pShip->IsStarBase) ulAttackPriority*=1.25 and that's not enough to get it to go after starbases effectively then it's a matter of chyanging it to say 1.50 or 2.0. 

Now before someone asks, no, we can't just have a file of weightings that people coudl tweak themselves.  I mean, yes, we could, but it would take a lot of time and different AI personalities have different methods. You'd end up with a situation where you'd be choosing between getting aI updates from us or relying on modders and my not so humble opinion is that you're probably better off with me doing the updates than relying on modders teaking values on a static AI.  After all, if I realize something's amiss, I can create new code to deal with it.

 


Comments (Page 2)
2 Pages1 2 
on Mar 20, 2006
Noticed some AI problems my last game. (At +2 up from normal on the largest map.)

1. AI sent unescorted transports out. Even attacked war ships with unarmed transports! LOL
2. AI did build poorly on some worlds.
3. AI left some good planets empty ! I got them MANY years into the game. (I had Icolony ships that moved 40+ parsecs a turn! That's how late they were empty.)
4. AI had slow ships as you note.
5. AI had large unfleeted stacks BUT that can be a decent delaying tatic if facing overwhelming odds. In order to clear way for the transports it takes an extra turn or two. So if it would have lost all the ships with them fleeted then makes sense to behave in that manner.
6. AI build defenders well (no engine ships for orbit)
7. AI left some resource nodes unmined even late game. (Probably only a problem on biggest maps.)
8. AI seemed to lack recon. (ie. It acted as if it had no spy info.)
6. Human AI built a TON of influance stations trying to fend off/capture from another AI race but never developed those stations. IT seems to look at only the gain from next add and not at future gains. (ie it looks at base station add and compares to first constructor add only. Thus it misses that later it gets much larger adds.)

Well, hope those are some things you can look for to tweek.

on Mar 20, 2006
The issue isn't so much the need for extra engines but better engine technology sot hat the engines aren't so big. That's what I'm going to be testing.


No, I'd have to say the problem is priority.

As mentioned, heavy hitters are fine when you are going after 'static' objectives. Speed is what enables you to attack first (a major advantage) & is what gets you to where it/you are needed.

I believe that the AI needs to treat 'speed' just like how it treats weapon technology. Just as the AI tends to research counters to the players weapons/shield, it should be also look at how fast enemy ships are able to travel and endevour to 'counter' that in some way (faster engines, starbase speed boost modules, etc).

(Of course, if the AI doesn't use that extra speed in the proper way, you've just made them easier targets for the human player )
on Mar 21, 2006
I would say #1 AI problem in combat is initiative . His ships are slow ,and that doesn’t allow him to takes active steps for interception of my attackers /transports. Nor he tries to conquer my worlds ,even if they are weakly protected. I think this can be easily solved by tweaking AI ship building to match /exceed one notch player’s ships speed (and if he cant match it for speed he should trade/research better engine technologies ,though in my crippliing/tough games Ai usually has all the neccesary technology). It is sad when AI keeps building 3 parsec fleets, when I am cranking out 15 parsec raid squadrons.

After that I think AI (or at least some personalities) should be tweaked to be a lot more aggressive . He should not let his fleets floating around without business , in order not to make suicidal attempts there were good suggestion to make AI pre- simulate fleet battles and only attack those he has chance to win , if he cant win vs superior fleet he should avoid it and proceed to attack weaker targets (that exactly what human players do).
Faster AI ships + initiative should solve the most glaring problems with AI’s inability to counter players hit and run tactic .

As of unprotected transports… -I don’t frankly see this a big issue. I myself almost never escort my transports , instead I put best possible engines(so they 1.5-2 times faster than my military ships) on them and accompany them with good AWACS ships – . The problem is AI’s has slow transports and he doesn’t seem to use sensor ships much (at least he behaves like he is blind) .Instead of bee-lining to my weak colonies with waves of fast transports he sends his snail-transports straight into monitored areas, which I intercept easily .
on Mar 22, 2006
Noticed something else in my current game (Normal intelligence):

I've progressed from a foothold in Torian territory to invading their inner areas. Along the way I've received several advanced weapon technologies. However, all of their ships have much lower tech weapons on them. The Torian economy is/was better than mine, though they have been involved in a few wars, where I haven't, but I still find it difficult to understand why none of the ships in orbit have their current technology.

Again, I just blitzkrieged 3 more systems; taking all 6 planets in those systems only 1 had more than 5B population.
on Mar 22, 2006
On the Starbase Threat issue:

Maybe you can define the threat of a military starbase based on the gains the affected fleets would gain.
Say: the starbase gives +1 Beam Attack
If there are 20 ships in the are I'm more likely interested in hunting down those starbases first.
Only 5 ships means maybe less interest in Starbase killing, since the benefit is smaller.

I guess you probably do that in the calculations but I'll suggest it anyway:
Starbase threat value divided by it's destroyability something.

Or:
Destroyability of fleets with starbase around COMPARED TO destroyability without starbase around + destroyability of the starbase...

Man I would love to do that kind of AI tweaking all day

on Mar 23, 2006
Please, if you report a 'problem' with the AI, make sure you play them at "intelligent" and this only happens at "tough" difficulty. Remember, if you play at the "normal" difficulty, not only is the AI only half playing against you (a lot of the subroutines are turned off), the AI is being penalized 25% of it's economy. Only at "intelligent" is the AI playing fairly against you.

As for me, while I find the AI a good opponent, there are four areas where I would like to see improvement (I generally play the AI on genius, just to give it an extra edge):

1. Trading: the AI just needs to be able to evaluate deals better. Then, it has to try to sell for more and buy for less. It's just too easy to rip the AI off with trading right now. That whole 200 BC for 300 BC is just classic. Techs, starbases, trade goods, it's just WAY too easy to buy these things from the AI, I have to literally NOT do this to keep myself challenged. This is probably the most serious concern.

2. Planets: this isn't really about tiles specialization, the only complaint about that is that I will see AI building morale building on a prestige bonus, and embasies on +300% research on the same planet (very odd, probably because they scrapped a lab for the embasy). Instead, what I mean is how the AI handles food/farm, morale, and economy buildings. For example, In my latest game (large, 6 opponents, painful) I will see the AI build 4-5 farms on a planet with zero morale building, and one econ building. This planet never grows past ~15B, the approval is too low, all those farms are wasted. Then, I will see planets on the fringe of being culturely conquered build 4 morale buildings, even though 2 of those have prestige bonus. This is obviously an attempt to keep people happy so they don't revolt, but that never works... it just takes a bit longer for the revolt to happen (in this case, I'm not sure 2 embasies on those tiles for a total of 4 will actually help, so it doesn't matter). If it was me? I'd either fill it with embasies and pray or trade it away to somebody NOT the guy who's about to culturely conquer it (the point is to set them against one another). As for the AI's economy... don't get me started, nearly everyone of their planets are at 5B people. IMO, unless your planet has some sick starship bonus and you want every factory slot, there is no reason why a planet class 7 and above should not have one farm. Not only does it make it that much harder to conquer, it nearly doubles your revenue for just one slot. This means farm>econ buildings. Heck, farm>economic capitol. The only time you should build trade center and econ capitol is on planets that have at least 2-3 farms. However, this could mean 5-6 morale buildings. To say that the AI runs its economy better than the player is just so... insulting . It's why I have to give the AI an extra 25% bonus to its economy. Here's to hoping that Brad turns it into a monster and make me go running back to intelligent.

3. Starbases: the AI doesn't seem to fully take advantage of the power of these things. Especially of note is the fact that they rarely, if ever build trade modules on their economy starbases. Maybe this is because they are so focused on where they should put starbases, and they never got to the part about, "oh, I should probably fill these existing ones to the brim before moving on to the next one" (they usually get master trade way before me and yet never puts them on). Military bases as well. The AI is just happy with that measily +1 beam weapon help... excuse me??? They really need to use these a little bit better, and defend them better as well. Maybe put some ships in a fleet to litterally 'guard' key starbases like planets, so that they don't all die to a sweeper fleet. Also, have they every heard of starbase fortification? I don't think I've seen the AI put defenses on their starbases until I pull out blackhole erruptors... by then, it's waaaay too late. I heard the latest AI are beginning to fill Starbases, can't wait to see if they will emphasize filling first or deploy first (deploy first is very costly, and not nearly as useful unless grabbing mining resources).

4. Ship Design: That brings me to the final weakness, and that's obvious: ship speed. I've seen some post mentioning that the AI will have more speed (terran battleship with 14 speed I believe), so that's why this is at the bottom of the list. Wonder how much they will have... hmmm... wonder how many engines I will need to outrun them (uh oh, here we go again). Here's to hoping that the AI actually does some sort of scaling of it's opponents to see how much speed it really needs, and that it uses all that speed properly. Hit-n-run, sweepers, long distance assault transports... wow... can't wait.


Finally, I'd just like to say thank you for all the hard work you put into the game. I know I complain a lot, but that's only because I'm addicted to it. If I wasn't, I wouldn't care less... but I do, so yeah. Just saying what I think would make it even better that's all, you all have done a wonderful job so far.


PS: is there anyway we can have the AI's intelligence separate from it's economic bonus/advantage, and a field/slider to choose from 50%-200%? I want to push the AI's bonus up a little more, but 200% at incredible is just so suicidal.
2 Pages1 2