Home » Stars! 2.6/7 » The Academy » perfected Fuel Usage Formula
perfected Fuel Usage Formula |
Thu, 20 January 2005 12:48 |
|
m.a@stars | | Commander | Messages: 2768
Registered: October 2004 Location: Third star to the left | |
|
Hi all,
I wonder if this is the place to post some info about what I've been up this Xmas.
In the course of accreting some useful in-game tool for ship moving, I stumbled upon the notorious inaccuracy of the published fuel usage math. So I spent some idle afternoons doing a full set of tests to get at the root causes.
I nailed the fuel formula down to almost the last wrinkle. I got it working inside my "trip tool" for a few weeks now. The tool itself is still far from completion, but I think if someone wants to check/test/demolish my fuel math, there's no reason to wait.
Here it goes:
The math itself is amazingly simple and accurate, and also explains the discrepancies in Stars! own fuel usage guesstimator. It has worked flawlessly for a thousand tests under AutoHost's Stars! 2.6jRC4.
I even put it in a JavaScript/html wrapper for all to use/improve, but I don't trust Usenet to carry it faithfully.
In short, it works like this:
1.- Round the distance up, except if the new distance is farther than speed*speed, in which case it is rounded down.
2.- Apply IFE to engine efficiency, and round the result up, too.
3.- UsedFuel1 = mass * distance * efficiency / 2000, rounded down.
4.- UsedFuel = UsedFuel1 / 10, rounded up.
Number 1 was the easier, and its exception is a source of major discrepancies in all previously published fuel usage formulas, including Stars! own fuel display.
Number 2 was the trickier, even if obvious in hindsight, source of inaccuracy.
Number 3 and 4 are just the theoretical calculation, done in two steps to follow a minor discrepancy in final results, which seem to only take the 1st decimal place into account.
I believe the actual fuel math used in Stars! to be the adaptation of the theoretical fuel formula to integer math, to render a frequently used function as fast as possible.
Stars! own fuel guesstimator seems to use the same formula, by feeding to it an "idealized" distance that is not consistent with actual fuel usage in a wide variety of cases, as follows:
1.- Find the number of "whole" hops the trip will need, assuming each one travels exactly Warp*Warp ly (zero if Distance is less than Warp*Warp).
2.- Find FuelEstimate1 using numHops*Warp*Warp as the distance.
3.- Find FuelEstimate2 using Distance-numHops*Warp*Warp as the distance.
4.- Add both FuelEstimates to get the almost-right fuel guesstimation.
I've also found a few more minor/harmless bugs while testing this, all seemingly due to integer math shortcomings.
I hope people find this useful.
Comments, suggestions, welcome.
[Updated on: Thu, 20 January 2005 12:52]
So many Stars, so few Missiles!
In space no one can hear you scheme! Report message to a moderator
|
|
| | | | | | |
Re: perfected Fuel Usage Formula |
Mon, 24 January 2005 12:58 |
|
m.a@stars | | Commander | Messages: 2768
Registered: October 2004 Location: Third star to the left | |
|
Hi again,
After a tweak-intensive weekend, I'm ready to release the first beta of my "fleet tool", with limited yet useful abilities. It's written in html/javascript, so the formulae will be in the open for all to see/copy/improve.
At the moment, only fuel calculations (for fleets with the same engine type) and some trip optimizations are included. LEit and maybe others might find some familiar-looking code
As for RAM-scooping, Fuel generators and cargo splitting, I'm willing to waste a few more afternoons testing them. See, Kotk is not the only one thinking about a Freestars automated AI/bot/player that will need to handle things like that ;-D
I'm also getting ready other things, soon to be released, too.
C U @ the Battleboard!
[Updated on: Mon, 24 January 2005 14:36]
So many Stars, so few Missiles!
In space no one can hear you scheme! Report message to a moderator
|
|
| |
Re: perfected Fuel Usage Formula |
Wed, 18 April 2018 14:20 |
|
craebild | | Lieutenant | Messages: 568
Registered: December 2003 Location: Copenhagen, Denmark | |
|
m.a@stars wrote on Mon, 07 February 2005 11:01Hi,
Thanks to the invaluable help of CRaebild, my "fuel tool" has gained lots of improvements and also a home on the web. The URL is:
http://home20.inet.tele.dk/craebild/hab_range_tool/fuelusage .html
Experimentation is still going on, so fuel generation and cargo splitting could be included in the near future. Stay tuned for more! [img=images/smiley_icons/icon_biggrin.gif]Very Happy[/img]
C U @ the Board!
That URL for the fuel calculator does not exist any longer, the correct URL is now http://craebild.dk/hab_range_tool/fuelusage.html
Med venlig hilsen / Best regards / Mit freundlichen Grüßen
Christian Ræbild / Christian Raebild
Report message to a moderator
|
|
|
Goto Forum:
Current Time: Thu Dec 12 00:11:11 GMT-5 2024
|