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 Go to previous message
ricks03 is currently offline ricks03

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

Messages: 222
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

Example:
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:
55,20,28,26
460,160,232,224

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]




https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHost

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: What planet information do you get without scanners?
Next Topic: Bugs/Exploits in JRC4
Goto Forum:
  


Current Time: Fri Mar 29 04:45:17 EDT 2024