Jump destinations?

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Jump destinations?

Post by Commander McLane »

I recall that we debated the possibility of making the systems which are in 7LY reach from the current system available in JavaScript (as a system property, presumably).

Don't find anything like that in the wiki. So I take it this doesn't exist yet? :?:
User avatar
Dr Beeb
Dangerous
Dangerous
Posts: 127
Joined: Sun Mar 23, 2008 10:28 pm
Location: Mt. Vista, Oosa, Biarge System, Galaxy 1

Post by Dr Beeb »

I am not aware if this had been done, all I can offer is some work I did in that direction, at
http://wiki.alioth.net/index.php/Oolite ... t/Galaxy_1

I listed those within 7 LY within { } , e.g
# 7. Lave (20,173), {39,46,55,129,147,255} within 7.0 LY.
If a javascript has access to the galactic coordinates , e.g. (20,173) for Lave, then distances could be calculated independently, sqrt(Delta_x^2 + Delta_y^2)*4/10 where the Delta_y has to use the difference in y coordinates divided by 2 and rounded towards zero. Rounding errors can be a pain, see
http://wiki.alioth.net/index.php/Talk:O ... lanet_list

The Oolite code itself has

Code: Select all

OOINLINE double distanceBetweenPlanetPositions ( int x1, int y1, int x2, int y2)
{
	int dx = x1 - x2;
	int dy = (y1 - y2)/2;
	int dist = sqrtf(dx*dx + dy*dy); // here's where the rounding errors come in!
	return 0.4 * dist;
}
in legacy_random.h which I believe is what the game actually uses.

As an aside, another topic is talking about nav arrray not calculating fastest journey time, I think that could be fixed by changing the cost function to the square of the trial distances?
White dots were so much easier to hit
Post Reply