Page 1 of 1

locating objects in space

Posted: Mon Feb 22, 2010 12:33 pm
by Zbond-Zbond
I have located 32 objects (per galaxy) in space, in the vicinity of 32 stars. In the case of galaxy 4 stars may go nova, and when they do they move to a different position = where the planet used to be but further away (by about an order of magnitude it seems).

In defining an object I am adding, its co-ordinates for position are mentioned, as are the parameters for "orientation" - the latter appearing to be a group of quarternions (?).

Here is an example of code for one such object:

Code: Select all

{
"gebiisso1_kbo" = {
		position = "1755331 -6950000 2499850";
		radius = 597;
		orientation = "0.02 0.1 0.014 0";
		texture = "gebiisso1_kbo.png";
		"rotational_velocity" = -0.215;
		};
For this commander Gebiisso has gone nova and changed position.

In that case, cue: 2nd object.

Here is an example of code for the 2nd object:

Code: Select all

"gebiisso2_kbo" = {
		position = "95000 -195000 -5100000";
		radius = 125;
		orientation = "0.5 0.5 0.5 0.5";
		texture = "gebiisso2_kbo.png";
		"rotational_velocity" = 0.45;
		};
QUESTION 1 - I have looked at the script for the Nova Mission but can't see any reference to how stellar positions are varied. Neither can I find anything about positioning planets; planetinfo.plist (in the main game folder) seems to be about something else. When the nova-star moves (after the nova mission) I assume that one (ex-planet) co-ordinate is altered, which moves the star further away than the planet used to be, but that moves it along the other co-ordinates a bit, too (unless all 3 are changed) .. .. so the question is Can I find out what the NovaStar/Planet co-ordinates for position are?

QUESTION 2 - As the above sounds likely to be rather involved, and since I've already positioned everything anyway, is there something I can add to the code so that (in the above example) .. ..
Before Gebiisso goes nova KBO 1 is used, but
After Gebiisso goes nova KBO 2 is used instead?

..and if all this is too messy due to the mission being part of the core game, as I suspect will be the case, then I'll just have 2 KBO's in galaxy 4, I suppose c'est la vie

cheers (any suggestions/comments welcomed)

P.S. here is the code adding (in this case) both of the above objects:

Code: Select all

	"3 141" = {
	"script_actions" = (
		debugOn,
		"addMoon: gebiisso1_kbo",
		"addMoon: gebiisso2_kbo",
		debugOff
		);
	};

Posted: Mon Feb 22, 2010 12:46 pm
by Commander McLane
I'm not exactly sure what you are asking, but I hope it will be helpful to know that the coordinates in your example (without a prefix) are using Oolite's internal coordinate-system, which is JS is accessible with the prefix "abs". Its origin is at the witchpoint and the z-axis goes towards the planet (so the planet is located at "abs 0 0 something-positive").

Oh, and you can delete the "debugOn" and "debugOff" in your OXP. Only clutters the log.

Posted: Mon Feb 22, 2010 1:12 pm
by Commander McLane
Commander McLane wrote:
I'm not exactly sure what you are asking
To expand a little on this: I understand that you want to put objects into systems which have gone Nova.

I don't know what objects, and what for, but I hope that you are aware that systems which have gone Nova are henceforth uninhabitable. To be precise: If the player jumps into a system where the sun has gone Nova, he will be dead in (usually) a matter of seconds. Therefore I don't really see the point in placing objects in these systems. The player won't be around long enough to even notice them, not to speak about flying towards one of them or interacting with them.

Systems where the sun has gone Nova are pretty much out-of-the-game, they're dead. So from a gameplay perspective it doesn't make a lot of sense to do anything with them.

But then again—as I said—I haven't really understood what you're planning.

Posted: Mon Feb 22, 2010 1:14 pm
by Zbond-Zbond
I take it that 0 0 something positive places the planet directly in front of you

I would like a list of where all the planets are positioned, relative to the witchpoint, so that I can position an object in the opposite direction (after the sun has gone nova). The Nova is not exactly where the planet used to be.

I would also like to add objects like this:

"3 141" = {
"script_actions" = (
"before Nova Mission addMoon: gebiisso1_kbo",
"after Nova Mission addMoon: gebiisso2_kbo",
);
};

but don't know how to achieve that (I don't know what to type instead of the red bits)

Thanks for a rapid response, and I have removed the debug bits.
:)

Posted: Mon Feb 22, 2010 1:37 pm
by Eric Walch
Zbond-Zbond wrote:
II would also like to add objects like this:

Code: Select all

"3 141" = {
 "script_actions" = (
 "[color=red]before Nova Mission[/color] addMoon: gebiisso1_kbo",
 "[color=red]after Nova Mission[/color] addMoon: gebiisso2_kbo",
		);
	};
Probably use conditions as that what you have:

Code: Select all

"3 141" = { 
	"script_actions" = ( 
		{
			conditions = ("sunGoneNova_bool equal NO"); 
			do = ("addMoon: gebiisso1_kbo");
			else = ("addMoon: gebiisso2_kbo");
		}
	); 
}; 
But duing it with a JS script is also possible

Posted: Mon Feb 22, 2010 1:45 pm
by Zbond-Zbond
Well there are a number of things you can do at a Nova star. By flying directly away from the nova (in a negative direction along the z axis) the cabin temperature does stop climbing. Eventually it drops. That means you could land on a Kuiper Belt Object - which the game treats as a moon - and refuel, or whatever.

Originally I just wanted somewhere to refuel at Gebiisso, it being a rather inconvenient place to drop out of the game, but have positioned 32 such objects near other stars, and intend to complete the set with objects among the other galaxies too. It has taken some time what with one thing and another, but these other ones won't take so long now that I know what I'm doing.

The Nova problem only arises in G4, and only at one planet, but I can't know where other Commanders' Nova Missions will occur. If it's too complicated to link with the native Nova Mission itself, then I won't bother - but if it's easy to check for the status then I will include what is necessary; this? or something similar?

Code: Select all

if (!system.sun.hasGoneNova)
so that only one KBO is added, and it is exactly opposite the star, wherever the star is (which depends on whether it has gone nova or not).

Posted: Mon Feb 22, 2010 1:54 pm
by Zbond-Zbond
Eric Walch wrote:
Probably use conditions as that what you have:

Code: Select all

"3 141" = { 
	"script_actions" = ( 
		{
			conditions = ("sunGoneNova_bool equal NO"); 
			do = ("addMoon: gebiisso1_kbo");
			else = ("addMoon: gebiisso2_kbo");
		}
	); 
}; 
OK I'll try that

If I can't get all nova co-ordinates, then positioning KBO opposite extant planet is probably close enough for the limited liklihood of anyone going there..

Posted: Mon Feb 22, 2010 2:18 pm
by Commander McLane
Planet coordinates are calculated from the system seed only when you enter the system. Therefore you can't know beforehand for any system where the planet will be relative to the witchpoint.

If you want to place an object sufficiently far away behind the player's back, you just have to try out some numbers in different systems.

Usually the planet is between 300000 and 900000 meters from the witchpoint, so you could start with (0 0 -900000) and see if it suffices in all cases.

Posted: Mon Feb 22, 2010 3:05 pm
by Zbond-Zbond
Thank-you for the suggestions -- the code to choose which object to add (depending on whether G4 sun is nova or not) works, and only one is added.

The removal of "de-bug" bit hasn't affected anything.

Whenever I arrive at a witchpoint the sun & planet are more or less in the same position. The "W" beacon moves around a bit though. A nova is more or less where the planet was, but moved back along the z axis. Racing off in the opposite direction for about 5 or 6 million units (metres) is sufficient to start cabin cooling again, but might need a fast(ish) ship. I had assumed that the planets would be generated from the same seed for everyone?

Reading oolite-nova-mission.js in the resources folder suggests that the station formerly orbiting the planet ought to have been blown up. Nevertheless its blackened husk remains. I visit it for fun. Leaving is very difficult. But is it supposed to be there?

My Kuiper Belt Objects do not have stations, relying on PlanetFall.oxp for landing. Without a station (& associated beacon) they need to be positioned fairly precisely, so the whole exercise has been fairly time consuming, and there was probably a better place to start than G4! but now I've worked out what I'm doing additional KBO placement in other galaxies - not to mention getting surface textures to look a bit interesting - will be much more rapid.

Thanks again for the various tips here & in other posts :D

Posted: Mon Feb 22, 2010 3:27 pm
by Commander McLane
Zbond-Zbond wrote:
Whenever I arrive at a witchpoint the sun & planet are more or less in the same position. The "W" beacon moves around a bit though.
The sun and planet are exactly in the same position each time you arrive in the same system. What moves around is you, because your ship gets spawned randomly within a certain radius from the witchpoint.

Also until Oolite 1.73.4 the witchpoint buoy is spawned within a certain radius from the system origin. This will change in 1.74. From 1.74 on the witchpoint buoy will be placed exactly in the origin, because there are actually no advantages in having it randomly somewhere close to the origin.
Zbond-Zbond wrote:
I had assumed that the planets would be generated from the same seed for everyone?
Yes, that's more or less the meaning of "seed", isn't it?

The planet Lave will be placed at exactly the same location for everybody. And the planet Zaonce will be at exactly the same location for everybody. And so will any other planet and sun. Otherwise, we wouldn't be playing the same game, would we? But of course the planet Lave is placed at a different location than the planet Zaonce, or any other planet in the Ooniverse. And the sun in the Lave system is placed at a different location than the sun in the Zaonce system, or in any other system in the Ooniverse. The game would be pretty boring if each system looked exactly the same, wouldn't it?