Page 2 of 3
Re: What is your maximum speed
Posted: Wed Apr 06, 2011 5:54 am
by Thargoid
And it's also read-only. The only one writable by scripting is desiredSpeed.
On a similar track, do I remember that there was some thoughts about a desiredThrust as well? I can't see anything about it actually appearing in the wiki though?
Re: What is your maximum speed
Posted: Wed Apr 06, 2011 6:39 am
by Killer Wolf
Thargoid wrote:The speed of Dark.
No matter how fast light is, it always gets there first...
and there was me thinking you were a fellow Flogging Molly fan.
http://itunes.apple.com/us/preorder/spe ... d424424418
Re: What is your maximum speed
Posted: Wed Apr 06, 2011 7:15 am
by Thargoid
It's a Pratchettism...
Re: What is your maximum speed
Posted: Wed Apr 06, 2011 7:30 am
by Eric Walch
Thargoid wrote:And it's also read-only. The only one writable by scripting is desiredSpeed.
On a similar track, do I remember that there was some thoughts about a desiredThrust as well? I can't see anything about it actually appearing in the wiki though?
Speed
can not be set directly, because it would look ridiculous when a ship changed speed drastically in a split second. Therefor we have a
desiredSpeed
. When set, the engine increases/decreases speed according to the thrust value until the desiredSpeed is reached. Thrust in instantaneously, therefor a
desiredThrust
would seem a strange thing.
Thrust
can be set directly by script.
Re: What is your maximum speed
Posted: Wed Apr 06, 2011 7:41 am
by TGHC
Eric Walch wrote:
Speed
can not be set directly, because it would look ridiculous when a ship changed speed drastically in a split second.
but that's what happens when you hit the torus jump drive.
I have to admit though I have wondered about the effect of momentum when coming out of the jump drive.
Re: What is your maximum speed
Posted: Wed Apr 06, 2011 7:48 am
by another_commander
TGHC wrote:Eric Walch wrote:
Speed
can not be set directly, because it would look ridiculous when a ship changed speed drastically in a split second.
but that's what happens when you hit the torus jump drive.
Not exactly. The ship accelerates very quickly to torus speed and deccelerates quickly when torus switches off, but it does not jump instantly between speed values from one frame to the next, which is what would happen if we were able to set actual speed by script.
Re: What is your maximum speed
Posted: Wed Apr 06, 2011 8:02 am
by TGHC
Oops forgot to read memo to self, leave it to those who actually know
slap
Re: What is your maximum speed
Posted: Wed Apr 06, 2011 8:16 am
by Eric Walch
TGHC wrote:but that's what happens when you hit the torus jump drive.
I have to admit though I have wondered about the effect of momentum when coming out of the jump drive.
As Another_Commander writes: Also for the player acceleration goes by thrust. However, Oolite is cheating here because it multiplies the thrust in shipdata with 7 for the player. I assume is was to enhance playing for the player. (try flying an Annaconda and you know what I mean). But it means that a player accelerates always faster than the identical npc variant of the same ship.
Re: What is your maximum speed
Posted: Wed Apr 06, 2011 9:16 am
by Thargoid
Eric Walch wrote:Thrust in instantaneously, therefor a desiredThrust
would seem a strange thing. Thrust
can be set directly by script.
My meaning was to have variable thrust for different scenarios. I hadn't spotted that it's R/W for NPCs though, which as you say covers what I was thinking about for desiredThrust.
That said I'm hitting a problem anyway with a little OXP I'm playing around with in that the script-settable thrust value seems to be clamped by the setting in the shipdata.plist. For example cargo pods have max speed of 50 but thrust of 0, so you can't actually make them move without resorting to an override to up the thrust value in the shipdata. At least so it appears with my playing so far, but I'm still looking at that. If script can override the shipdata setting directly it will be much cleaner.
As for changing speed instantaneously, watch what an NPC ship which is flying along does when it's AI suddenly hits a performTumble. They fairly much instantaneously stop and then start tumbling (my hired guns are prone to that one). I don't disagree it looks wrong though.
Re: What is your maximum speed
Posted: Wed Apr 06, 2011 10:16 am
by Switeck
Thargoid wrote:As for changing speed instantaneously, watch what an NPC ship which is flying along does when it's AI suddenly hits a performTumble. They fairly much instantaneously stop and then start tumbling (my hired guns are prone to that one). I don't disagree it looks wrong though.
I had a problem with an earlier version of my mod doing that for the NPC ships, since I was using performTumble as a "dodge" routine when they were getting hit. In initial tests, it worked great because I also had a set speed in the same line. But when I later pulled the 2 separate, because I didn't always want them to tumble when I wanted them to increase speed (such as attacking instead of fleeing)...things went awry. It was stop-on-a-dime behavior even if the set speed should be called at roughly the same instant as performTumble.
Re: What is your maximum speed
Posted: Wed Apr 06, 2011 10:22 am
by Eric Walch
Thargoid wrote:As for changing speed instantaneously, watch what an NPC ship which is flying along does when it's AI suddenly hits a performTumble. They fairly much instantaneously stop and then start tumbling (my hired guns are prone to that one). I don't disagree it looks wrong though.
Yes, performTumble is the only command that bypasses the thrust and immediately sets speed to zero.
To your other problem. Since 1.75 you can set
velocity
. e.g. if you target a floating cargopod without any speed, you can target it and type 'PS.target.velocity = [0,0,20]" in the console. Than it will start moving immediately in that direction [0,0,1] with a speed of 20. During game it looks stupid when setting an explicit velocty, but it is very useful when spawning stuff with an initial momentum. And this is probably what you want.
Re: What is your maximum speed
Posted: Wed Apr 06, 2011 11:11 am
by Thargoid
Not exactly, but I can modify it to what I want.
Basically I'm working on a quasi tractor-beam, to pull things towards a certain point in space.
Re: What is your maximum speed
Posted: Wed Apr 06, 2011 12:17 pm
by Switeck
A larger effect of that sounds more like ordinary gravity...or worst-case, a black hole.
Re: What is your maximum speed
Posted: Thu Apr 07, 2011 6:17 am
by Thargoid
Tried playing around with velocity last night, and it works a treat for this application. Had great fun throwing cargo pods and asteroids around the place.
One thing I did note though was that velocity has no effect on speed. I chucked several asteroids at the main station (as you do ) and they all still had speed zero, despite moving at around 2500m/s.
I know they are seperate script entities, but given their physical interrelation it just seemed somewhat odd to me to have that disparity and independence between the two? Although I know it will be difficult to fix realistically, especially given the clamping of speed to maxSpeed as set in shipdata.
Oh and speaking of which, I also tested script-changing thrust. It is capped at the shipdata.plist entry for the entity involved (or at least I couldn't change the thrust of a cargo pod from 0, its shipdata setting) so that way is somewhat limited without an override.
Re: What is your maximum speed
Posted: Thu Apr 07, 2011 6:59 am
by Switeck
Shouldn't ramming/nudging asteroids impart a speed on them as well?