Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The vehicel mounted heaters and the cooler use like 20 times more energy than there description says they need! #66237

Closed
Krieger1999 opened this issue Jun 16, 2023 · 2 comments · Fixed by #66504
Labels
(S2 - Confirmed) Bug that's been confirmed to exist

Comments

@Krieger1999
Copy link

Krieger1999 commented Jun 16, 2023

Describe the bug

While testing the vehicel mounted heater and cooler, i noticed that they use up way more energy than the description from them says. Even while seeing that iam producing more energy, than i should consume, i still lost energy and my battery drained.

Attach save file

Test1
Test2
Test3
Test4
Test5

Steps to reproduce

  1. Spawn a solar vehicel with at least 1000 energy production in debug mode
  2. Install a vehicel mounted cooler or heater and turn it on and see if your energy consumption is still higher than your energy lose, and make sure your storage battery is full
  3. Wait like 5 or 30 minutes and look at your storage battery and see that even though you produce more energy than you consume, you still drained your battery

Expected behavior

Your storage battery should remain at 100%, as long as you have an energy surplus.

Screenshots

No response

Versions and configuration

Windows 10
Build: 2023-06-16-0558
Version: d5cc239 (tiles)
Mods: Dark days ahead [dda],
Blaze Industries [blazeindustries],
Magiclysm [magiclysm],
Xedra Evolved [xedra_evolved],

Additional context

No response

@Krieger1999 Krieger1999 added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Jun 16, 2023
@Krieger1999 Krieger1999 changed the title The vehicel mounted heater and cooler use way more energy than they are supposed to The vehicel mounted heaters and the cooler use like 20 times more energy than there description says they need! Jun 18, 2023
@SurFlurer
Copy link
Contributor

Can /confirm . I observed the same phenomenon.

@github-actions github-actions bot added (S2 - Confirmed) Bug that's been confirmed to exist and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Jun 19, 2023
@SurFlurer
Copy link
Contributor

More precisely it's this part:

Cataclysm-DDA/src/vehicle.cpp

Lines 7480 to 7498 in 6d6c3a2

const time_duration interval = pt.info().has_flag( VPFLAG_ENABLED_DRAINS_EPOWER )
? update_to - last_update - 1_seconds
: update_to - last_update;
if( interval < 0_seconds ) {
debugmsg( "emitter simulating negative time interval, something is fishy / buggy" );
break;
}
discharge_battery( power_to_energy_bat( -pt.info().epower, interval ) );
}
if( sm_pos.z < 0 ) {
last_update = update_to;
return;
}
if( update_to >= update_from && update_to - update_from < 1_minutes ) {
// We don't need to check every turn
return;
}

So last_update doesn't get updated every turn, but interval assumes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants