[:1]There is a very simple fact about the platoon list that is not at first obvious: each platoon is persistent, and can only have one instance of itself alive at any time. A way around this, sort of, is InstanceCount: it places more than one copy of the platoon you put in the archetype file into the platoon list. This is not a problem for unit platoons that require construction, because the choice there is properly random (within a given priority level). This is, however, a giant problem for platoons that do not require construction (i.e. every platoon that builds a building or experimental!), because platoon _formation_ (rather than construction) is not done randomly. Instead, the loop to form platoons is very simple.
The loop's input is the sorted (stably--file order persists for a given priority level) platoon list. All the loop does is, for every platoon in the list, check to see whether it can be formed and, if so, form it.
This has unintended consequences. For example, it means that, given a land experimental appears before an air experimental in the archetype and they share the same priority and build conditions, no air experimental will be built unless a land experimental is in progress, even though one would think that, like factory-unit platoons, one would be chosen randomly.
This also interacts with InstanceCount. Traditionally, the non-random part is hidden, because, given that only one instance of a platoon can exist at any time, the AI will generally build all structures/exps of the same priority (and often some of less priority, because there aren't enough hi-pri builds to take up all engineers), because it has a lot of engineers. But if one wants to actually weight the chances of a given platoon forming to build a structure (per the description of InstanceCount), InstanceCount will in fact be counter-productive. If each experimental is set an InstanceCount of 5, and a nuke 3, then the AI will commence construction of five of the first type, only then five of the second type, etc., and if it has more than 15 T3 teams, only then will it build the first nuke--and the second, and the third, before moving on to something of lower priority.
Even for factory-built platoons, InstanceCount doesn't merely weight the chance of the platoon, it also sets how many can exist at one time (and thus also how likely the AI is to ever build a platoon of lesser priority). Conversely, a low InstanceCount means the AI will likely end up building a good number of lower-priority platoons too. One way to avoid that is to restrict lower-priority platoons with build conditions that become false once higher-priority platoons are available (i.e. less than n T3 factories), but unless the higher-priority platoons have sufficiently high instance counts, the factories may end up sitting idle once all the possible platoons are built.
(NB: I rewrote requiresconstruction=false platoon handling to make that random and similar to reqconst=true platoons, if you want to change this behavior; see the [Further Tweaks to Sorian and Jaws2002] thread)
No comments:
Post a Comment