s-victor / TinyPedal

Free and Open Source telemetry overlay application for racing simulation
GNU General Public License v3.0
75 stars 8 forks source link

[Feature Request] Fuel widget reserve laps #56

Closed thoraxe closed 1 week ago

thoraxe commented 3 weeks ago

During a timed race, for very long tracks (ex: Mount Panorama), it's possible that you can cross the finish line after the timer hits 0:00 and need to do two full laps.

TinyPedal's fuel widget will currently only report the fuel required to reach the end of the race time or the end of the race laps. This is not a fuel saver situation, but rather a refuel buffer situation.

This happened to me last night. When I did my last refuel stop, I took 27 gallons, which was a little more than TinyPedal suggested I needed to finish the event. I crossed the finish line just after the timer hit 0:00 with enough fuel for one lap, but, because of the other car positions in the race, I had to do two laps, and ran out of fuel.

If the fuel widget had a "fuel reserve laps" option, that would be great. Right now, I think I would have to mentally calculate:

fuel per lap * # desired reserve laps + fuel to the end amount

Possible implementation:

I don't think the Fuel Energy Saver widget would help me here, but I have not used it yet.

s-victor commented 3 weeks ago

Duplicate of #55

Already asked and discussed here https://github.com/s-victor/TinyPedal/issues/55 and here.

It's already implemented in v2.16.0 update as the new widget that is called Relative finish order Widget, see forum post (or User Guide): https://forum.studio-397.com/index.php?threads/tinypedal-open-source-overlay-app-for-rf2-radar-pedal-ffb-deltabest-relative-fuel-calculator.71557/page-36#post-1145191

Combining it with Fuel energy saver Widget, they have everything that you asked for.

thoraxe commented 3 weeks ago

I will try it. I don't understand how it will work on a very long race where different cars have different pit strategies and where the class leader position relative to me will change during the race and where both car's lap time will change with tire wear.

This seems very complex compared to a simple "fuel reserve" option for the main fuel widget.

s-victor commented 3 weeks ago

The fuel widget will always show "Raw" refuel based on local player's input, it is designed this way and it will not change. Everything else were already discussed and explained in those links above. The new "Fuel energy saver" widget already has an option called "minimum_reserve" which exclude a user defined amount fuel from calculation.

The new widget "Relative finish order" shows you exactly why there will an extra lap or not based on leader and your final relative position when the moment timer ends, it also gives you options to predict and take pit-stop time into consideration (hence all those complex looking data).

They definitely look lengthy and complex, because refueling is a complex topic, even in real life with a whole racing team of analyzers and experts, those things can go wrong. That's why a full guide with thousands of words and examples (and large amount tests behind scene were done) are provided with the new "Relative finish order" widget to help those who wish to squeeze the last extra bit of advantage.

If you don't wish to use those complex stuff (they are really not complex if you take time to read guide and try yourself), then TinyPedal also already gave you the advance "Fuel calculator" tool, which you can simulate fuel usage before race to check whether there will be extra laps, as also explained in links above.

In any case, currently TinyPedal has already provided all kinds standard and advanced tools and overlays that you can use to handle those refueling situations, which those tools are not normally found even in other commercial APPs. It's up to you whether to use (trust) or not.

That's all I can help with this topic, everything else is explained in very detailed guide above which took a lot time to write and explain, there is not reason to repeat further.

If you think there is any calculation issue, feel free to open a new issue.

Wish you good luck, and happy driving.

thoraxe commented 3 weeks ago

I have spent about an hour writing this response, looking at the guide, looking at the example, and trying to understand the widget. It's still unclear to me.

Scenario for reference: Current consumption is 2/lap. Based on time remaining in event, and lap time, it will take 40 more fuel (20 laps). I want a buffer of 2 laps (4 fuel).

The new "Fuel energy saver" widget already has an option called "minimum_reserve" which exclude a user defined amount fuel from calculation.

It is not clear how this option or this widget works. The saver widget only talks about consumption and not total fuel. From the wiki:

Show current stint estimated total completable laps and completed laps based on current consumption. Show estimated target lap consumption to save (extend) one or more total stint laps.

But I'm not talking about saving fuel. I'm talking about taking extra fuel at the pit stop. Can you help me understand how "Fuel energy saver" minimum_reserve will show me the exact quantity of fuel to take at the pit stop? If I set the minimum_reserve to 2 laps in the above scenario, where will I see the value 44 which is the amount of fuel I need to take?

I am still struggling to understand how the "Relative finish order" widget works, but I think the example proves it does not do what I am requesting:

To sum up, if comparison shows no extra final lap, then just refill according to local player's refilling (fifth row) value from the same column of local player's final lap progress (third row). If comparison shows an extra final lap, then just add an extra lap of fuel on top of local player's refilling value.

This sounds like I need to do math in my head. That is exactly what I don't want to do. I want TinyPedal to do the math for me. It also sounds like I need to read a chart during driving and make comparisons while driving. That sounds very difficult, especially on busy tracks with many turns and no long straight.

widget

I really don't understand this example. You are explaining comparisons between different columns. Also, every single column shows +7.4 fuel to add, so that doesn't make sense, either.

If leader's final lap progress value is greater than local player, such as leader's 0.91 (50s column) vs player's 0.47 (30s column), it indicates that leader will be ahead of local player when timer ended, and there will be no extra final lap. So local player's refilling value from corresponding 30s column can be used, in this case, it's +7.4 fuel to add. However, if leader is closer to finish line (as show in orange color indicator), there is a chance that leader may be fast enough to cross finish line before the end of timer, which would result an extra final lap for local player, and requires adding an extra lap of fuel on top of +7.4 fuel in this case.

Here are things I don't understand:

s-victor commented 2 weeks ago

For "Fuel energy saver" widget, I would suggest you leave it now, until you actually have time to test and see how it working in game. This widget will help you if you actually added less fuel than required and want to save fuel in order to finish race.

Yes, currently you need to do the math if there will be an extra lap, hence this sentence "and requires adding an extra lap of fuel on top of +7.4 fuel in this case." simply means: refuel = "1 extra lap of fuel" + 7.4L

In all example and situation, which you want to just add extra lap of fuel no matter what to compensate potential risk of extra lap, you can always just carry an extra full lap of fuel on your last pit stop, or at the start of race (assume your laptime pace doesn't go faster).

To your first post about When I did my last refuel stop, I took 27 gallons, which was a little more than TinyPedal suggested I needed to finish the event. What could really help here is to add a full lap of fuel, instead of a little more. TinyPedal always calculates refuel towards full lap completion, if you want to be on safe side, it's either an extra full lap of fuel, or nothing.

The reason when timer ended and you had to do an extra (not planned) lap, was because the moment timer ended, the leader's on-track position is behind you, this means not only you have to finish your current lap, but also next lap (which leader is currently on), because race only ends when leader crossed finish line, which did not yet happen when timer ended.

"Relative finish order" widget shows you this on-track position information as whether leader will be (relatively) ahead or behind you when timer ends, so you can predict whether there will be an extra lap. As also fully explained in this post.

This is the reason "Relative finish order" widget was made, it doesn't simply tell user to carry more fuel, but one step further to tell user why there will be an extra lap (or not) by calculating and analyze the fundamental cause and relation between leader and player's on-track position. Of course as prediction, there are many variables can affect outcome, that's why it is always up to user to determine how to use those data.

This can also be considered a critical issue if you race on a length track, such as Nordscheleife where a single lap may takes 20 liter fuel, and in such case, you would not really want to add that much of "safety" fuel, and a better approach is to use "Relative finish order" widget to determine whether an extra lap will happen.

Pit time

As explained in guide, this value (those 30s, 50s values you asked) shows estimated "total time" you or leader might spent in pit in the next pit-stop. 30s means you or leader would spent 30 seconds in pit for their next pit stop, simple as that. And 0s means you or leader will not do more pit stop (no pit stop = no time spent in pit = 0s). Last column 0s will only update if you or leader makes at least one pit stop (which required to record pit time).

This is the reason why you would compare different columns, as it solve the question you asked in your 2nd post: where different cars have different pit strategies If leader's next pit stop time(duration) would take 50 seconds, you select that 50s column. And If your next pit stop time take 30 seconds, you select that 30s column. Thus, you comparing 50s with 30s column due to different pit strategies you or leader uses.

And "customizable pit time" allows you change this estimated pit stop time(duration) value which is used for all the underlying calculation. For example, leader is hypercar and may be have a common pit time of 47s or 51s, and you are GTE and may be 37s or 41s, so you would want to customize pit time for those columns before race to prepare for best matches. If you don't want to customize, the built-in columns and the "last pit time" column also should provide enough data for you.


Lap time variance

To your question about where both car's lap time will change with tire wear:

This is where the new laptime pace calculation comes in play, as it was added in v2.16.0 update to help minimize the impact of laptime variance on fuel calculation. All real time fuel calculation is now based on the new laptime pace calculation which uses exponential moving average and additional limiting factor. It's explained in v2.16.0 update changelog and user guide. This new method has already tested extensively and shown quite a big improvement to refuel calculation accuracy, and is also used in "Relative finish order" widget for predicting leader's pace.


If you have further question regarding usage and purpose of those widgets, please refer to the forum discuss posts and guide, as all explanations are already fully provided there, it just takes time to read and practice.

Last, I fully understand that you would just like a simple display that have this "extra lap of refuel" already added to "Refuel" value. However there is a few issues:

  1. Refuel value is used for "number of pit stops" prediction, change this "raw" value means change of "number of pit stops" prediction.
  2. Local player (user) may forget whether they have enabled this "extra lap refuel", so there needs to be some way to let user know the option status, otherwise this will causing confusion, and user may add an extra more of fuel on top of this already enabled "extra lap refuel" option if exists.
  3. This setting cannot change on fly, so if user determined that he no longer wants this option but rather seeing "Raw" refuel value, then he cannot do that while driving, or the opposite around. A solution may be to add a hotkey system, but it will make whole thing more complicated than before, and difficult to implement due to large amount options.

The only viable way to your request as I can see, is to create another separated widget, that lists all possible refuel value with +1 +2 +3 laps columns. It will look like following:

Here assume Raw refuel reading is 56.4L, and fuel usage per lap is 4.5L, so the widget(table) would be: Extra Laps: Raw/None +1 +2 +3 +4
Refuel: 56.4 60.9 65.4 69.9 74.4

This is probably the closest thing to your suggestion. If you think this is a good idea, I can make it happen.

thoraxe commented 2 weeks ago

Thanks for spending so much time to help me understand this.

I don't think a completely extra widget is needed. But it depends on the answer to the next few questions:

  1. For the "Relative finish order" widget, instead of showing +X.Y for the fuel, could you show raw refuel plus? Or have that be an option ("do math" checkbox).

This would at least prevent from having to do math while driving 😀

  1. You said:

    For example, leader is hypercar and may be have a common pit time of 47s or 51s, and you are GTE and may be 37s or 41s, so you would want to customize pit time for those columns before race to prepare for best matches.

I guess this means the relative finish order widget always looks at the race leader? I hadn't thought about that.

I have a race tonight. I'll be looking at these widgets more carefully.

s-victor commented 2 weeks ago

For first question: It is already showing raw refuel value. Each refuel reading from each column is corresponding to your own "pit time". (note: if you refer to LMU's absolute refueling as opposite to RF2's relative refuel, then currently it's not possible, because LMU's absolute refueling depends on remaining fuel in tank and when you make pit, which constantly change as you drive.)

For example, if you don't plan to pit, that will be column 0s you are looking at, which will give you exact same refuel reading as found in Fuel widget, because both are calculated without taking "pit time" into formula. For reference, assume this refuel reading of 0s column here is +9.5L, which you will see same +9.5L reading from Fuel widget.

On the other hand, if you plan to do a 2 minutes pit stop (exaggerated example) on a 1:30.XX lap time track, that means you will do one less total lap due to extra time spent in pit that exceeded single lap lap time. So in this case, when you look at column 120s, your refuel value in this column will be lower than 0s column. In this case, if fuel consumption is 1.5L per lap, it will show 8.0L on 120s column, because the widget has already taken the pit time into calculation internally. This the main purpose of providing those refuel data in each correspond column.

Now, after you compared with leader's column (any columns), if you see leader's relative lap progress is behind you, say leader 0.25 verses your 0.55, then you will need to manually add an extra lap of fuel on top of 8.0L (assume you are going to do a 120s pit stop), the result of refuel value will now be back to 9.5L again (8.0L + 1.5L).

As you can see now, whether to add this 1.5L fuel is all depends on whether leader will be ahead of behind you on final lap, so I can't simply provide pre-calculated refuel readings directly on top of raw reading.

However, there is one thing I can do, which is to add an extra table row below refuel row, which shows refuel value of each column that incremented by 1 lap, which effectively achieved pre-calculation so you can just select one of the refuel values from the "raw" refuel row or the "+1 lap" refuel row, depends on leader's final position.

For example, it will look like following (assume 1.5L per lap): TIME 0s 30s 40s 50s 60s 54s
LDR 0.49 0.20 0.11 0.02 0.92 0.98
0.04 0.91 0.64 0.55 0.46 0.77 0.51
DIFF 0s 30s 40s 50s 120s 43s
NRG +18.1 +18.1 +18.1 +18.1 +16.6 +18.1
+1 Lap +19.6 +19.6 +19.6 +19.6 +18.1 +19.6

Notice column 120s from your side compares to leader's, and corresponding refuel changes in +1 Lap row of same column. For example, if we compare leader's 30s column with your 120s column, the raw refuel is +16.6, but because leader's relative lap progress value is behind you (0.20 vs 0.77 here), you should use refuel value from +1 lap row of same column, which is +18.1.

If you think this approach is good, I can make it work.

As you can see, the widget and logic behind it is not complex, however due to large amount values displayed in table, it does require some good practice to get used to it and find the correct value from table, especially in busy race condition as you mentioned. The good thing is that, this table size can be changed in option, so you can reduce amount prediction columns from showing if necessary. For example, if you know leader will do average 52s pit stop, and yours is 36s, then you just need to config setting to keep one prediction column with 52s and 36s respectively, such as following:

TIME 0s 52s 0s
LDR 0.49 0.20 0.11
0.04 0.91 0.64 0.55
DIFF 0s 36s 0s
NRG +18.1 +18.1 +18.1
+1 Lap +19.6 +19.6 +19.6

For second question: Yes, it always looks at overall race leader (1st position overall), as checked flag is determined by overall leader.

s-victor commented 2 weeks ago

I just added "extra refilling row" display for Relative finish order Widget as mentioned in last post. You can also customize how many extra laps to add to the extra refilling value. Default is 1 extra lap.

Here is the released version (includes the gallon error fix you have reported in the other issue): https://github.com/s-victor/TinyPedal/releases/tag/v2.17.4

See changelog and user guide for more info. Let me know how it works, good luck.

extra_refill