Observations from 2 games played under 2.7 #24
Replies: 11 comments 9 replies
-
Okay interesting. That's a detailed writeup. There's some things that really rised my eyebrows though. You didn't mention difficulty settings? That's pretty important as far as the difficulty pacing goes. If you set expansion_limit at 20, that's pretty low for Thinker AI's unless you've simultaneously enabled expansion_autoscale. It's mostly there to put some kind of an upper ceiling so the AI doesn't get too close to the unit limits. You mention the base garrisoning being somewhat broken, but it's hard to correlate that kind of behaviour with the stuff that I've seen on the test games. Usually the AIs don't have any shortage of defensive infranty units. Maybe sometimes they have too many obsolete units, but having a bunch of bases with no garrison units should not normally happen. For example the last garrison unit should NOT exit the base square if there's no other defenders. It feels like there's something else going on with custom game settings, maybe alphax.txt changes. If all the defenders are destroyed, the AI should switch production to garrison units. It's basically the very first item that is checked in the build queue. They also have routines to build extra facilities on rioting bases, but hologram theaters are built more rarely because of the maintenance cost. Also network nodes shouldn't be that low priority in the queue, unless the bases produce so little energy they get skipped because of the cost-benefit check. So the AI was building something, but it was not a) garrison units, b) additional base facilities? Many of the things you mentioned are already implemented in the decision making, for example "(1) at peace; (2) nominally at war but no units are being destroyed, e.g. in a war with someone on the other side of the map; (3) in a hot war; (4) in a war and losing bases." E.g. Thinker has special priorities if they start losing a lot of bases and switch production accordingly. I'm just confused as to why these didn't seem to have effect on your game. It could be useful if you can send the config files and some save games at various points. The address is admin at induktio.net. |
Beta Was this translation helpful? Give feedback.
-
I am going to put together two zip files with save games/thinker.ini/alphax.txt, but it'll probably take until tomorrow morning, so I'll post this for now. The something that the AI is building that's neither garrison units nor additional base facilities is needlejets. The (tweaked) Drones and the (vanilla) Hive in particular really, really like to build needlejets. I am seeing the AI's switch production to garrison units when the last defender is destroyed, so that's not the problem. The problem that I'm seeing is them moving the last garrison unit out of bases, and if that base is building a needlejet that'll take 10 turns to finish, it keeps on building that needlejet. (Which makes sense: why would you reconsider production every time a unit leaves a base?) Game settings: both games: Librarian (4) difficulty. Random tech with revised_tech_cost=0, eco_damage_fix=1, ignore_reactor_power=1. Most of the changes I've modded in have been about moving SMAX stuff into the late game so that the early game plays more like vanilla SMAC, which is why I'm not expecting most of the modifications to make much difference. But there are two changes in particular, both only in the second game, that are making a difference: |
Beta Was this translation helpful? Give feedback.
-
Thinker 2.7 ungarrisoned bases.zip Hopefully that worked. In the year 2270 save game, the following are examples of bases with no land unit garrison that are not building land units: All terraforming options are vanilla except for the house rule against building boreholes. To be clear, I'm not trying to analyze whether the AI should build forests or farms + solar panels. I'm observing that the AI is building farms, and not building anything else on the tile until it has the tech for condensors. I'm claiming that, if you've decided to build a farm rather than to build a forest, then also building solar panels is a better option than leaving it at just a farm. If you're going to work that tile, then the worker is going to consume two food, so the net profit of a tile is its production - 2 food. So a rainy rolling tile with a farm will produce for example 3 food (after restrictions lifted) and 1 mineral, for a net production of 1 food and 1 mineral, but if it also has a solar panel it'll have a net production of 1 food, 1 mineral, and 1 or more energy, which is a notable productivity improvement for the rest of the game. Before nutrient restrictions are lifted it'd have a net production of 1 mineral and 1 energy vs. 1 mineral. Reviewing old save games of the game where I thought it didn't build early SP's, it did try, just too little and too late, and only got a couple of SP's that I didn't particularly want and weren't much use to the factions that built them. I agree that playing on a higher difficulty level would probably have made it competitive. The needlejets were being used effectively on a tactical level, but strategically they were being wasted. The AI was not using them to fend off an invasion: they were using them to try to soften me up before they launched their amphibious invasion against me. (My invasion happened because after they used all those resources for their aerial attack, I noticed that they had little in the way of defences.) And if it had been just the Drones (a strong AI) vs Morgan (a weak AI), that would have been a good strategy, and the AI needs to be able to do that. But it wasn't a good idea for the Hive, with an economy much smaller than of mine, to decide to spend most of its resources building needlejets, forfeiting all its future economic growth, in order to fight a war of attrition with me. Though the prequel to that had been that I had taken over three Hive seabases that were in exposed positions, so I suppose they had good reason to think themselves in an existential war. But I had no intention of following that up with a land war against the Hive before they made a nuisance of themselves. And then there's Morgan, who is much weaker than the Drones and is using aerial units to attempt to wear them down prior to making an amphibious invasion, and because Morgan is in a Pact with me and I'm wearing the Drones down it's quite possible that that his invasion will capture a base. How you make the AI understand these different strategic situations I don't know. Acquiring needlejets early and rushing opponents is, I think, more of a player thing to do than an AI thing to do. Unless things are very unbalanced there's only a narrow window where one side has needlejets and the other doesn't. In a game where the player is working towards a Transcend victory, the AI is going to spend many turns when it has access to needlejets but does not have the economic/technological advantages to use them for a rush. The way I see combat in this game is that you have cheap defensive units and expensive offensive units. (True whether the offensive units are rovers or needlejets.) The offensive units will almost always kill a defender when they attack (because if the odds weren't in their favour they wouldn't have attacked). So you win if either (1) the enemy exposes one of the expensive attackers killing one of your cheap defenders, and then you kill the exposed attacker, which is a good trade or (2) you find an opportunity to attack an expensive attacker when its not covered by a cheap defender, which is even better. Therefore you need a mix of offensive and defensive units, because the higher proportion of defensive units the more units you will have and the more attacks you can withstand, but too many defensive units and you can't make many attacks. The question then becomes: what is the best ratio? also EDIT: this started off with me seeing the AI moving their garrisons out not knowing that that's a bug if it's happening. Maybe the saves will help you see the conditions where it happens. I'll try to find before and after saves showing it happening later this weekend when I get time. /EDIT Just to clarify, the SP's issue was specifically about the early game situation when you're playing with faction_placement=1, or if the vanilla faction placement has put the AI far enough away from everyone else that they're too far away from each other to fight a war in the early game. I think you're correct that on a higher difficulty they would have built a reasonable number of early SP's. |
Beta Was this translation helpful? Give feedback.
-
I realized that my thinking about the Hive was being influenced by the fact that they were the Hive running police state, in particular. So +2 police +2 support means that they support 4 free units per base and can use three of them as police, so building two cheap infantry units for every base makes economic sense for the Hive in particular, costing no support but giving them economic benefits with drone management, but not for factions in general. I was thinking that adding a difficulty "game rule" that gives the AI's with Police ratings of -4 or worse a +1 situational modifier to Police could work. So -5 becomes -4, -4 becomes -3, and -3 or better isn't changed. That way SE choices with Police penalties would still carry a price that the player could see, but it would be much easier for the AI to manage, and it would be the same sort of thing as quietly giving the AI +1 industry +1 growth when the player is in 1st place. |
Beta Was this translation helpful? Give feedback.
-
If you're now playing some additional games you should upgrade to v2.8. It made some changes that could affect some of the stuff here. However some issues I will address separately in a new develop build soon.
Those are probably the most important changes. Of the other things I'm not sure what can be turned into actual changes in the AI code. |
Beta Was this translation helpful? Give feedback.
-
Develop build 20211129 is now available from downloads and it also provides this new feature:
It's extremely time consuming to tune the terraforming code though. There's just so many edge cases and different settings. This version should manage situations without boreholes available among other things better than previously. If you find some situations where the formers make weird decisions, let me know. Garrisoning code should be updated to ignore air units for defending purposes but I think the lack of defenders previously was mostly related to the cost_factor setting. At one time I actually tried playing the mod with cost_factor=5 and it was maybe doable but the endless unit spam made conquering bases a real struggle. It was common to see border bases stacked with 8+ units in that case. |
Beta Was this translation helpful? Give feedback.
-
Thinker-doer has terraforming AI that is intended to handle modded
alphax.txts, have you compared your solution to theirs? Might be something
useful that could be done as a synthesis
I haven't looked at their code, but they talk about it as if it's doing
some kind of search of the possibility space.
…On Mon, 29 Nov 2021, 18:02 induktio, ***@***.***> wrote:
Develop build 20211129 is now available from downloads and it also
provides this new feature:
- To ease calculations, base hurry dialog will now display the minimum
required hurry cost to complete the item on the next turn. This assumes the
mineral surplus does not decrease, so take it into account if adjusting the
workers. When entering a partial payment, this minimal amount will be the
default choice in the dialog, instead of the full hurry cost like
previously.
- Cost factor is updated to have a smoother progression for each
difficulty setting.
- Holo theatres are built more often in the bases when they are needed.
- Formers will build solar panels slightly more often on suitable
rainy/moist+farm tiles.
- The whole terraforming code is adjusted to do more cost benefit
checks to account for more possible alphax.txt rule changes.
It's extremely time consuming to tune the terraforming code though.
There's just so many edge cases and different settings. This version should
manage situations without boreholes available among other things better
than previously. If you find some situations where the formers make weird
decisions, let me know.
Garrisoning code should be updated to ignore air units for defending
purposes but I think the lack of defenders previously was mostly related to
the cost_factor setting. At one time I actually tried playing the mod with
cost_factor=5 and it was maybe doable but the endless unit spam made
conquering bases a real struggle. It was common to see border bases stacked
with 8+ units in that case.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AESXNWNMLYUUO64GQHLLGSLUOO523ANCNFSM5I3OZUGA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
Well, if you look at WTP's former code, it's a completely separate solution that does not integrate on Thinker's codebase at all. It's somewhat hard to read such code and it is quite long. WTP's code might also rely on some additional patched features on the game. I think it patched condensers for example. So I haven't seen yet any evidence it would ge generally better than Thinker's version. Some player commented the former code was broken there, so go figure. If you know some specific area in the code to compare for improvements that might be more helpful. Otherwise Thinker's version should be quite complete by now except it needs some additional testing for different rulesets. Those new changes in Thinker should now handle any mods such as setting borehole yield at 0-4-4 like WTP did or even disabling them altogether. Though I'm not going to change it for now since the mod is mostly using vanilla settings. Forests can be modded also but I don't recommend it, since any change there could alter balance too much because the values only use small integers and fractions are not possible. |
Beta Was this translation helpful? Give feedback.
-
Speaking of forest tiles, there might still be some situations where the current solution does not work well, especially if forest yield is modded lower than the default. It still needs some changes to account for all situations with landmarks etc. Another thing to look for is if it still builds too many condensers. They can easily bring too much nutrients for the bases. |
Beta Was this translation helpful? Give feedback.
-
Uploaded a new develop build again. Changes in this version:
|
Beta Was this translation helpful? Give feedback.
-
I started a new game with the November 29 build at difficulty 5, resetting conquer_priority to 50 about 100 turns in. Base spacing was 4 which will result in some differences from your standard games. Overall, the AI did really well - the strongest AI's had tech parity with me as late as 2240, before decisively falling behind after that. The hologram theatre issue seems to be resolved now. (I still think it should build more of base facilities and fewer units in general, but that's a base facilities issue and not specific to holo theatres. However, the AI is still abandoning bases. I looked into four instances that I particularly noticed (because I was in wars with those AIs). In one case, the base had been reduced to -1 food and negative net minerals, (for some reason it was supporting 7 formers among other units). Not surprisingly, that base was not able to build a new garrison. In the fourth case, I was advancing on an AI base from both its northeast and its southeast, and all three infantry in the base, one offensive and two defensive, left the base to try to put up an forward defence, one unit per tile, leaving the base garrisoned with one probe team and two formers. Unwise, because staying in the base would have given them better odds, and also being a player I was able to use mobile units advancing on roads supported by a copter to attack the now-undefended base from the south and west. I can provide save games if that'd be helpful. |
Beta Was this translation helpful? Give feedback.
-
Hi Induktio;
The first game was on the new "very huge" map with vanilla rules and mainly vanilla thinker.ini settings (including base spacing 3). I used your options for social_ai and faction_placement. I played to 2258 - I felt the very huge map was just too huge for my taste :).
The second game was on the new "large" (50x100) map with base spacing 4, a starting expansion_limit of 20, which I increased over the course of the game, and a number of custom changes to alphax (mostly pretty minor; I'll mention them if I think them likely to impact my comments). I used vanilla options for social_ai and faction_placement, and the Drones landed in the Jungle and took out me (but it was so early that I got a restart), the University, and the Spartans
Observations
SECRET PROJECTS
An issue on the extra huge map was that the AI's just let me take all of the early game SP's. They seemed to be too busy ICS'ing to even try to compete with me for the SP's.
On the large map I split the first 8 SP's: 4 for me, 4 for the Drones. The Drones landed in the Jungle, had a very strong start, and have been the strongest AI faction throughout the game, so that's not obviously a problem.
As a simple rule, I think that when the AI gets to six bases and is at peace it should check that it's built recycling tanks and rec commons at its capital and then just start building a SP at its headquarters.
GARRISONS
A really big problem on the large map was that by 2270 (turn 170) the base garrisoning in 2.7 was really, REALLY bad. (I haven't played much since 2.0 so I can't tell whether the changes mentioned in the changelog for 2.7 made things better or worse. But it's really bad as of 2.7.) About a third of the land bases of AI Hive and Sparta had no land units in them. This is doubly bad because both factions have SE settings that give them police bonuses, which they're not using. I can send you a save file if that would be useful.
I think it's partly a problem with the build choice AI, too. The Hive have built a lot of formers (20 land formers for 12 bases) although I'm not sure whether that's actually a problem. More problematically, they've been building a lot of aircraft at the expense of not building cheap defensive infantry, which means that now that I've landed on their continent I'm going to walk all over them. On the other side of Planet, the Drones are simultaneously doing the same thing to the Spartans.
If I were telling the AI what to do:
"Defensive infantry" are infantry with higher defence than offence, except before the discovery of synthmetal armour, when 1-1-1 infantry count as defensive infantry.
Production AI:
If they don't have a defensive infantry unit in the base, then that becomes their current build choice. They can switch to it instantly without penalty because they're the AI. (IIRC they do this in the vanilla game when you kill the last unit in their base.)
If they have researched Non-Lethal Methods, and their Police SE setting is -1 or higher, and the base has a population of or higher, then build a police defensive infantry as part of the garrison.
Movement AI:
First, if a defensive infantry is in a base, calculate target garrison size for that base:
Base of 1 defensive infantry per base.
Add 1 to the target garrison size if the faction has Police setting of 1 or higher (so allowing at least 2 police units per base) and Support setting of 1 or higher (so supporting at least 3 free units per base). [The Hive running Police State and the Spartans running Power are examples of factions that will often meet these criteria.] Maybe this only kicks in if the base is size 4 [pick a number] or higher.
Add 1 more if the game difficulty is at Thinker (difficulty 5) aka the cost_factor from thinker.ini is 8 or less. [Trading off some of the AI bonuses against the reality that the AI can't predict where attacks are going to come, so heavily garrison everything.] Again, this might only kick in for larger bases.
... for a maximum target garrison size goal of 3.
If the unit is a defensive infantry unit in a base, and the number of defensive infantry units in that base is less than or equal to the garrison goal, then the defensive infantry shouldn't move.
If the unit is a police infantry, and the base's Police setting is -1 or higher, don't move unless there are at least two police infantry units in this base.
Yes, this means they'd need to build a LOT of defensive infantry :). They should have enough defensive infantry for these garrisons and more to participate in the offensive armies. But the thing is, the game encourages these factions to build these infantry. These factions typically have high Support values, allowing them several free units, and Police ratings which means the garrisoned infantry give an economic benefit even when the faction's at peace, and, realistically, it's good for the AI to just stash defensive infantry at every base because the AI is not good at assessing the strategic situation and guessing where attacks on it are going to be made.
In my wish list of things the AI could do, it would be aware of whether it's (1) at peace; (2) nominally at war but no units are being destroyed, e.g. in a war with someone on the other side of the map; (3) in a hot war; (4) in a war and losing bases. Easier said than done.
BASE FACILITIES
The buildings that I build a lot of and the AI hardly builds any of are hologram theatres, research hospitals, tree farms, and to a lesser extent hab complexes.
For example, the Drones and the Peacekeepers are doing well in my second game. The Drones have 5 size 16 bases and 9 bases that are size 13 or larger, and they have a grand total of 1 hologram theatre. (I'm using 4-square base spacing, I modded the pop limit for bases with hab complexes to 16, and the Drones started in the Jungle, so lots of big bases.) The Peacekeepers have a size 18 base and they are just getting around to building their first holo theatre in it now.
Vanilla AI behaviour is that if a base goes into riots, and it has no rec commons, the production immediately switches to rec commons with no production penalty. If the base has rec commons, but no holo theatre (assume they don't have the Virtual World), it immediately switches to building a holo theatre. They may do the same with Research Hospitals as well; IIRC the vanilla AI builds a lot of research hospitals if it gets that far. I think this behaviour would be worth replicating.
I also noticed that the AI was building few Net Nodes (some of the AI's have built no net nodes). IMO all the AI factions should build a few early so that they can cash any alien artifacts they've found.
A longstanding issue with the terraforming algorithm is that the AI rarely builds solar panels on tiles it's built farms on. There are many tiles in AI territory with just farms, no second feature. If they don't have the technology or secret project to build condensors, building a solar panel on tiles with a farm should be standard. Sensors should be built on forests, not farms, because there's no opportunity cost to building a sensor on a forested tile.
Beta Was this translation helpful? Give feedback.
All reactions