pioneerspacesim / pioneer

A game of lonely space adventure
https://pioneerspacesim.net
1.62k stars 376 forks source link

Fuel gauge - show delta-V remaining #2211

Closed CmdrBugbear closed 10 years ago

CmdrBugbear commented 11 years ago

I've started playing alpha 33 and am finding myself running out of fuel while crossing a system. I guess I've been spoilt by previous alphas where reaction mass consumption was not so significant.

Knowing the total delta-V that is available based on the fuel in the tank remaining would be a valuable piece of information for those masochist pilots like myself that fly without an autopilot.

This could be displayed as a numerical overlay on the existing fuel gauge.

Would this idea be fesable?

Brianetta commented 11 years ago

It wouldn't be accurate without some careful maths, since the remaining delta-V doesn't have a linear relationship with the remaining reaction mass. In a nutshell, your last few tonnes of propellant give much more delta-V than the first few.

It's a given that player actions, such as jettisoning or scooping cargo, would also change the readout, and of course it would be the player's responsibility to factor in any changes in frame. There's 30km/s difference between Earth's frame and the Sol system frame, for example.

I like it, though.

bszlrd commented 11 years ago

I had to try my hand on this, by fooling around in the console, then in the infoview script. It displays the remaining delta-v in the Info View, right after the Fuel percetangle row, in km/s. (in alpha33)

deltav

I used the deltavee equation form wikipedia http://en.wikipedia.org/wiki/Tsiolkovsky_rocket_equation

It gave me consistent readings, even when i kept jettisoning cargo. I tested it with jumping in a system, slowing to 0 relative to the system, checked the value it gave, and then just started to accelerate forward. It gave almost perfect results, only with some 12 km/s or so difference(due to gravity I think).

It only works for the Wave, since I was unable to find a way to get a ship's Exhaust Velocity, or bend my mind around the fuelUse stat.

Here's the modified InfovVew script:

https://dl.dropboxusercontent.com/u/456051/InfoView.lua

fluffyfreak commented 11 years ago

@nozmajner That's pretty cool :) nice job!

jmf commented 11 years ago

Yeah. Good job. This should be upstream. +1

bszlrd commented 11 years ago

Thanks! I'd like to update it, so it can read the ships Exhaust velocity, when it's exposed to lua, so it's useful to the other ships as well.

bszlrd commented 11 years ago

I've updatet the file above, using a more recent version's InfoView script.

johnbartholomew commented 10 years ago

Closing as fixed. Not actually a gauge, but (current) delta-V is now displayed on the ship info screen. It updates whenever you switch to that screen, and in the future we'll hook it up to the property binding system so that it will update itself continuously.