Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost

Home » Stars! 2.6/7 » The Academy » Guts of calculating cargo when fleets split.
Guts of calculating cargo when fleets split. Thu, 13 January 2022 15:51
ricks03 is currently offline ricks03

Officer Cadet 1st Year
Creator of TotalHost and Stars! utilities
Created TotalHost and Stars! utilities

Messages: 209
Registered: January 2012
Location: NC
I'm trying to figure out the formula for how cargo splits when a fleet splits. At a simple level, it's:
$cargoFleetA * ($cargoCapacityFleetA / ($cargoCapacityFleetA + $cargoCapacityFleetB)
$cargoFleetB * ($cargoCapacityFleetB / ($cargoCapacityFleetA + $cargoCapacityFleetB)

Which of course almost always leaves you with a fraction. Yet simply rounding the result doesn't provide the correct answer in all cases; there's variance +/- 1

I have a fleet, that starts out with 58800+7000 cargo space (the two resulting fleets combined cargo) before the split, and 515,180,270,252 cargo.

Simply applying the above formula after a split should give:
55,19,29,27 cargo
460,161,241,223 cargo

where Stars! reports:

So it's not simple rounding. I can get close to the right formula, but can't quite get there. Split all also spreads out results across fleets somehow. Anyone ever figured this out?

[Updated on: Thu, 13 January 2022 16:31]


Report message to a moderator

Previous Topic: Still alive...
Next Topic: What planet information do you get without scanners?
Goto Forum:

Current Time: Sat Jan 22 10:14:31 EST 2022