Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Academy » perfected Fuel Usage Formula
perfected Fuel Usage Formula Thu, 20 January 2005 12:48 Go to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
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! Deal

Report message to a moderator

Re: perfected Fuel Usage Formula Fri, 21 January 2005 08:52 Go to previous messageGo to next message
Kotk

 
Commander

Messages: 1227
Registered: May 2003
perhaps your formula is correct, but what about mixed cargo fleets? I mean how is cargo splitted between individual ships?
Example:
What is the formula for fleet:
rad ram large freighter + rad ram colony ship + 2 qj5 medium freighters.
Fleet has only 600kt colonists on board, rest is empty?

Report message to a moderator

Re: perfected Fuel Usage Formula Fri, 21 January 2005 10:25 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
Hi,

In the course of experimentation I found that it doesn't matter what a fleet carries, only what engine type it's got. So, all ships with the same engine count as one mass, and the fleet total is calculated as the sum of all "masses". Empty or full doesn't matter.

How cargo is splitted among each ship is out of the scope of fuel math, though. It is done elsewhere. It should work the same as when you split fleets manually and cargo is divided proportionally among them. If further tests related to my "shipping tool" yield more useful data, I'll post it.

Hope this helps.


[Updated on: Fri, 21 January 2005 12:56]




So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: perfected Fuel Usage Formula Fri, 21 January 2005 12:19 Go to previous messageGo to next message
Kotk

 
Commander

Messages: 1227
Registered: May 2003
Another thing you should add is fuel generation both by rams and fuel generators.

I know that SFX and FT use fuel during movement and generate after movement.

Ram fuel is generated per each engine?

How lot it generates?

Thats just for completeness sake. The stars itself seems to be quite wrongly predicting there sometimes, especially for mixed engine fleets.

Report message to a moderator

Re: perfected Fuel Usage Formula Fri, 21 January 2005 13:04 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
Hi,

Yes, fuel generation is another of those things... As far as I have tested it, Stars! fuel guesstimator uses an unknown heuristic to predict effects of generated fuel.

But, for fleet travel, fuel generation should be easy to apply after movement, and its values have been published before, at least on Usenet.

I hope to have the "ship tool" more or less ready to release in a few days... Then we'll see/add/improve... Smile



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: perfected Fuel Usage Formula Fri, 21 January 2005 17:56 Go to previous messageGo to next message
Kotk

 
Commander

Messages: 1227
Registered: May 2003
m.a@stars wrote on Fri, 21 January 2005 20:04

But, for fleet travel, fuel generation should be easy to apply after movement, and its values have been published before, at least on Usenet.



Generation is negative consumption and vice versa ... its same thing actually.

Every little thing is published ton of times before. Actually their exactness is no better than that of consumption.

For example if you move your rad ram ship 25 ly then it generates less fuel than when you move it long way in random direction at warp 5. Its easy to prove and such detail is published nowhere.

As for tools go ... i actually prefer formulas. The toolmakers come and go but published formula goes nowhere.


Report message to a moderator

Re: perfected Fuel Usage Formula Mon, 24 January 2005 11:07 Go to previous messageGo to next message
LEit is currently offline LEit

 
Lt. Commander

Messages: 879
Registered: April 2003
Location: CT
Kotk wrote on Fri, 21 January 2005 08:52

what about mixed cargo fleets?

The most efficient engine at the speed gets filled first.

Kotk wrote on Fri, 21 January 2005 08:52

rad ram large freighter + rad ram colony ship + 2 qj5 medium freighters.
Fleet has only 600kt colonists on board, rest is empty?

Effectivly all the colonists would be on the large freighter and the colony ship, the qj5 freighters would fly empty.



- LEit

Report message to a moderator

Re: perfected Fuel Usage Formula Mon, 24 January 2005 12:58 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
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 Wink

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! Deal

Report message to a moderator

Re: perfected Fuel Usage Formula Mon, 07 February 2005 05:01 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
Hi,

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! Very Happy

C U @ the Board!



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: perfected Fuel Usage Formula Wed, 18 April 2018 14:20 Go to previous message
craebild is currently offline craebild

 
Lieutenant

Messages: 568
Registered: December 2003
Location: Copenhagen, Denmark
m.a@stars wrote on Mon, 07 February 2005 11:01
Hi,

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

Previous Topic: Details of fuel consumption and AR pop decay
Next Topic: W1 Orders Without Movement
Goto Forum:
  


Current Time: Fri Apr 19 15:57:18 EDT 2024