When a fleet is split, or ships are transferred from one fleet to another, the games determines how much of the cargo - Ironium, Boranium, Germanium, Colonists, and also Fuel - each of the fleets has after the split / transfer. By manipulating the stars! files, it may still be possible to create some amount of cargo; previously, for example, it had been possible to create colonists out of "thin air" (this has since been corrected). To detect any such manipulation, I am attempting to determine exactly what logic stars! uses when distributing the cargo, so that I can integrate this knowledge into my cheat and file corruption detection tool.
However, so far the algorithm has remained remarkably elusive.
The case of a complete merging of two fleets (an extreme example of transferring ships from one fleet to another) is simple; the new fleet has the sum of the cargos of the two original fleets. No surprises there.
When splitting an existing fleet, fuel distribution also seems simple; the new fleet receives exactly the fuel it should get according to relative fuel capacities of the fleets. Any sub-integer amounts of fuel are always rounded down for the new fleet, and up for the old fleet; in this way the total amount of fuel is always the same before and after the transfer.
Total mass of the remaining cargo is handled in the same way; the new fleet has exactly the (rounded down) mass of cargo corresponding to the proportions of the cargo capacities of the fleets.
However, the way in which the separate minerals (and colonists) are distributed remains unclear. Some paticular unexpected results include:
|Case||Cargo of ...|
|Original fleet||"Parent" fleet||"Child" fleet|
|1 medium freighter split off from a fleet of 3
Capacities: 210kt -> 140kT + 70kT
4 examples with 9kT initial cargo
|1 privateer split off from a fleet of 2
Capacities: 500kt -> 250kT + 250kT
The 2nd and 3rd are natural progressions on the first,
the 4th seems to follow from neither the 1st-3rd nor the 5th
Hmm. Apparently it's been just over 4 years since I stopped working on this stuff.... but with the migration of an IRC channel I frequent from the dying starlink to freenode, jarpiain pounced me with the above probably explanation; I haven't looked into it further, but it's certainly a motivation to get back to things :)
-- Wumpus, 3.1.2010 (previous edit: 31.12.2005... oh dear :-))