Strategic AI Mod

A place for discussion of making game modifications.
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Strategic AI Tweaks

Post by zolobolo »

Staffing Curve bug

Noticed now that Humans have a hard time holding on to their scout
Attachments
Strategic AI Testing.rar
(215.59 KiB) Downloaded 618 times
Set City Planning.png
Set City Planning.png (95.25 KiB) Viewed 17258 times
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Strategic AI Tweaks

Post by zolobolo »

The change to production descaling according to metal seems to have worked very well in practice

Below picture shows Yoral reinforcements after they have suffered heavy losses in the previous war and already in possession of Battleship tech. Previously they would have lost dozens of turns building up a couple of Battleships

This makes not only for interesting battles but the AI is now capable of recovering from losses much faster. The below is (while cost effective) also a very potent fighting force in by of itself with plasma batteries as well as numerous medium guns and torpedoes
Attachments
varried fleets.png
varried fleets.png (268.73 KiB) Viewed 17256 times
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: Strategic AI Tweaks

Post by harpy eagle »

zolobolo wrote:Staffing Curve bug
Fixed in 4dfbabf, also fixed a bug in build time estimation that occurred when the planet had produced enough hammers to build the ship this turn, but was lacking metal.

I also noticed in that save game the Tinkers were not colonizing for some reason. When I looked into it though, it seemed like an issue with fleet routing (which my mod doesn't touch yet).

Speaking of Tinkers, I should probably do something similar for their "construct population" option as what I did for city planning.
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: Strategic AI Tweaks

Post by harpy eagle »

zolobolo wrote:
sven wrote: If you turn on the 'developer' options by creating a 'show_hidden_options.bool' (as described here)
Thanks for the tip, and for supporting the modding community so fully - the DEV options menu is a real treasure trove
Yeah, there's some really nice tools in there. I just discovered one that visualizes the current AI fleet plans, it's pretty cool. You can see exactly what the AI is thinking when routing fleets, without having to squint at pages of console output.
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: Strategic AI Mod

Post by harpy eagle »

Update: Added support for Tinker's manufacture pop build project.
CapnDarwin
Posts: 14
Joined: Wed Apr 04, 2018 5:29 pm

Re: Strategic AI Mod

Post by CapnDarwin »

@Harpy Eagle - Should this mod have one folder or two. Currently it has a Financial AI (not sure of the exact name) and earlier versions had Strategy AI. What is the correct configuration for the mod?

Thanks!
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Strategic AI Mod

Post by zolobolo »

Here is a picture of what I was thinking under make all attributes visible

Why is this useful?
Now that the AI is capable of building Outposts and having more ship (via this mod), it can finally make use of the already existing starvation mechanic and blockade all planets within its reach which it should absolutely do if possible for the following reason:

Blockading has always been a massively potent strategy as it:
1. Does not require a strong naval force in order to wear down Planetary Defenses (single ship no module requirement)
2. Does not require a strong ground forces (none)
3. Planets with food shortage and blockaded directly will start starving out immediately
4. All planets with food shortage will start starving once the empire as a whole is in minus: and most empires do not have large amount of food surplus Thus blockade of even a couple of planets can deplete the reserves of even the strongest empires
5. Each Turn starvation effects any planet, all effected pops suffer considerable moral penalty which also directly translates over to all other pops of the same type throughout the entire empire!
6. Blockade also prevents planetary construction rushes effectively preventing the prompt reaction to a sudden war if done against industry worlds

The above makes blockading one of the absolute best strategies when up against an enemy that has at least somewhat capable defenses. It mitigates combat risk to fleet and ground forces, cheap and effective. It also enables small empires to defeat a single large one as they do not need the space nor ground superiority to inflict wide-spread damage which is amplified by the size of an empire: more planets are pops mean, more trouble defending them and more food for feeding + starvation effect multiplied by the amount of pop overall

The player can and should of course also make use of this mechanic, but without clear and accessible indication of what the surplus of an enemy empire exactly is, it takes some hoops to jump through before this strategy can effectively be put into use and verified if it is applied

The same also goes for all the other parameters, but I think that food capacity indicators are the most vital information due to the blockade mechanic (and the diplomacy trade offers to buy some because of them)
And the mechanic is great: hope to use it and see it more often as it makes for more space battles (less sieges against planets and identical starbases) and it rewards area of control vs doom-stacks
Attachments
Info.png
Info.png (292.09 KiB) Viewed 17221 times
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: Strategic AI Mod

Post by harpy eagle »

CapnDarwin wrote:@Harpy Eagle - Should this mod have one folder or two. Currently it has a Financial AI (not sure of the exact name) and earlier versions had Strategy AI. What is the correct configuration for the mod?

Thanks!
My bad, the earliest versions of the mod were in a folder called StrategyAI, but I later renamed that to EconomyAI. There should only be one folder, and it should be EconomyAI.
CapnDarwin
Posts: 14
Joined: Wed Apr 04, 2018 5:29 pm

Re: Strategic AI Mod

Post by CapnDarwin »

Thanks. I will need to fix my install this evening.
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: Strategic AI Mod

Post by harpy eagle »

Found and fixed a bug that was causing the AI to build too many transports, and an issue where the perceived benefit from city planning/manufacture pop was being exaggerated when handling a resource that doesn't accumulate (b361577).

Also, if the AI knows about any other empires, it now compares it's naval power with theirs when determining the urgency with which to build ships.
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: Strategic AI Mod

Post by harpy eagle »

Just realized that there's an unintended interaction between the way vanilla chooses the planets to assign to ship production, and the AI's new ability to set city planning.

When deciding which planets to assign to ship production, it ignores any planets that have empty improvement slots left. Since the AI is now much better at growing it's population, it can actually have planets with good industrial output that still have empty improvement slots. This means that in the cases where the AI really needs ships urgently, it doesn't fully utilize it's production capacity, which is what I've been noticing lately.
zolobolo
Posts: 1544
Joined: Fri Nov 25, 2016 3:49 pm

Re: Strategic AI Mod

Post by zolobolo »

Orthin keep producing Scouts as seen below

Save: https://www.dropbox.com/s/makxgphc2wrne ... 0.rar?dl=0

Is the ship produced affected by the mod at this point?
Some time ago it has been stated that the AI should chose a preferred selection of ship types each game, in which case this might be a bug in the logic putting too much priority on a ship that should practically have the lowers priority from mid-game on?
Attachments
Scout galore.png
Scout galore.png (325.49 KiB) Viewed 17183 times
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: Strategic AI Mod

Post by harpy eagle »

Yeah, I was looking into the scout spam myself yesterday, haven't gotten the bottom of it yet.

I did find that it was related to their metal cost in a way. It seems that when the AI feels it doesn't have enough metal to build a destroyer, it builds a scout instead... but scouts still cost metal, so it can never save up enough metal to reach the point where it considers building a destroyer.

Or sometimes I've seen it builds a destroyer, but as the build progresses and it gets closer to running out of metal, it switches the construction to a scout just few turns before it finishes (since scouts and destroyers share build progress). Sometimes it does this a few times in a row.

I'm still working on it. There's a "patience" variable that I probably have set too low, and I should double check that it is correctly evaluating the combat value of ships.
CapnDarwin
Posts: 14
Joined: Wed Apr 04, 2018 5:29 pm

Re: Strategic AI Mod

Post by CapnDarwin »

Is it possible that scouts are made if the percentage of undiscovered systems is still high? I just gave the Tinkers, who are basically trapped on an edge of the galaxy by my systems, the ability to use my systems for refueling. They spammed out about a dozen scouts once that happened heading of to every system within the new found range.
User avatar
harpy eagle
Posts: 296
Joined: Sat Mar 10, 2018 3:25 am

Re: Strategic AI Mod

Post by harpy eagle »

Yes the AI will make more scouts if there are a lot of undiscovered systems, and that can sometimes explain the scout building by the AI. However, when I was debugging yesterday and inspecting the reasons why the AI was building particular ships, it was also building scouts as warships. i.e. it decided it needed another warship, and then chose a scout design as it's chosen warship. I'm not sure why yet, since I haven't been able to do much modding today.

I do want to revisit the code that I have for AI ship selection though, there are some other reasons why I'm not fully satisfied with it.
Post Reply