Released Average Fuel Consumption 1.0.0.7

Calculates the fuel consumption to the traveled distance

  1. Fendar

    Fendar
    Expand Collapse

    Joined:
    Mar 26, 2019
    Messages:
    32
    I created a new app for calculating the average fuel consumption.

    I wanted to do this, to see how to make an app like this since I'm a programmer.
    Also I wanted to try an app that calculates this with a different approach.
    I started of taking the "Simple Trip" app as a starting point.
    I also transferred the UI programming to the app.html file, which made it easier to handle.

    At a reset this app will set the traveled distance to zero and store the current fuel level.
    Then it will simply calculate the fuel consumption by dividing the used fuel by the traveled distance.
    This makes the calculation stable and should be realistic to the point of taking all used fuel into account.

    There's a manual and automatic reset.
    Manually it can be reset by the symbol in the top left corner.
    Automatically it resets when the current fuel level is magically higher than the stored level (e.g. the car was reset).

    Pros:
    • Takes all used fuel into account.
    • Stays stable even when you stop.
    • Get's more average the longer you drive.
    Cons:
    • Math's go beautifully hilarious at the beginning when you haven't moved yet.
    • It can't detect the event of a car swap were the calculation goes wrong, when the new car has a smaller fuel capacity as the one before. (Simply do a manual reset!)
    Now I'll try to upload it to the repository.
    Also I haven't found out how to setup the Info page just yet.
     
    • Like Like x 1
  2. ARES IV

    ARES IV
    Expand Collapse

    Joined:
    May 6, 2019
    Messages:
    605
  3. Fendar

    Fendar
    Expand Collapse

    Joined:
    Mar 26, 2019
    Messages:
    32
    Mainly this was a programming test and because it works well I thought I'd make it public so you guys can use it too.
    At the moment it's in the approval for the repository.

    I will have to test that "EV bug" later.
    I'm hoping it works with my method, because I don't use the consumption itself - I take the fuel level difference.
    Let's see about that.
    But I'll report on that later.

    Below is a screenshot as an example!

    --- Post updated ---
    Yes I also see that the battery capacity is doubled and the drain is much higher.
    But this comes from how the car of beamng is simulated, it doesn't look like a bug as such.

    Why the capacity is doubled, only because there are two motors is something to ask the devs of the game not the modders.

    If more is drained out of the battery (regardless of the capacity) the power consumption is automatically higher!
    But it should be clear that the battery drain is doubled, due to the fact that there are two motors draining the capacity!
    So this doesn't look like a bug at all to me! - Don't know what/if the devs have commented on this so far.
     

    Attached Files:

    • app.png
    • Informative Informative x 1
  4. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    This is actually real life behavior of averages being gauged :)
     
    • Agree Agree x 1
  5. Fendar

    Fendar
    Expand Collapse

    Joined:
    Mar 26, 2019
    Messages:
    32
    The Version 1.0.0.2 is available now on the Repository!
     
  6. Fendar

    Fendar
    Expand Collapse

    Joined:
    Mar 26, 2019
    Messages:
    32
    Known Issue:
    When you don't have other apps on your screen, then this app won't properly get updated!
    I'm looking into it.
    Don't exactly know which app brings this one to life, since I originally tested it with a lot of apps.
     
  7. Fendar

    Fendar
    Expand Collapse

    Joined:
    Mar 26, 2019
    Messages:
    32
    Yesterday evening I found out, that the screen update of the app didn't work.
    It only worked when something else updated the ui, then my app also was updated.
    I had then reprogrammed the app according to the example in the wiki - to no avail - it still did the same.

    So I had to peek into to some of the inbuilt ui apps, those that definitively perform an update.
    So I took the engine debug app (which shows torque and power and gears...) as a new starting point to rewrite the app... again!

    Then it worked! Now it updates smoothly and continuously even if it is the only app on screen (apart from messages and buttons).
    This weekend I'll make it ready for upload on the repository. You should have it at the beginning of the week I think.
    In the meantime I'll further test it!
     
  8. default0.0player

    default0.0player
    Expand Collapse

    Joined:
    Nov 30, 2018
    Messages:
    1,925
    No, the OP's mod does show the correct average fuel consumption. The mod link AVG is actually instantaneous fuel consumption.
    BeamNGdrive-019109968-RELEASE-x642020_4_2518_44_54.png BeamNGdrive-019109968-RELEASE-x642020_4_2518_46_19.png

    Also the EV's regen calculation is a bit low, the engine regen power(negative) is more then 2X higher than the battery charging power
    BeamNGdrive-019109968-RELEASE-x642020_4_2518_54_28.png BeamNGdrive-019109968-RELEASE-x642020_4_2518_54_41.png
     
  9. Fendar

    Fendar
    Expand Collapse

    Joined:
    Mar 26, 2019
    Messages:
    32
    Ok, so I uploaded Version 1.0.0.3 which solved the screen update.
    This runs much smoother now!

    If you guys find other flaws/problems, I will try to follow them in my spare time.

    It's not ready to download yet - in approval now!
     
  10. Fendar

    Fendar
    Expand Collapse

    Joined:
    Mar 26, 2019
    Messages:
    32
    Version 1.0.0.3 is now ready to download/update.
     
    • Like Like x 1
  11. Covalence

    Covalence
    Expand Collapse

    Joined:
    Jul 3, 2021
    Messages:
    172
    Doesn't work in the 0.23 update :( When you add it to the UI it doesn't show anything and I get this error in the console on startup:
    Code:
    MainGEUI | Error: [$injector:unpr] Unknown provider: UiUnitsProvider <- UiUnits <- avgFuelConsumptionDirective
     
    #11 Covalence, Jul 4, 2021
    Last edited: Jul 4, 2021
    • Agree Agree x 1
  12. default0.0player

    default0.0player
    Expand Collapse

    Joined:
    Nov 30, 2018
    Messages:
    1,925
    All UI mods, not just this one.
     
  13. Fendar

    Fendar
    Expand Collapse

    Joined:
    Mar 26, 2019
    Messages:
    32
    Hi Covalence!

    Thanks for the info.

    After coming home last weekend my SSD in my pc crashed totally with the OS on it.
    So I had to buy a new one , recover a (much too old) image and do updated.
    That took me the whole weekend!!!

    So I could do any tests my self yet.
    But I did get BeamNG working again - only completely without any mods at all.

    I'll look into it and report back.
     
  14. Fendar

    Fendar
    Expand Collapse

    Joined:
    Mar 26, 2019
    Messages:
    32
    Hello Everyone!

    I just uploaded a new version to go to the repository.

    I found out that I had to many things initialized, some of which I didn't need and some didn't need that kind of initialization.
    Probably it was incorrect before, but the game was too tolerant.

    Well Version 1.0.0.4 should work now!
    Have fun!
    (...well, after the approval then...)
     
    • Like Like x 2
  15. Fendar

    Fendar
    Expand Collapse

    Joined:
    Mar 26, 2019
    Messages:
    32
    • Like Like x 2
  16. Fendar

    Fendar
    Expand Collapse

    Joined:
    Mar 26, 2019
    Messages:
    32
    • Like Like x 3
  17. Fendar

    Fendar
    Expand Collapse

    Joined:
    Mar 26, 2019
    Messages:
    32
    Now the new version 1.0.0.5 is available via the repository!
    I would love to get some feedback from you guys, if it works on your side, too.
     
  18. Fendar

    Fendar
    Expand Collapse

    Joined:
    Mar 26, 2019
    Messages:
    32
    I have juste tested my mod, via downloading it from the repository.
    It works as expected.

    So, it should work on your side, too.

    BTW:
    Because of my system crash, I had to completely reconfigure BeamNG. Because I had messed up the BeamNG-User-Folder in the progress.
    Therefore it's totally clean with the new version 0.23.

    If you have problems with mods... maybe not reinstall the game... instead try a clean setup of the BeamNG-User-Folder.
    Of course, after you tried switching off all other mods and tried doing a Clear Cache.
     
  19. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    I did download this mod and am looking forward to test, but it is kinda hot to play this game right now, I mean body does not know which is inside and which is outside, need to get cold air in first :p
     
  20. Fendar

    Fendar
    Expand Collapse

    Joined:
    Mar 26, 2019
    Messages:
    32
    No nead to rush it.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice