So I've been a little frustrated by the ships that the AI auto-designs for me, and also by the similarly weak vessels it fields against me. So, I went looking for just how it chooses to build them.
A little info on that for those who don't know: Turns out, it's actually not too hard to understand; when a tech becomes available, the AI looks to a list of ship designs and sees if the newly unlocked components make a new design (or new version of an existing one) available. This list can be viewed in ShipBlueprintDefs.xml. It designs by checking if minimum required components are available, like at least sensors and life support for a scout ship. After that, it fills in remaining capacity with a list of components, until finally reaching a component which is 'on repeat' (like the well-known LifeSupport modules that fill scouts and constructors) - if an improved component becomes available, the AI first selects those and then re-builds the design from the first component up, frequently not leaving room for the most recent improvement that fit in the older, lower-mass part.
So, let's take the basic scout as an example. This is the blueprint which each race's AI looks to to figure out what components their scout craft need to carry:
So, it knows it has to be a tiny hull, which must contain a sensor and life support module; on a basic no-bonusses race with no research, that uses 14/25 space on a tiny hull. That leaves 11 (tons of?) capacity, which is enough for it to take the next item on the list: the InterstellarDrive component, as a hyperdrive takes 10 capacity. That comes to 24/25 capacity, the design is complete.
So, what happens when we research a tech? Let's say Interstellar Travel. (fast forward some turns, IT completes)...
Now the AI sees there's new parts available, woohoo! Design upgrade time. What do we get?
We went from the ship on the left, to the ship on the right.
Sensor range is up by 1; ship range is up to 30, which is great.
Ah... moves are down to 1. By the time it has actually moved the 30 hexes to get to its outer range, we can have researched a Small ship with twice the sensor range which will get there before this scout does.
How has this happened?
Well, the AI went through the design process outlined in the blueprint above:
- Fit required component: Sensor - this is the interstellar sensor which became available, it has 9 mass, 1 more than the old kind.
- Fit required component: LifeSupport - this is the new and improved environmental support, 6 mass. We're at 15 mass.
- Fit next component in queue: InterstellarDrive. We're at 15 mass, and the hyperdrive takes 10 mass, that's great!
... except that it's not. Now that you've researched Interstellar Travel, you've unlocked the Hyperdrive Plus, and that takes 12 capacity. The AI sees that its InterstellarDrive component will not fit, so it skips that and goes to the next thing in the list: LifeSupport. Now the design is full, and you get a scout with great range which can not win a race against the shipyard which built it.
This quirk causes similar issues in lots of designs. For instance warships may go from 16 point defense with 2 Chaff components at 9 mass each, 'upgrading' to 12 point defense because it can only fit 1 Point Defense module at 10 mass per component. Constructor vessels may lose a second construction module because of upgraded life support or drive tech.
I propose the following tweaks:
A: When the AI is building a ship and comes to a component in the blueprint it can't add, it should check to see if it can add a lower-tech version of that component.
B: The ship-buiding AI should compare it's new design to the previous version, and determine if certain critical characteristics have not decreased. Specifically:
- An interceptor upgrade should not go through if it's Moves stat has reduced.
- Assault & Escort should not 'upgrade' if it reduces the amount of firepower they can field.
- A Guardian should not 'upgrade' if it ends up with less (average/cumulative) defence than its previous version.
- Capital ships should not 'upgrade' if their total of firepower + defenses is lower than the previous build.
- (or perhaps a cumulative amount for attack+average-of-defenses for some of the above?)
- Support should not 'upgrade' if this means reduced Construction/Troop/Colony capacity.
Further, individual ship blueprints can use a little work here and there, optimizations like adding a second sensor component to the scout blueprint after the second Life Support; the DefenseKnight should have a PointDefense component in its ComponentType lineup; PrototypeSurvey and Explorer ships should probably alternate life support and sensors, rather than loading up on life support first, and they would greatly benefit from having InterstellarDrive as a FillerComponentType; the Cutter, Defender and Gunboat types will be more viable if they get InterstellarDrive, then secondary defenses, and only then their fourth weapon; etc etc.
This post is getting too long to go in to all those specifics, but it'd be cool to give the ShipBlueprintDefs.xml a once-over with some more experienced players later