Notifications
Clear all

To all SSC Station occupants

Thank you for the donations over the past year (2024), it is much appreciated. I am still trying to figure out how to migrate the forums to another community software (probably phpbb) but in the meantime I have updated the forum software to the latest version. SSC has been around a while so their is some very long time members here still using the site, thanks for making SSC home and sorry I haven't been as vocal as I should be in the forums I will try to improve my posting frequency.

Thank you again to all of the members that do take the time to donate a little, it helps keep this station functioning on the outer reaches of space.

-D1-

How Do I Calculate....

Page 2 / 2
(@fluffyfreak)
Noble Member

I think it's just a meta table with 3 elements. You can get each element by it's index "x", "y", or "z" too.

 

If you just want the velocity without the direction then you could just get it's "length" which will give a single value for "speed" I guess.

ReplyQuote
Posted : June 26, 2016 10:40
(@nozmajner)
Member

Looks very good.

A bit of nitpicking: I think "Main" and "Retro" thrusters might be better terms. At least for me. Forward could imply that the thrusters are looking forward, or that they accelerate you forward.

And a bit more: Maybe you could move them up above the acceleration displays, so the deltaV and Speed displays are right next to each other. Would make it easier to judge, how much juice you have left in your tanks.

 

Anyhow, this feature will sure give the adventurous player an edge over the autopilot regarding transfer times. 🙂

 

 

Also, if you zip it up this way, it can be used as a mod, making it easier to test:

stop.zip

    /lang/ui-core/en.json

    /ui/InfoView.lua

        /InfoView/Shipinfo.lua

ReplyQuote
Posted : June 26, 2016 12:11
(@bugbear)
Trusted Member

Thanks for the help on IRC.  No success yet but I'll keep bashing away...

ReplyQuote
Posted : June 27, 2016 05:37
(@bugbear)
Trusted Member

We now have the distance to stop calculation available on the F3 page, and I've uploaded the latest ShipInfo.lua here: https://app.box.com/s/l04gnf0ltgliz3fxvuvo8klskfbivvai

 

I'll now do some work on figuring out how to display these numbers on the cockpit (aka WorldView screen).

 

There is one minor gotcha with the calculations though - the distance to stop is based on the speed relative to the frame of reference (which admittedly is what I requested in the first place).  Now that I've had a chance to play with this, I'm thinking that speed relative to destination would be more useful.  When travelling from Earth to Mars for example, the point at which deceleration needs to begin occurs while the frame of reference is Sol, which means that the speed will be out by something like 25km/s.

 

I'll see what I can do about this looking at the underlying code...

ReplyQuote
Posted : July 2, 2016 08:48
(@bugbear)
Trusted Member

Another update.  After another couple of months of sporadically trawling through the Pioneer C++ source, I've been able to create a function in WorldView.cpp that calculates the distance to stop, and displays this on screen just below the current nav target relative speed indicator - screenshot here: https://app.box.com/s/2jt86yrl0s3eq3svkxymkzttvsro1f78 (The F means distance to stop using the 'forward' or main thrusters, the R means distance to stop using the 'rear' or retro thrusters.  The rear thrusters are less powerful than the front, therefore they will take more distance to accelerate / decelerate from a given speed).

 

(After using this a few times, I'll probably also add the current available delta-v - that's a very important number when travelling between planets...)

 

This is still a work in progress - my intent is to make this calculation available only to commanders that purchase the Nav Computer Upgrade in-game so as a result I would need to work out how to declare a new piece of purchasable equipment (knowing my luck and my schedule that will take me another couple of months...).

 

I know that some other devs (in particular ecraven) have been doing some excellent work in not only calculating this information, but also presenting it on screen in a much more attractive manner (I've always said that I don't do "pretty" very well), so it may be that my efforts so far will come to naught.

 

What I'd like to to, though, is make available the code I've created so far, and have some of the devs look it over and tell me whether I'm on the right track (I really should work out git works... )

 

WorldView.cpp - https://app.box.com/s/e7zo8hxyk8kj8uvs0isyjrhnpq203tz8

WorldView.h - https://app.box.com/s/m5ynr4w3aw83u5n1hdijyoeotfm4bqa6

 

 

ReplyQuote
Posted : September 23, 2016 19:52
impaktor
(@impaktor)
Pioneer Moderator

I applaud your efforts, but I think we're on a good path to already include all this in master branch. ecraven's pull request went up last night (#3819). With this, pioneer will no longer draw to the worldview from C++, but from Lua.

It will be significantly easier for modders to add and change the "F1" view.

None of your links above work for me, I just get a blank screen. (Possibly my adblocker acting up?) You can upload your screenshot directly to the forum. That way we can all see it (if logged in), without relying on any third party.

But despair not, your work is not in vain. Without having looked at any code, it might be that you have a more accurate approximation for full stop distance than ecraven, if so, you can collaborate on using your code in his UI.

 

ReplyQuote
Posted : September 23, 2016 22:12
(@bugbear)
Trusted Member

OK, screenshot and code files attached...

 

The code includes a probably inacurrate attempt at retrieving the current available deltaV...

ReplyQuote
Posted : September 24, 2016 00:05
Gernot66
(@gernot66)
Honorable Member

na also da bleibt mir doch die spucke weg
i rather will do it with my guts

ReplyQuote
Posted : April 11, 2017 21:38
Page 2 / 2