1.3 opt-in 2 AI

looking for feedback on the AI. Should be substantially better compared to 1.2 or 1.3 opt in 1.

While 1.4 is going to mostly be about AI, we found a lot of low hanging fruit largely thanks to the saved games you guys have sent in and your posts. Thank you!

42,274 views 28 replies
Reply #1 Top

ill see if I can start a new game tonight to check it out, but thanks regardless for your efforts!

Reply #2 Top

I suppose I should be used to this by now, but it still surprises.

 

I mean, of course, the way you talk with us, take our suggestions and gripes under advisement and rapidly produce improvements and fixes.

You, sir, are a good man.

Reply #3 Top


looking for feedback on the AI. Should be substantially better compared to 1.2 or 1.3 opt in 1.

While 1.4 is going to mostly be about AI, we found a lot of low hanging fruit largely thanks to the saved games you guys have sent in and your posts. Thank you!
End of quote

OK, if it'll help out, I'll abandon my current game and try a new one with the new update.  If you had a hand in modding the AI, it's guaranteed to be top notch.  Certainly worth abandoning a game in progress to check out the new stuff.

I'm looking forward to it.  

:) 

Reply #4 Top

I honestly hadn't tried a 1.3optin2 game yet more than around 50-60 turns.  didn't realize there was much in the way of ai improvements, but will have to check it out now :D

as to the short 50ish turn game, I had the planet settings low & got really unlucky & my knee was acting up.  I did however notice the ai (iridium?) snagged a planet I was hoping to get.  we both spotted it around the same time (I think) judging from it's scout ship showing up from the "west" while mine was heading in from the "northeast".  Figuring I hasd looots of time, I took a zigzaggy star scouting scouting route there with my colony ship & was pleasantly  surprised I lost out without thinking about it until now 

Reply #5 Top

my tests showed an increase of AI performance of ~30% in the first 100 Turns,

so jep they are a lot better.

If this goes on 1.4 will be great :)

 

Reply #6 Top

I seriously love you guys. :)

that hat spreadsheer looks awesome.

btw, most of the AI improvements do not require you to start a new game. I made it to the algorithms themselves.

There is still a lot that can be done. A lot of it also has to do with making good decisions on when and if to go to war.

 

Reply #7 Top

Quoting Frogboy, reply 6

I seriously love you guys. :)

that hat spreadsheer looks awesome.

btw, most of the AI improvements do not require you to start a new game. I made it to the algorithms themselves.

There is still a lot that can be done. A lot of it also has to do with making good decisions on when and if to go to war.

 
End of Frogboy's quote

Do we still have to mod WartimeFocusSectorRadius in GalCiv3AIDefs?  I notice that it's set to 9 rather than the 256 that makes the ai send ships past its border when it declares war

Reply #8 Top

Tetra, can we get a mod that changes that to a higher value and is it needed for a more aggressive ai?

Reply #9 Top

I have definitely noticed an improvement in the AI. In terms of building buildings on planets, I've actually conquered some planets that I looked at how they laid things out and I said, "good job, this is what I would have done!" They are also less willing to let me set up my ships to attack them (pretty obvious what I'm doing but this time they are actually reacting to it) like I usually do and will sometimes declare war on me to attempt to thwart my invasion.Things are definitely moving in the right direction. I still haven't broken my habit of micro managing my planets with the wheel yet... but I promised myself after my 30th planet I'm going to start letting the Govs take over and see what they do to my lovely empire... :D

Reply #10 Top

I've played a couple of tester games with the new version as the terrans and getting my arse kicked on normal by the Drengin who are now playing like the old dread lords from GC2 what the hell did you do to this Frogboy? give the AI steroids? Keep it up but don't make it too hard for us humble average players.

Reply #11 Top

Quoting Echillion, reply 10

I've played a couple of tester games with the new version as the terrans and getting my arse kicked on normal by the Drengin who are now playing like the old dread lords from GC2 what the hell did you do to this Frogboy? give the AI steroids? Keep it up but don't make it too hard for us humble average players.
End of Echillion's quote

I spent a day playing through saved games. Those are crucial.

The thing that makes AI hard is that when there are bugs (or behavior that isn't expected) it's very hard to tell there's a bug. The game won't crash. There's no visual glitch. The AI just doesn't do what you expect.

I have no ideas what WartimeFocusSectorRadius.  But I think I can guess so let me talk about how this worked in GalCiv II.

(spoilers)

.

.

.

Ok so if you think about why AIs are so bad in other games it's usually because they do things like SendShipToNEarestEnemyCity (or planet). So you get endless death trains of units just danging out at your empire.

In GalCiv II, I would pick a primary enemy and then pick a primary sector to focus on.  Now, I did all that procedural. The further the sector away, the less valuable it was.  In fact, if something was out of range of my units, why even bother?

So what I think that variable does is cut off how far it will look from your nearest planet.  Intuitively, it seems like 9 sectors is pretty far away.  Do we really want the AI sending all its forces 30 sectors away? It would take many many turns to do that.

I'll look in the code for this.  My view is that there may not be any need for that variable at all. I would just look at every sector that is within range of my ships (I know range differs from ship to ship but there's a base range you can create) and then pick one based on various criteria.

 

Reply #12 Top

Quoting Frogboy, reply 11

So what I think that variable does is cut off how far it will look from your nearest planet.  Intuitively, it seems like 9 sectors is pretty far away.  Do we really want the AI sending all its forces 30 sectors away? It would take many many turns to do that.
End of Frogboy's quote

 

I don't think it's from planet - seems to be from the ship's own position when idle. And I don't think it's looking 9 sectors either; the AI doesn't send invasion ships long distances. While increasing WartimeFocusSectorRadius to 256 makes it much more adventurous with it's invasions, it's still not capable of going from one end of a big map to another - it's more just willing to attack within a few dozen hexes rather than 20 or so. There's also <WatimeFocusSectorTargetBonus>, too.


I suspect it defines an area around the ship's existing location X hexes wide, in which it should try to find and kill/invade stuff. It's worth noting the other place where 'sector radius' is used (mapsizedefs), it's set to 0 in all cases - possibly it's supposed to modify against this number to make big maps, but the lack of modifiers listed in mapsizedefs is causing it not to scale, making the AI very reluctant to venture far from home on larger maps.

Reply #13 Top

Yea, I'll definitely have to look at what it's doing.  The main thing is that the AI is supposed to focus on very few sectors instead of spreading itself out.

Reply #14 Top

I was playing a game as the yor today & noticed a lot.  

  • The AI is wayyyy better at colonizing and expanding out, I'm impressed/pleased there :D
  • I've been suspecting that not researching universal translator makes the ai less likely to declare war
  • I'm not getting as much pointless war declared things, but some of that is likely a mix of altered research path, luck of whom I meet, and the ai staying occupied colonizing/building while I'm doing the same.
  • I encountered something strange.  The altarians demanded tribute from me, but they have a weaker military (weakest in fact iirc) & the strongest economy, shouldn't they perhaps instead offer to buy some warships? autosaves & two earlier savegames here
Reply #15 Top

Another cool thing I've noticed after significantly  delaying building mining starbases, the AI did a great job of snapping them up  & looks to be doing good with considering "what else can I cover with this"

Reply #16 Top

Feedback from 1.3 optin 2:

AI declares war on me quite a lot now, BUT has the following problems:

- it does not declare war on any of the other major AIs. Theyre always at peace (genuis difficulty setting) at least according to the diplomacy screen

- declares war on me but has no ships anywhere near my border to follow through. Those ships may arrive in 30 turns if that, giving me lots of time to prepare for the invasion

- troop transports are escorted by only 1 ship

Reply #17 Top

Quoting Frogboy, reply 11

Ok so if you think about why AIs are so bad in other games it's usually because they do things like SendShipToNEarestEnemyCity (or planet). So you get endless death trains of units just danging out at your empire.

End of Frogboy's quote

 

But that is exactly what the AI does in this game. Its attack vectors are almost 100% predictable. Every now and then it will somehow manage to send a fleet through a side somewhere, but otherwise I can predict to within a margin of a few hexes where enemy fleets will arrive at. I often have huge sections of my frontier that I dont even need to bother defending against as nothing will ever attack there. The AI tunnel visions on the nearest planet or station or sector (whatever) and it will send endless waves there, never accounting for the fact that their fleets get obliterated there and it maybe should try a different attack vector. I honestly dont understand why from a coding perspective that is so hard to accomplish.

If attack vector X results in losses Y and enemy losses are fewer than Z, assume defense too strong and assign different attack vector

If attack vector X results in losses, and different attack vector not possible, assemble larger attack force

If attack vector X results in continued losses for Y number of turns, consider alternatives (examples: ask for peace, or defend and try to lure enemy out of their defense position, or focus on building empire to better position itself for new attack vectors)

Reply #18 Top


looking for feedback on the AI. Should be substantially better compared to 1.2 or 1.3 opt in 1.

While 1.4 is going to mostly be about AI, we found a lot of low hanging fruit largely thanks to the saved games you guys have sent in and your posts. Thank you!
End of quote

Look at ticket #XBM-948-27889, I have submitted a few save games with problematic behavior, AI not catching up, not adapting quickly enough to changes and surrendering too easily (and sometimes being way, way too stubborn about it like #OGM-976-73052).  Also, weird dow like #ADN-253-49524.

 

Generally speaking, the larger the map, the more difficulties the AI has to adapt to a growing empire.

And it absolutely can not react to a quick change, like the neutral perk ideology that gives -25% approval to races at war with you.  That is spelling the doom of any AI at war with you.  Maybe it is an overpowered perk, like the Benevolent one that flips all planets & starbases to your side instantly, that just means victory when used just at the right moment.

 

I usually set my games with me allied to Alterians and Drengin allied to Yor in a 6 player game.  I've reduce the size of the map to Huge instead of Gigantic and noticed the Drengin faring much, much better in these games than in the bigger map.
But it always go that way: Krynn will attack any neigbhouring faction as soon as they believe they can overtake them and I admit that early in the game, they are hard to repulse.  Drengin will declare war on you even if they can not reach you.  Than they try to counter your weapons.  If you happen to use beam and their closest neighbours use missiles, they are doomed, the moment the neighbour declares war on them, they are unable to counter and attack them efficiently.


Krynn, by being the over agressive zealots they are may manage to overcome one race that can not adapt to their tactics, but then they have sacrificed research and they fall behind.  If they are attacking me, I can usually stall them and eventually have other AI races declare war on them, the AI can not seem to adapt to two different factions (say, one using beam, the other using mass drivers).  Then I can trade my way up with minors and friendlier races, giving them non military techs to get the right technologies that I need.

Planet wise, the AI is doing better to react to change.  For example, the Krynn falling behind research-wise, they were building lots of research station on their planets.  The Drengins, facing a -25% penalty to morale built a lot of morale enhancing buildings.  It still does not seem to really use tile bonus, but it does specialize its planets and adapt to changes.  However, one thing it can not seem to do is shifting its military production by destroying useless ships and rebuilding better ones.  As a human player, if I don't have money to upgrade my ships, I build newer, better ones, and use the old ones as cannon fodder, or dismantle them for cash.  Then I counter attack.  It seems to AI builds lot of small ships, then is stuck with it because they cost a lot of money and he's strapped for cash, unable to upgrade ships or rush production.

 

Also, building starbase and colonizing way out of its territory.  In many games, I would see the AI building bases far, far away from their home territory.  The last case was the Drengin.  They were in the south-east corner of the map.  They built a starbase in the north-west corner of the map to get a relic.  Why would they do that?  They can not possibly defend that starbase, and meanwhile, they do not upgrade the starbases closer to their territory.  Then they dow me, I destroy their base, they can not attack me for the next 50 turns (well, it's not a precise value, but it takes a while).    The moment they come close to harassing me, I have all the other AIs declare war on them.  Then I build my strenght and most of the the other races end up surrendering to me.

Next is colonization issue.  In every single game I play, I do not colonize the 2nd habitable planet of my home star system.  Then the AI comes in late, when my influence is pretty strong in that area, colonize it, and 2-3 turns later the planet has flipped to my side.  Brand new colony, no colony ship lost.  Only thing is I can not use the shipyard exploit that lets me use a 6th planet for my shipyard (still not fixed btw... ;) ).
And if I leave a planet uncolonized in my territory, due to lack of proper technology, the AI will eventually colonize it, even if it's totally surrounded by my influence and there's no way it can hold to it.  It looks as if the AI can not realize that it will lose that planet very quickly, way out there, far away from its territory and fleets.  As a human player I make a difference between the early colony rush and later grabbing planets outside of my territory.  Initially, I try to expand quickly, leaving some planets "behind" if needed to colonize good ones further away, than try to come back before the AI does, as a way to extend my influence.  Even if some planets were to fall in "ennemy" hands early, they will eventually flip to my side.

 

Surrender.  This can go both ways.  An AI that has lot all of its planets, all of its transport ship, but there are one or two colony ship left and a whole buch of insignificant small ships that can't make a dent into my defenses.  Imho, it is an hopeless situation for any AI or human player.  But it hides its ships well.  It will never surrender while it has so many ships, but will eventually sue for peace. 

My choices:

1) wage war and try to find every single lost starbase & ships of this race all accross a big galaxy.  Very tiresome.

2) Accept peace.  Wait a few turns.  Offer lots of techs and cash for all its remaining ships, starbases and tech I may not have researched.  The AI accepts, then surrender to me the next turn because they have 0 power.

 

Also, when a race is about to surrender, they tell you they are surrendering to you, but it's not immediate.  You then go to diplomacy, trade any techs for theirs (as much you need), and by next turn they are dead anyway, you have all of their resources + techs.  Might be worth it to totally disable diplomacy once a race has announced its surrender.

 

That's all I can think for now.

Reply #19 Top

Quoting Frogboy, reply 11

Ok so if you think about why AIs are so bad in other games it's usually because they do things like SendShipToNEarestEnemyCity (or planet). So you get endless death trains of units just danging out at your empire.

In GalCiv II, I would pick a primary enemy and then pick a primary sector to focus on.  Now, I did all that procedural. The further the sector away, the less valuable it was.  In fact, if something was out of range of my units, why even bother?

So what I think that variable does is cut off how far it will look from your nearest planet.  Intuitively, it seems like 9 sectors is pretty far away.  Do we really want the AI sending all its forces 30 sectors away? It would take many many turns to do that.

I'll look in the code for this.  My view is that there may not be any need for that variable at all. I would just look at every sector that is within range of my ships (I know range differs from ship to ship but there's a base range you can create) and then pick one based on various criteria.

 
End of Frogboy's quote

These values should not be hardcoded, but relative to galazy size.  9 sectors is pretty far away on a small map, but it could be that, on a gigantic map, it happens that the nearest ennemy planet is 10 sectors away.

I also think that huge maps are boring to play because the speed of ships does not scale enough.  It takes forever, even with stellar folding to get from one place to another.
And I notice the AI does not really use a lot of engines on its ship, often having 4-6 moves per ships in very late game.

Reply #20 Top

Quoting Frogboy, reply 6

I seriously love you guys. :)

that hat spreadsheer looks awesome.

btw, most of the AI improvements do not require you to start a new game. I made it to the algorithms themselves.

There is still a lot that can be done. A lot of it also has to do with making good decisions on when and if to go to war.

 
End of Frogboy's quote

 

But I want an excuse to start a new game. I just downloaded some Star Trek Factions and ships.  Andorians here I come.  :)

Reply #21 Top

I've uploaded a few more saves, ticket #CKJ-934-82211.  AI behavior when at war with others seem weird.  Say, the Altarians are at war to the Yor.
My position is in the south west corner of the map.  The Altarians are directly north of me and the Yor north of them.  They have ships deep in my territory hunting pirates or just staying around my starbases while the Yor are pounding them to dust.

Another one has the Yor and the Iconians at war, both their fleets are standing near each other, not moving, not attacking.  The Iconians have tons of ships in my territory while they are at war with most other races.  Again, weird behavior.

Reply #22 Top

Excuse me for what may become a long post. I think there are a few issues around how the AI's wage war. Especially since the patch when they've start preemptively parking ships'near potential war targets.

Part of it revolves around the decision of when or if to send in transports but it is also connected to a lack of mobility in general. I have seen games where despite overwhelming space superiority they never get around to invading the planets. It actually got so ridiculous I started messing with that wartimesectorradius variable the guy mentions to try fix it, it does seem to help somewhat but there could be some unintended consequences.

 

Another issue is it building fleets stacked with weapons but no engines at all and THEN sending those ships on offense. I design ships like that too but with the clear purpose of them squatting in place to defend. The AI does not seem to be able to defend effectively. If I counterattack the Yor's production (its usually the Yor, lets be honest) even if they have a massive power advantage, usually one fleet is enough to take the whole region  ( medium to huge scale maps) Way too much of that production is out on offense and then is way too slow to turn around. By the time those ships get turned around and back its all over, I can even use their own planets to build ships to kill them, its a bit silly.  

 

I think part of the reason the Yor snowball so many games is that the less production focused AI don't turtle properly'. They just launch all there ships and hope for the best when really they should just sit in there 60 logistic spots and try and tech out of it. If you massively defend your primary ship yards you can quite easily build up a fleet that they cant beat as long as you countertech correctly (if they're stacking beam shields you go missile shields etc). 

Anyway my suggestion is that if there is a distance variable that specifies how far they will send there ships from home or something similar. It gets changed to a unit of time instead of distance. So instead of x number of hexes it is x number of turns travel time and the designs for offense are tweaked to emphasize engines a bit more. Or perhaps make sure they behaviour of the ships is consistent with their design. You could have a slow moving offense fleet that just crawls towards planets supported by some fast raider ships that can 1v1 an unprotected starbase or shipyard. 

I think also fleet composition needs be looked at. Its not uncommon to see a fleet of escorts running around by themselves, which is pretty pointless. MOO3 took an interesting approach where you actually designed fleets instead of just viewing fleets as collections of ships. Which the design of this game seems to support, On that note could consider allowing more that one shipyard to be linked to a planet. I feel like the ideal fleet might be a mix of ships of different sizes and roles but at the moment you sort of are incentivised to spam produce the biggest ships you can one turn complete. Should a fleet really just be a collections of capital ships with an escort or two. Having more than one shipyard per planet would allow a more varied fleet composition. Sure you can try using multiple planets but I feel it would be inefficient. If a planet is sufficiently specialised to be an efficient ship producer it should probably be spamming big ships.  

 

On the production wheel issue, when I am messing with the wheel I am mostly trying to get one or two turn completion on any social improvements with the rest dumped into military, research or money depending on the specialisation of the planet. Or just max specialised production. For the initial improvements 30, 45, 67 are the key numbers to remember if finding that level was automated it would be nice.

 

 

Also just want to say, I like a lot of thinking behind this game, (and sorcerer king also btw) quite fun mechanics to play around. Think would be really fun in multiplayer but better AI would be nice and thanks,

 

Reply #23 Top

I'm seeing some improvement in the 1.3v2 AI.  My current game is an immense map on godlike difficulty like my other ones, but I'm using a custom race.

The AI players are much stronger than me, even up through turn 125.  I had started building my military around turn 120-ish and am now roughly equal to the Krynn, who are by far the weakest major.  We're both basically straight lines across the bottom of the scale watching the others flying in a vertical pattern above and away from us.

The AI seems to be building better.  So far, I only took one planet from a minor, but it was laid out better than I've seen before.  There was a coordination center properly surrounded by labs and the factories were set close together.  

The AI will be able to DOW on me around turn 130, so I've changed my output from hammers to ships.  I now have an active fleet of 4 warships with more on the way.

My economy is running a little worse than negative 300 per turn so I have to sell techs and treaties to stay afloat.  My beaker output is low, so the majority of my research is coming from trading and artifacts.

When my survey ships go through wormholes and pop up in the neighbor's AOI, I have AI ships converging and escorting me in a threatening manner.  The Altarians are building ships with more engines than I'm used to seeing.  They can easily catch my survey ships.  It's pretty cool.

The one odd thing is that the Drengin, who are on the other side of the galaxy from me, came and took an extreme planet well within my AOI.  They seem to have some strong influence since a fairly large area around the planet turned from my color to a bright shiny red.  Still, it seems like it's only a matter of time before I'll be able to flip it.

It looks like I'll need to kill off a few more of my cash cow minors in order to compete.  So I'm back to the hunting grounds when I get home.

Living on the edge like this is very entertaining.  

 

Reply #24 Top

Despite assertion to the contrary, the AI is still omniscient.  From the beginning of the game, it knows exactly where are the best planets to colonize, the best resources to mine.  At genius level, at least (+2 level from normal).

Given the AI and the game stuck huge problems I'm gonna stop playing until an interim patch.

Reply #25 Top

*deleted