- Entity.position and Entity.orientation are now read-write, and Entity.setPosition() and Entity.setOrientation() are therefore deprecated as of 1.73. (Note: deprecations in 1.73 may be removed in 1.74 already, depending on how the Grand Plan advances.) Statements like ship.position.x += 100 still don’t work as expected, but making position read-only didn’t actually affect that, so what’s the point?
- Entity.ID and Entity.entityWithID() are now deprecated, along with the ability to pass an ID instead of an Entity object. I know of no good reason to be using any of these. (Note: this does not affect System.ID.)
- Added toSource() method to Vector and Quaternion. This function is similar to toString() returns a string that can be used as JavaScript code – for example, “Quaternion(-0.470127, 0.391883, -0.497289, 0.614908)” instead of “(-0.470127 + 0.391883i - 0.497289j + 0.614908k)”.
- Vectors and quaternions can now be constructed with syntax like Vector(x, y, z) instead of new Vector(x, y, z). This is not necessarily better in general, but it increases flexibility – specifically, it allows the use of apply() as seen at the bottom of oolite-global-prefix.js. Feel free to ignore this bullet point. :-)
Progress
Moderators: winston, another_commander
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Minor JavaScript changes:
E-mail: [email protected]
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
AI tweaks:
- New exitAIWithMessage: method is a generalization of exitAI. exitAI is now an alias for exitAIWithMessage: RESTARTED.
- New messageSelf: method queues a message to be handled next AI update.
- JS Ship.exitAI() now takes an optional message argument; if none, "RESTARTED" is assumed.
E-mail: [email protected]
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Subentities may now be declared as dictionaries instead of magic strings. This improves readability and flexibility (i.e. it makes it easier to add new attributes).
A subentity dictionary may have any of the following types, specified by the “type” entry: “standard”, “flasher” or “ball_turret”. No type entry implies “standard”. All subentities have an optional “position” entry, which is a vector specifier – a string with three space-separated numbers, or an array with three numbers. (The default is (0, 0, 0).)
Standard and ball-turret subentities are required to have a “subentity_key” entry, whose value is a ship key. They also have optional orientation (quaternion specifier – string with four space-separated numbers or array with four numbers; default is the identity quaternion).
Standard subentities may have an “is_dock” entry whose value is a boolean. This replaces the use of “dock” in the subentity key when using dictionaries to specify subentities; old-style subentities work as before.
Ball-turret subentities may have a “fire_rate” entry, whose value is a floating-point number greater than or equal to 0.25 (default: 0.5).
Flasher subentities have the following attributes, other than type and position: size, frequency and phase, which correspond to parts of the old-style strings (defaults 8, 2 and 0); “colors”, an array of colour specifiers, or “color”, a single colour specifier (support for multiple colours is not yet implemented); and “initially_on” (boolean, default false). As with lasers, flasher colours must be “sufficiently bright”.
Related to this change, the script method initialiseTurret no longer does anything when executed. However, its presence in setup_actions (and only in setup_actions, and not in any conditions) is used to recognise a ball turret when handling old-style sub-entities.
Here is the full subentities list for the Coriolis in the new format.
A subentity dictionary may have any of the following types, specified by the “type” entry: “standard”, “flasher” or “ball_turret”. No type entry implies “standard”. All subentities have an optional “position” entry, which is a vector specifier – a string with three space-separated numbers, or an array with three numbers. (The default is (0, 0, 0).)
Standard and ball-turret subentities are required to have a “subentity_key” entry, whose value is a ship key. They also have optional orientation (quaternion specifier – string with four space-separated numbers or array with four numbers; default is the identity quaternion).
Standard subentities may have an “is_dock” entry whose value is a boolean. This replaces the use of “dock” in the subentity key when using dictionaries to specify subentities; old-style subentities work as before.
Ball-turret subentities may have a “fire_rate” entry, whose value is a floating-point number greater than or equal to 0.25 (default: 0.5).
Flasher subentities have the following attributes, other than type and position: size, frequency and phase, which correspond to parts of the old-style strings (defaults 8, 2 and 0); “colors”, an array of colour specifiers, or “color”, a single colour specifier (support for multiple colours is not yet implemented); and “initially_on” (boolean, default false). As with lasers, flasher colours must be “sufficiently bright”.
Related to this change, the script method initialiseTurret no longer does anything when executed. However, its presence in setup_actions (and only in setup_actions, and not in any conditions) is used to recognise a ball turret when handling old-style sub-entities.
Here is the full subentities list for the Coriolis in the new format.
Code: Select all
{
subentities =
(
{
subentity_key = "dock-flat";
orientation = ( 1, 0, 0, 1); // rotated 90 degrees
position = ( 0, 0, 500 );
is_dock = true;
},
{
subentity_key = "arc-detail";
},
{
subentity_key = "arc-detail";
orientation = ( 1, 0, 0, 1 );
},
{
subentity_key = "arc-detail";
orientation = ( 0, 0, 0, 1 );
},
{
subentity_key = "arc-detail";
orientation = ( 1, 0, 0, -1 );
},
{
type = flasher;
size = 12;
color = { hue = 60; };
frequency = 1;
phase = -1;
position = ( 0, 92, 475 );
},
{
type = flasher;
size = 12;
color = { hue = 75; };
frequency = 1;
phase = -1.2;
position = ( 0, 92, 425 );
},
{
type = flasher;
size = 12;
color = { hue = 90; };
frequency = 1;
phase = -1.2;
position = ( 0, 92, 375 );
},
{
type = flasher;
size = 12;
color = { hue = 105; };
frequency = 1;
phase = -1.6;
position = ( 0, 92, 325 );
},
{
type = flasher;
size = 12;
color = { hue = 120; };
frequency = 1;
phase = -1.8;
position = ( 0, 92, 275 );
},
{
type = flasher;
size = 12;
color = { hue = 60; };
frequency = 1;
phase = -1;
position = ( 0, -92, 475 );
},
{
type = flasher;
size = 12;
color = { hue = 75; };
frequency = 1;
phase = -1.2;
position = ( 0, -92, 425 );
},
{
type = flasher;
size = 12;
color = { hue = 90; };
frequency = 1;
phase = -1.2;
position = ( 0, -92, 375 );
},
{
type = flasher;
size = 12;
color = { hue = 105; };
frequency = 1;
phase = -1.6;
position = ( 0, -92, 325 );
},
{
type = flasher;
size = 12;
color = { hue = 120; };
frequency = 1;
phase = -1.8;
position = ( 0, -92, 275 );
},
{
type = flasher;
size = 12;
color = "orangeColor";
frequency = 1;
phase = 0.5;
position = ( 0, -16, 252 );
},
{
type = flasher;
size = 12;
color = "orangeColor";
frequency = 1;
phase = 0.5;
position = ( 0, 16, 252 );
},
{
type = flasher;
size = 12;
color = "orangeColor";
frequency = 1;
phase = 0;
position = ( 16, 0, 252 );
},
{
type = flasher;
size = 12;
color = "orangeColor";
frequency = 1;
phase = 0;
position = ( -16, 0, 252 );
}
);
}
E-mail: [email protected]
- Commander McLane
- ---- 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:
Sorry if I'm missing something obvious here. But why a rotated "dock-flat" instead of an unrotated "dock"?Ahruman wrote:Here is the full subentities list for the Coriolis in the new format.Code: Select all
{ subentities = ( { subentity_key = "dock-flat"; orientation = ( 1, 0, 0, 1); // rotated 90 degrees position = ( 0, 0, 500 ); is_dock = true; }, . . . }
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
You expect me to know things like that? That’s what’s there in the old format. :-)Commander McLane wrote:Sorry if I'm missing something obvious here. But why a rotated "dock-flat" instead of an unrotated "dock"? :?:
E-mail: [email protected]
- Commander McLane
- ---- 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:
Don't know what I can expect of you. You tend to surprise me.Ahruman wrote:You expect me to know things like that? That’s what’s there in the old format.Commander McLane wrote:Sorry if I'm missing something obvious here. But why a rotated "dock-flat" instead of an unrotated "dock"?
Anyway, it strikes me as kind of, errm, odd, to have two different dock models, one horizontal and one vertical, and then to use only one of them and rotate it to the other orientation. Seems like a relic to me.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
“Relic” sounds right; I suspect this changed around the time the “redux” ships were made (or when dock models started being used to detect the docking position instead of dock-radius etc), and the old “dock” was kept around for backwards-compatibility with any OXPs that used it.
E-mail: [email protected]
- Commander McLane
- ---- 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:
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
I don’t see any reason to get rid of it. In future released there will be a very slight memory overhead to using two different interchangeable models, but it’s not enough to be concerned about.
E-mail: [email protected]
Before this is done, can I ask if there is a simple trick to make scripts compatible with both versions (after the depreciated one is gone)? I'm thinking like the one for player / player.ship, as orientation and position are a little more complex as they're functions with parameters.Ahruman wrote:Minor JavaScript changes:
- Entity.position and Entity.orientation are now read-write, and Entity.setPosition() and Entity.setOrientation() are therefore deprecated as of 1.73. (Note: deprecations in 1.73 may be removed in 1.74 already, depending on how the Grand Plan advances.) Statements like ship.position.x += 100 still don’t work as expected, but making position read-only didn’t actually affect that, so what’s the point?
If not then it's going to make producing scripts compatible with both very complicated, and we're going to end up with multiple versions of OXPs for pre/post depreciated change compatibility. Which is not a nice thought for me at least.
I can understand the thoughts behind doing this, but in tidying things up it may make OXP scripting with backward/forwards compatibility difficult both ways. I'm not sure this one is quite such a minor change as it sounds.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Don’t. Once 1.73 is released, update to the new syntax and ignore 1.72 compatibility. Backwards compatibility with earlier test versions is not worth investing time in.Thargoid wrote:Before this is done, can I ask if there is a simple trick to make scripts compatible with both versions (after the depreciated one is gone)? I'm thinking like the one for player / player.ship, as orientation and position are a little more complex as they're functions with parameters.
However, given that you’ll probably ignore this advice again, the least painful way to do it would be something like this:
Code: Select all
if (0 < oolite.compareVersion("1.73"))
{
self.setEntityPosition = function (entity, position)
{
entity.setPosition(position);
}
}
else
{
self.setEntityPosition = function (entity, position)
{
entity.position = position;
}
}
E-mail: [email protected]
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
As people may have guessed, I haven’t had much enthusiasm for Oolite recently. Waiting another two years for a release would be silly, so I hereby propose an alternative release schedule:
- Abandon new mesh code. This means no unlimited vertex and face counts (but tangent support, and thus normal mapping, will be in).
- Fix lighting for shaders in old mesh code. No additional lighting features.
- Release 1.73 as essentially feature-complete.
- Fix loads of bugs, hopefully including subentity collision stuff.
- Release MNSR as 1.74 or 1.75.
Last edited by JensAyton on Fri Jul 10, 2009 10:27 am, edited 1 time in total.
E-mail: [email protected]
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
No objections from me - your continued support and long term enthusiasm is as equally important (to me) - so if this is good for you and the rest of the devs then I say go for it!
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
From the original plan here are the features that are not done yet:
Frustum culling (not a mandatory feature anymore – after the release of 1.72)
Camera code (well!!! I can live without it )
One the other hand we have dozens of new features that were not on the original oolite upgrade plan like:
Oolite localization
Docking clearance
Wormhole scanner
Multy nebula skies
and more that I can not remember right now.
So if we can see the big picture the NMSR is going to have far more new features that were not in the original oolite upgrade plan that those that you didn’t manage to implement. Anybody with a common sense should be happy and own a great dept of gratitude to you and the dev team for everything you have done for oolite (so far )
In simpler words no problems Ahruman
Frustum culling (not a mandatory feature anymore – after the release of 1.72)
Camera code (well!!! I can live without it )
One the other hand we have dozens of new features that were not on the original oolite upgrade plan like:
Oolite localization
Docking clearance
Wormhole scanner
Multy nebula skies
and more that I can not remember right now.
So if we can see the big picture the NMSR is going to have far more new features that were not in the original oolite upgrade plan that those that you didn’t manage to implement. Anybody with a common sense should be happy and own a great dept of gratitude to you and the dev team for everything you have done for oolite (so far )
In simpler words no problems Ahruman