TL;DR: I ran an early game comparison (39 turns) in 1.90, and found AI still lags human player significantly (6-10x) in manufacturing or/and research at Genius difficulty. Technically, it is difficult for AI to minmax, but a (hopefully) simple return-on-investment look-up table for build orders should improve AI performance by 2x-3x. And it will greatly benefit AI performance in mid and late game.
Background: Long time Galciv2 and Galciv3 player. I have been really excited about Brad’s return to the AI development of Galciv3. Version 1.90 Opt-in has been a big step forward and reignite my interest in playing the game again.
Objective: Early game AI performance in colonization and colony building at genius level (moderate AI bonus)
Why early game? If AI lags significantly in production/research in early game, human player can soon snowball in grabbing planets and building large navy to steamroll AI players.
Game setup: Hugh galaxy, loose cluster: 1 human player (Arcean) + 8 AI players. Turn 1 and 39 saves are in the following dropbox zip file
https://www.dropbox.com/s/nritks3tzzf2f07/Arcean190.zip?dl=0
Turn 1: C1.GC3Sav
Turn 39: C_Arcean_39.GC3Sav (Human Arcean, AI for the rest)
C_Yor_39.GC3Sav (Human Yor via “localplayer 2” at turn 1)
C_Thalan_39.GC3Sav (Human Thalan via “localplayer 4” at turn 1)
Three turn-39 saves are provided to find out how much human player can outperform AI: Yor is chosen for its unique play style of population assembly; Thalan is chosen for its strong starting tech, Hive.
Result
Comparing C_Arcean_39.GC3Sav and C_Thalan_39.GC3Sav and focusing on Arcean development, we can see that AI underperforms human player by 10x in manufacturing, leading to slow colony ship/constructor production. This has results in fewer planets being colonized, slower research and underproduction in military ship as well.
Planet Arcea
AI Manu: 20; Research 24; Income: -2.4; Pop 11/11; Approval:79; influence: 70.4
http://i.imgur.com/9bDYAdE.png
Human Manu: 215.4; Research 21.2; Income: -6.6; Pop 16.6/21; Approval:62; influence: 82
http://i.imgur.com/K11NNLw.png
Planet Matrix II (*U in human game)
AI Manu: 29.2; Research 12.5; Income: -1.2; Pop 2.5/4; Approval:100; Influence: 45
Human Manu: 302.5; Research 60.2; Income: -10.2; Pop 3/3; Approval:100; Influence: 56
http://i.imgur.com/hH1Zi4P.png
What happened and how do we fix AI? Let’s compare the same games and do a return-on-investment analysis, for Thalan.
Thala under AI: Manu: 42; Research 31; Income: -0.2; Pop 9.5/13; Approval:100; influence: 82.3
http://i.imgur.com/1ZwKmHr.png
Thala under Human:Manu: 105; Research 24.9; Income: -6.1; Pop 10.9/14; Approval:100; influence: 76.4
http://i.imgur.com/9wBrSKw.png
AI clearly is not building the right buildings. It current build order is Port of Call, with a cost of 135 Manu for 25%+ tourist income of 1.8 base = 0.45income. ROI: 0.33income/100 Manu
What are the alternatives?
Replacing the factory with a Manu Capital (red arrow): Cost: 227 Manu à Return: increase in Manu from 15%(base)+25%(received)+20%(giving) to (200%(base)+25%(received)+60%(giving). 225% increase in Manutotal
Other low-yield buildings
Market center: 30 manu à 0income (base is 0): ROI=0
Alternative: colonial hospital 30 manu -> 25% growth +5% (adjacency) + 2 food
This option is also much better than birthing subsidy (10%)
Research center (orange arrow): +15% research (base)
Alternative: built next to the two research center: +15%(base)+ %10(received)+10%(giving) = 35% research
Other major issues:
AI has not used any soil upgrade by Turn 39
AI has not researched or built Hive, which gives 4+ production
Similarly for Planet Eradys I (*$ in C_Thalan_39)
AI got Manu: 30; Research 12; Income: 0.1; Pop 2.7/4; Approval:100; influence: 53
http://i.imgur.com/qDrVBAJ.png
Human got Manu: 38; Research 82; Income: -7.6; Pop 3/3; Approval:100; influence: 52.2
http://i.imgur.com/q39nJgf.png
Let’s now look at Yor AI. Comparing C_Arcean_39.GC3Sav and C_Yor_39.GC3Sav, you can see Yor is also lagging significantly. The most productive colonies Iconia and Rose Morrin I are both stuck at building Fast Assembly without sufficient production to finish them quickly.
Iconia
AI Manu: 10; Research 22.1; Income: 1.8; Pop 7/16; Approval:100; influence: 53
http://i.imgur.com/uGONKTb.png
Human Manu: 227; Research 47; Income: -6.7; Pop 32.5/30; Approval:64; influence: 69
http://i.imgur.com/HWSasrB.png
ROI analysis for the AI-save @ Turn 39.
Fast assembly: 182 Manu -> 4pop -> +4 base Raw production -> +5.5 Raw production (AI bonus etc) -> 3.37 Manu, 7.4 Research, 0.6 income
ROI: 1.85 Manu per 100 Manu
Manu Yor @ red arrow: 30 Manu -> +40% Manu -> 2.04 Manu
ROI: 6.8 Manu per 100 Manu
Rose Morrin I (*Fac in human-save)
AI Manu: 33.5; Research 18; Income: 0.9; Pop 5/8; Approval:100; influence: 46.8
http://i.imgur.com/hcqud8J.png
Human Manu: 249; Research 114; Income: -9; Pop 17.5/15; Approval:86; influence: 45.6
http://i.imgur.com/9qYywX4.png
Fast assembly: 182 Manu -> 4pop -> +4 base Raw production -> +5.44 Raw production (AI bonus etc) -> 8.39 Manu, 4.48 Research, 0.23 income
ROI: 4.6 Manu / 100 Manu
Manu Yor @ Red arrow: 30 Manu -> +30% Manu -> 3.66 Manu
ROI: 12.2 Manu per 100 Manu
Proposed fix: for each colony, maintain a look-up table for each tile, where the ROI of each type of improvement is calculated. This table only needs to be updated once a building is completed or a new tech is researched. Build the improvement with the highest ROI at the tile with the highest ROI first.
P.S. it may be useful to hard code AI to research Interstellar Travel for Map size >= Medium
Update: 12/06 Links to the figures
Clarification: my goal of this post is to brainstorm potential ways to improve the AI governor. We don't need to solve a NP-complete problem that gives absolute optimal placement. A non-optimal algo that improves AI by 2-3x in efficiency will go a long way.
I don't know how hard is it to implement the look-up table I mentioned above in the actual source code. Just some food for thought.
Other related/better ideas for improvement
ZuPloed: https://forums.stardock.com/480826/get;3659986
https://forums.galciv3.com/478855/page/2/
I agree I've noticed that they do not use adjacency very well at all. It's like they need to place each type of building first prior to looking at adjacency. However, on the the other side of things I feel that the "easy" setting they should do something like above focus on a balanced planet with each building type prior to adjacency and, as difficulty increases then the AI should start to specialize planets and focus on adjacency and what building will give the best bang for the buck all the way up to godlike where it may reconsider building placement based on how can we maximize production/research/military/economy on this planet.
Building placement for the ai may be harder to code then we think. Personally I would like the ai to respond to enemy fleets better. I dislike using GCII as a reference but Brad did a damn good job with it so here it is.
I had a game in GCII where the Yor got the event which allowed it to snowball in strength. I am do not remember it I think it was called precursor relic on one of its planets. This event gave that particular ai a <cumulative> bonus to everything (per turn). It started out small and snowballed if you left it alone. Well in this game I did not see the event pop up.
Fast forward 200 turns. I have got about 1/2 of the galaxy carved out for myself when out of the darkness come the Yor! They had excellent fleets optimized and maxed out in logistics. They pushed me back and we were effectively STALEMATED for 150 turns. Many fleet battles but here is the kicker...>>>> I changed up weapons I changed defenses I did everything I could to win and here is what happened.. They Yor (because of the relic event) had the money to upgrade instantly per turn to my own fleet changes!
It was a glorious game, perhaps the best I ever had. I had fleets with 200-200-0, and the Yor countered it with fleets with the correct defenses. It truly was amazing.
That ...^^^^ that right there is something I would like to see again in GCIII. That event was an absolute BITCH! It was amazing how quickly the ai would change its fleets to match and counter yours. That is ideally what we should have. I am fairly sure its all in the scripts Brad used.
If someone would take the time to teach me how to write scripts, I would happily devote dozens if not hundreds of hours to help the Stardock team build a better game.
If Brad can do it there in GCII.................
Agreed that ideally at higher difficulty levels, the AI will take into account the adjacency.
Improving this area of the game will also significantly reduce micro-management in the game, because human player can rely on planetary governors more.
@Seilore
It is not just about layouts. If I can get an imperfect but complete layout in half the time it takes the AI to build a perfect layout I am still quite ahead afterwards. The elefant in the room with the AIs governors is order in which it builds stuff.
Things I am used to see is planets being pop-capped at 5 pop. Which is even worse now with the reduced production from capitals. I am used to see planets building a shipyard as the third improvement on a new colony.
The way the AI uses adjacency is it looks for the nicest spot for normal improvements and for hub improvemnts (e.g. power plants) it looks for a place with a lot of adjacend tiles first and then picks the one with the highest bonus. More or less, I guess it is slightly more refined, but this describes well most of the things I have observed. It does also replace normal improvements with hub improvements in good spots btw.
(I observed a lot, I ran games to turn 100 without playing myself and only taking stock of all AI planets at certain points).
The second big thing is upgrades (e.g. basic factory -> xeno factory). The game balance works in a way that makes updates allways the inferior choice to another building of the same type. And that is allright, else you would have a lot steeper groth curves from single planets. But this also means, that the AI needs to act on the knowledge of upgrades being pretty much the last thing they want to do in any scenario.
To be honest, I think there are many construction sites regarding the AIs behavior in this regard, but I would expect the highest returns from fixing the upgrade behavior and the shipyard behavior. If these two inefficiencies aren't fixed, they are trying to teach the AI to fight an uphill battle.
After that we can talk about adjacencies and optimized final builds. After that we can talk about learning algorithms to determine good ship layouts. But to be honest, I still would put my eggs in another basket first. Strat resource improvements (indirect minor buff by coercion and colony capital production changes).
Agreed... There is a similar event in Galactic Civilizations III but, doesn't seem to have the same effect. Also the Dread Lords event is worthless. They are just another AI that is given some things but, unlike Galactic Civilizations II where they had a fully productive planet right away, there planet is new and they have nothing. So one can find their planet right away and capture it and oh a class 15 planet. Plus in Galactic Civilizations II the Dread Lords received a class 26 planet giving them the extra boost, as well as powerful ships to defend the planet right away.
In this game it appeared around turn 100 for me, on the border of my space. My ships were many times more advanced than the Dread Lords ships, I just quickly destroyed the two ships they had as well as their ship yard and had myself a new planet with my transport. Please make the Dread Lords a problem, right now they are weak...
Yup, couldn't have said it better. I used to fear the Dread Lords in GC2, I laugh at them now. Come on, Brad, make me eat my words!
The placement of the default balanced governor has big issues. See the following example. Why would AI choose to place a research center in this location? Sure it takes into account receiving the adjacency from the waterfalls, but it also wasted the opportunity cost of a manu improvement giving back to the waterfall.
The adjacency algo needs to consider both receiving and giving adjacency bonus. Right now, only the receiving end is being taken into account.
The save file is here: https://www.dropbox.com/s/fw80b7q9pfmamcs/C15_Snathi_Gov.GC3Sav?dl=0
This point made by ZuPloed is important, because AI will under-produce and under-tech with respect to human players, with the current algo. The result:
1. human player steamroll AI in mid and late game
or 1A: massive (300% at God level) production bonus has to be given to AI.
2. human player will not use planet governor, which makes the game too micro-intensive.
I never use planet governors because I can usually do a better job on my own. Mind you I normally only go to each planet a few times through out the game and change things I don't check it anytime there is a new tech or building so I human can do better. I don't feel the planet is too micro-intensive, by far star-base construction is far more micro-intensive than this.
Star base micro could be solved by having an option to choose your star base template... (economic, military, culture, mining) Then it builds modules as you laid out in the template as they become available. (Basically star base governors) Just let the player select the order in to which build improvements, maybe even have a toggle to include weapons/defenses or ignore them. No need to build those modules deep in your own space if there is no danger; at least not as important.
I have to agree. If the AI planet governors were to be updated to better build out adjacency as well as improve build orders, it would go a very long way into helping the AI stay competitive mid-late game simply by reducing production inefficiency. I am not much of a min-max kind f person, but even my planets have a layout that trumps my AI companions. Although, to be fair as well, they're a lot better than they were at launch -- the AI used to build absolutely atrocious planets and made up an order of magnitude of the difference with bonus' if I recall.
And later it will possibly replace that one factory adjacent to the research lab or the research lab itself with a social matrix or slave pit. What bothers me more in this example, that the AI hasn't built the social matrix allready. It is also pop-capped soon, which could be helped by the slave pit or the molecular fabricator.
I can't explain though why it build the factory in top left corner though.
But as I said, I would hazard the guess, the AI in your example is wasting more potential by not building hubs than it is by losing that two adjacency.
But either way, this is nothing compared to the issues there are when it comes to upgrades or shipyards.
Also, on the topic of homeworld development, the two major issues I see are:
1) It puts 2.5 pop into each colonizer. Your homeworld is the world which can make the most use of pop due to fastest build of improvements. It should leave those people at home unless pop capped or heavily heavily unhappy.
1b) Sorry for bitching, but this is the problem with having the same population "slider" (you ca make it default to one value by the xmls) used by the AI for transports and colonies. For transports you want max and you want to min pop on colonizers. So even if I am modding the game I have to choose between stunted early growth and later inability to invade...
2) 2 Research improvements first. Why do you need tech to upgrade to xeno factories if building basic ones allready takes forever? I have found in my games, that I don't mind at all researching slowly at the start. Because I don't need to build advanced stuff in my colonies anyways. The first important things are food, since you popcap quickly on new colonies and some awesome racial buildings like hives or slave pits. But in general you just don't need all this research early.
1) It puts 2.5 pop into each colonizer. Your homeworld is the world which can make the most use of pop due to fastest build of improvements. It should leave those people at home unless pop capped or heavily heavily unhappy.1b) Sorry for bitching, but this is the problem with having the same population "slider" (you ca make it default to one value by the xmls) used by the AI for transports and colonies. For transports you want max and you want to min pop on colonizers. So even if I am modding the game I have to choose between stunted early growth and later inability to invade...2) 2 Research improvements first. Why do you need tech to upgrade to xeno factories if building basic ones allready takes forever? I have found in my games, that I don't mind at all researching slowly at the start. Because I don't need to build advanced stuff in my colonies anyways. The first important things are food, since you popcap quickly on new colonies and some awesome racial buildings like hives or slave pits. But in general you just don't need all this research early.
1) agreed. 0.5 pop will make more sense in 1.9
1b) agreed.
2) Although "interstellar travel" tech is important for early access to faster and cheaper (move per manu cost) colony ship and constructors in maps sizes large and above.
1) And later it will possibly replace that one factory adjacent to the research lab or the research lab itself with a social matrix or slave pit. What bothers me more in this example, that the AI hasn't built the social matrix already. It is also pop-capped soon, which could be helped by the slave pit or the molecular fabricator.2) I can't explain though why it build the factory in top left corner though.3) Well, the adjacency was recently optimized, so I am not really sure what exactly it was doing. I could speculate here, that the AI sort of planned to replace the research building to begin with and placed the factory top left, because it knew it would stay.
4) But either way, this is nothing compared to the issues there are when it comes to upgrades or shipyards.
1) Social matrix/Slave pit were only available 1 and 0 turns before. The AI was busy building a farm then
2) I did that manually to anticipate hub buildings to be available soon. AI has been trying to put that research lab next to waterfalls all along
3) I soaked it to turn 100 and have yet to see AI replacing this ill placed lab with a factory
4) agreed that upgrades and shipyards are lower-hanging fruits.
Yes, AI has improved a lot in the past updates, for which I am grateful for Stardock's effort.
It seems to me that there are still many low hanging fruit that can improve 2x-3x AI productivity though
I have a lot of thoughts on this as I took a look at how this was coded. Basically, imo, it's backwards.
The AI goes into a planet already deciding what it wants to build and then tries to find the right tile for it.
If it were me, I would look at the best tiles on the planet and then use that to decide what to build.
But as I fun as it is to develope heuristics to optimize adjacencies, upgardes and shipyards are the bigger issues at the moment.
A class 4 world upgrading its 3 basic factories while pop-capped, soil enhancement and solar power plant being avaiable, should not happen at all.
Thank you for looking into this!
Yes, the pre-determination of the specialization of a planet without considering the tile yields on a planet is backwards.
The only planet I predictably shoe-horn is the homeworld, which I typically make 50% research, 50% manu.
But as I fun as it is to develope heuristics to optimize adjacencies, upgardes and shipyards are the bigger issues at the moment.A class 4 world upgrading its 3 basic factories while pop-capped, soil enhancement and solar power plant being avaiable, should not happen at all.
Having the heuristics will be great. But as you said, the low hanging fruits are
1. no upgrade until hubs and hub-located soil enhancement are completed
2. no shipyards until manu-per-turn exceeds 30 or 40 (could be a magic number here) (unless nothing else to build)
3. (my addition) For Yor homeworld and precursor worlds, no assembly until manu-per-turn exceeds 30. (Yor also needs to learn using transport/colony ship to shuffle excess population).
I never use planet governors because I can usually do a better job on my own. Mind you I normally only go to each planet a few times through out the game and change things I don't check it anytime there is a new tech or building so I human can do better. I don't feel the planet is too micro-intensive, by far star-base construction is far more micro-intensive than this. Star base micro could be solved by having an option to choose your star base template... (economic, military, culture, mining) Then it builds modules as you laid out in the template as they become available. (Basically star base governors) Just let the player select the order in to which build improvements, maybe even have a toggle to include weapons/defenses or ignore them. No need to build those modules deep in your own space if there is no danger; at least not as important.
I agree with you mostly.
However, planet planning is micro-intensive because it requires me to spend brain power to think, each time I look at it. Starbase build-orders hurt my finger and palm, because so many clicking are invovled. But starbase building does not take much decision-making brain power, so my head gets less fatigued doing starbase than planets.
I agree that a build-order can be setup only a few for each planet. However, but the availability of soil enhancement/terraforming usually makes me having to revisit many planets at least 4-5 times.
Since I don't have any control on Stardock's developer resources, any improvement in either of these two areas would be very helpful.
On the subject of Micro.
All 4x games are micro to some degree or another. Even Distant Worlds with all the switches which allow for near total automation does require you to 'direct fleets' and at times tell where scouts should go.
Personally I think the micro is the life blood of 4x games and some of it is 'ok'. I would never let a governor develop my planets but that is just me. Starbases ideally should be set with pins on the map that tell the engine what you want and just set the pin and go. If it sends a constructor to a location that already is farmed by another civ it will have a banner notification at the top and ask what you want to do with the constructor, Ideally we can set what each type of starbase gets built with in the governor screen and that will update as tech becomes better you get more options in that screen.
There are many great features available to you once you register, including:
Sign in or Create Account