Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Academy » Distance rounding errors
Distance rounding errors Sat, 02 April 2005 05:55 Go to next message
Storm is currently offline Storm

 
Ensign

Messages: 359
Registered: February 2005
Location: Wanker's Corner

griboedov wrote on Sat, 02 April 2005 12:41

Yet another annoying feature (but predictable, so less severe):
Distances just over 162ly (i.e. 162.04) are often calculated as a 2 year trip. A similar thing happens when I plan to settle at warp 8 and the distance is 128.01


I can't comment on the first point, as I've never seen it happen!
If you've set the speed after splitting, then the speed should not change unless it runs out of fuel.

As for the second point, I believe that's a well known "bug".
You can actually travel a fraction of a light year further than you would expect at any given Warp.

It's a rounding error.... Rolling Eyes

[Mod edit: added quote after splitting topic]


[Updated on: Sat, 02 April 2005 08:20] by Moderator





** Storm **

"Yeah... but... Jar Jar makes the Ewoks look like f***ing Shaft!"

Report message to a moderator

Re: Distance rounding errors Sat, 02 April 2005 06:15 Go to previous messageGo to next message
mazda is currently offline mazda

 
Lieutenant

Messages: 655
Registered: April 2003
Location: Reading, UK
griboedov wrote on Sat, 02 April 2005 11:41


Yet another annoying feature (but predictable, so less severe):
Distances just over 162ly (i.e. 162.04) are often calculated as a 2 year trip. A similar thing happens when I plan to settle at warp 8 and the distance is 128.01

I use this all the time for early pop movement.
Getting the furthest distance at a lower speed, or gaining an extra l.y.
e.g. to go 131 l.y. you'd try and go roughly 49.5 at W7 and 81.5 at W9.
Sometimes there isn't a suitable point to split the trip at - e.g. if you are going due N-S or E-W then you can't do it. The further you are from the vertical or horizontal then generally the better.

[Mod edit: changed title]


[Updated on: Sat, 02 April 2005 07:31] by Moderator


Report message to a moderator

Re: Distance rounding errors Sat, 02 April 2005 08:12 Go to previous messageGo to next message
Micha

 

Messages: 2342
Registered: November 2002
Location: Belgium GMT +1
mazda wrote on Sat, 02 April 2005 13:15

Sometimes there isn't a suitable point to split the trip at - e.g. if you are going due N-S or E-W then you can't do it. The further you are from the vertical or horizontal then generally the better.


You can also travel 201 ly in 2 turns at warp 10. Wink

mch

Report message to a moderator

Re: Distance rounding errors Sat, 02 April 2005 11:04 Go to previous messageGo to next message
iztok is currently offline iztok

 
Commander

Messages: 1206
Registered: April 2003
Location: Slovenia, Europe
Hi!
Storm wrote on Sat, 02 April 2005 12:55

It's a rounding error.... Rolling Eyes

True. Stars! has to calculate the real number diagonal movement into intiger number coordinates. If you check the distance your ship has made, you'll see it has traveled only 80.9 LY (or STH similar), and ended in "wrong" position. I've also found that "bug", so in really "tight" conditions (exactly n*81 or n*64 etc.) distances I manually set up the way points, just to be sure they'll really arrive at the right time.
BR, Iztok

Report message to a moderator

Re: Distance rounding errors Sat, 02 April 2005 16:52 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,

iztok wrote on Sat, 02 April 2005 18:04

Hi!
Storm wrote on Sat, 02 April 2005 12:55

It's a rounding error.... Rolling Eyes

True. Stars! has to calculate the real number diagonal movement into intiger number coordinates. If you check the distance your ship has made, you'll see it has traveled only 80.9 LY (or STH similar), and ended in "wrong" position. I've also found that "bug", so in really "tight" conditions (exactly n*81 or n*64 etc.) distances I manually set up the way points, just to be sure they'll really arrive at the right time.
BR, Iztok



I've found the same, plus with the way fuel spent is calculated, it really pays to adjust waypoints by hand. The link to a handy version of the tool I made is at the end of:

http://starsautohost.org/sahforum/index.php?t=msg&th=218 8&start=0&rid=625&S=7afe59abe659308efa3558d6c5e4 8f1b

Included in the tool are:
- Exact fuel costs calculations. Cool
- Simulation of the unreliable "fuel bar" Stars! shows. Confused
- "Default path" simulation.
- Warp optimization.
- "Roundoff/endpoint" optimization, often with spectacular gains. Very Happy
- Lots of comments.

Besides, it's all JavaScript, so no hidden code, etc... I've used it in several games, even for the earliest colonizers! Twisted Evil

Anyone can improve it, of course. I can PM the latest version to those interested. Razz

C U!


[Updated on: Sun, 03 April 2005 06:57]




So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Distance rounding errors Sun, 03 April 2005 05:10 Go to previous messageGo to next message
PricklyPea is currently offline PricklyPea

 
Lieutenant

Messages: 534
Registered: February 2005
m.a@stars wrote on Sat, 02 April 2005 16:52

I've found the same, plus with the way fuel spent is calculated, it really pays to adjust waypoints by hand.


Interesting work! Smile

I wonder how much effort it would be to patch this into stars EXE? Would love to just click destination point and have all intermediate waypoints automatically plotted.

Hmm...

Report message to a moderator

Re: Distance rounding errors Sun, 03 April 2005 06:55 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
PricklyPear wrote on Sun, 03 April 2005 11:10

Interesting work! Smile


Thanks. Fuel was not hard, but coordinates optimization was tricky as hell. Twisted Evil

Suggestions for future versions welcome! Smile


Quote:


I wonder how much effort it would be to patch this into stars EXE?


Phew. Who knows. The optimizing algorithms won't fit in a few rearranged bytes, that's sure. Confused But perhaps the not-quite-reliable "fuel bar" that Stars! displays could be adjusted with only a little work? Sherlock That would be a handy first step. Very Happy

Quote:


Would love to just click destination point and have all intermediate waypoints automatically plotted.


Me too. My colonists would save a lot of worries! Wink

But I hope it can be included in some Freestars client! Cool



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Distance rounding errors Sun, 03 April 2005 16:24 Go to previous messageGo to next message
PricklyPea is currently offline PricklyPea

 
Lieutenant

Messages: 534
Registered: February 2005
>>>
Phew. Who knows. The optimizing algorithms won't fit in a few rearranged bytes, that's sure. Confused But perhaps the not-quite-reliable "fuel bar" that Stars! displays could be adjusted with only a little work? Sherlock That would be a handy first step. Very Happy
<<<

I think I might look at this as part of my mod. If you have a bit of time, maybe I can discuss with you?

Report message to a moderator

Re: Distance rounding errors Sun, 03 April 2005 16:41 Go to previous message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
PricklyPear wrote on Sun, 03 April 2005 22:24

>>>
Phew. Who knows. The optimizing algorithms won't fit in a few rearranged bytes, that's sure. Confused But perhaps the not-quite-reliable "fuel bar" that Stars! displays could be adjusted with only a little work? Sherlock That would be a handy first step. Very Happy
<<<

I think I might look at this as part of my mod. If you have a bit of time, maybe I can discuss with you?


Sure! Very Happy



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Previous Topic: splitting a mixed fleet results in different speeds?
Next Topic: UR as start-boost. Viable?
Goto Forum:
  


Current Time: Fri May 03 09:32:10 EDT 2024