Cataclysm-dda: The metabolic interchange CBM power production is seemingly random

Created on 4 Aug 2019  路  4Comments  路  Source: CleverRaven/Cataclysm-DDA

The metabolic interchange CBM suddenly stopped producing constant power. I'm not hungry and eating to full do not restore old production, constant, production. Short bursts of production do occur with long gaps between each.

Steps To Reproduce

Alternative 1:

  1. Load player "Hacker"
  2. Verify that metabolic interchange is ON, not hungry, normal weight, and no large UPS/CBM drain is active.
  3. Wait for 2 hours, power goes up to 46/410, still not hungry.
  4. Wait for 1 hour, power goes up to 38/410 and you are now very hungry.

Alternative 2:

  1. Load player "Hacker"
  2. Verify that metabolic interchange is ON, not hungry, normal weight, and no large UPS/CBM drain is active.
  3. Eat 4 smoked meat
  4. Wait 30 min
  5. Eat 2 smoked meat
  6. Wait 30 min
  7. Eat 2 smoked meat
  8. Wait 30 min
  9. Eat 1 smoked meat
  10. Wait 30 min
  11. Eat 2 smoked meat
  12. Wait 30 min
  13. Eat 2 smoked meat
  14. Wait 30 min
  15. Full power gain after 3 hours (410/410). But production rate was still very on/off for the 3 hours.

Eating almost 8000 calories in 3 hours did help, but production rate is hard to understand. It also seems power generation restarts when you go from sated to full and from full to normal. Then it stoppes after a while again.

Expected behavior

Power generation from metabolic interchange is stable, and/or:

  1. Metabolic interchange gives warning "Metabolic interchange: Protection protocol activated, blood sugar level too low".
  2. A status effect is shown "You feel you are loosing weight" / "Metabolic interchange inactive".
  3. While not hungry / very hungry production shuld run.

Versions and configuration

  • OS: Windows 7

    • OS Version: MINGW/CYGWIN/MSYS2 on unknown Windows version

  • Game Version: 0.D-6126-g27d66a7 [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Makeshift Items Mod [makeshift],
    More Survival Tools [More_Survival_Tools],
    Modular Turrets [modular_turrets],
    Salvaged Robots [Salvaged_Robots],
    Alternative Map Key [alt_map_key],
    Mining Mod [Mining_Mod],
    More Locations [more_locations],
    Fuji's More Buildings [FujiStruct],
    More City Locations [cityside],
    Folding Parts pack [deoxymod],
    Vehicle Additions Pack [blazemod],
    Tanks and Other Vehicles [Tanks],
    Safe Autodoc [safeautodoc],
    SpeedyDex [speedydex],
    Stats Through Kills [stats_through_kills],
    StatsThroughSkills [StatsThroughSkills]
    ]

Additional context

bug2.zip

(S1 - Need confirmation) <Bug> Bionics

Most helpful comment

Can I suggest adding something like this:

const efftype_id effect_metabolic_interchange_protection( "metabolic_interchange_protection" );

And:

if( has_active_bionic( bio_metabolics ) && power_level < max_power_level && calendar::once_every( 3_turns ))
if( 0.8f < get_kcal_percent() {
// Efficiency is approximately 25%, power output is ~60W
mod_stored_kcal( -1 );
charge_power( 1 );
} else {
source->add_effect( effect_metabolic_interchange_protection, 3_turns );
}
}

And a status effect shown something like this:
"Metabolic interchange inactive"

The effect only need to show up in the effects list, and not do anything more than be informative with some descriptive text like:
"Metabolic interchange: Protection protocol activated, blood sugar level too low".

Its also possible to create several fault mode as well. An interesting is one is with the sensor installed the wrong way (for real), so that it only runs when you are low on energy or hungry.

All 4 comments

I'm not certain this is a bug.

I think the Metabolic Interchange CBM scales off remaining calories.

There was a guy who had a calorie deficit (38,000ish calories) and was not gaining any power from the CBM at all.

However, I have not verified this in the game files, so if someone has better info please correct me.

(Could test this pretty easily with the debug menu to show your calories, eating food and waiting for it to digest, then testing again.)

(Could test this pretty easily with the debug menu to show your calories, eating food and waiting for it to digest, then testing again.)

This will confirm or deny that it is a bug. The Metabolic Interchange CBM is disabled when under a certain threshold of stored kcal., which is less than 80% of your healthy kcal number. See https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/player.cpp#L577 for specific line

It is possible we want to adjust this so that it turns off when "underweight" rather than its current logic.

Can I suggest adding something like this:

const efftype_id effect_metabolic_interchange_protection( "metabolic_interchange_protection" );

And:

if( has_active_bionic( bio_metabolics ) && power_level < max_power_level && calendar::once_every( 3_turns ))
if( 0.8f < get_kcal_percent() {
// Efficiency is approximately 25%, power output is ~60W
mod_stored_kcal( -1 );
charge_power( 1 );
} else {
source->add_effect( effect_metabolic_interchange_protection, 3_turns );
}
}

And a status effect shown something like this:
"Metabolic interchange inactive"

The effect only need to show up in the effects list, and not do anything more than be informative with some descriptive text like:
"Metabolic interchange: Protection protocol activated, blood sugar level too low".

Its also possible to create several fault mode as well. An interesting is one is with the sensor installed the wrong way (for real), so that it only runs when you are low on energy or hungry.

I've had this happen a few times while using the CBM in the most recent builds.

After the CBM drains your calories too low it stops providing power and keeps pinging you with warnings that your stomach is empty. That's all good. What breaks is that the player's calorie counter seems to get stuck at 43127 calories and no amount of binge-eating will bring it back up. I've reproduced this multiple times by letting the CBM drain me to the point of starving, and then binge-eating my entire inventory of foodstuffs. Your hunger will stay at peckish and using the debug menu to check your needs will reveal that your calorie counter is fixed at 43127.

Was this page helpful?
0 / 5 - 0 ratings