Cataclysm-dda: Save breaking on load in 9702+, too high bionic power probably

Created on 3 Oct 2019  路  10Comments  路  Source: CleverRaven/Cataclysm-DDA

Describe the bug

Character is loaded with 0 bionic power and in slightly different place than on save. Haven't played to check if anything else is wrong.

DEBUG : Bad save json
line 23:17571: value outside supported range

3 }, "traps": { "level": 6, "exercise": 2234, "istraining": true, "lastpracticed": 12968300, "highestlevel": 6 }, "unarmed": { "level": 3, "exercise": 588, "istraining": true, "lastpracticed": 12070893, "highestlevel": 3 } }, "power_level":
^
15820, "max_power_level": 15820, "posx": 65, "posy": 63, "posz": 0, "stim": 0, "last_sleep_check": 12969156, "pkill": 0, "tank_plut": 0, "reactor_plut": 0, "slow_rad": 0, "scent": 500, "body_wetness": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],

FUNCTION : void game::unserialize(std::istream&)
FILE : src/savegame.cpp
LINE : 245

Steps To Reproduce

Steps to reproduce the behavior:

  1. Load my save. Or try a save with 15820+ bionic power?

Expected behavior

No bugs.

Versions and configuration

  • OS: Windows

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

  • Game Version: 0.D-8159-g6363709 [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    Dark Days Ahead [dda],
    Classes and Scenarios Mod [more_classes_scenarios],
    Stats Through Skills [StatsThroughSkills],
    Stats Through Kills [stats_through_kills],
    No Fungal Monsters [No_Fungi],
    Makeshift Items Mod [makeshift],
    Medieval and Historic Classes and Shields [Medieval_Stuff],
    More Survival Tools [More_Survival_Tools],
    Modular Turrets [modular_turrets],
    Alternative Map Key [alt_map_key],
    Vehicle Additions Pack [blazemod]
    ]

Additional context

Works on 9701.

crash.log
debug.log

save

(S1 - Need confirmation) Bionics

Most helpful comment

Bionic power usage is another issue.
Feel free to start adjusting power draws to real life values if you have the time and will to contribute.

All 10 comments

Could be related to #34288, 15820 power is 15802 kJ which is stored as 15聽820聽000 000 mJ that might be out of bound

Isnt't power_level an int?
Then it would have max value of 2 147 483 647 right?
Shouldn't there be some conversion going on on loading saves from before #34288?

Form what I understand we can either add a thingy to clamp power_level, so on loading an old save your power and power_max would be clamped at 2 147 or we can do what we did for mass and use int_64.

I say don't limit bionic power. We have bionic slots for that right? (for those that want to use it)
Let us be cyborgs! :D
Overall we should balance bionic power use so simple led won't use 1kW per 5 minute. After that bionic power could be converted to realistic values.

15,000 kJ is a significantly greater amount of energy than what a pile of cutting edge batteries* the weight of a person can store. Clamping the value is a perfectly reasonable solution.

"One kilowatt hour is 3.6 megajoules," This is from wiki: https://en.wikipedia.org/wiki/Kilowatt_hour
You linked batteries that can store 150Wh/kg. That's 540kJ/kg. So ~27kg for 15,000kJ.

Thanks for the correction, there's some handy 1:1 equivalence in there and I misremembered where it was.

That doesn't really help though, it still puts the pile of bare battery cells at about a third the weight of the character, that's clearly absurd.

The fact that you can just keep installing power modules is a bug, it is absolutely not intended that you can get more than 2,000 bionic power

From game experience, 2k is low for using bionics. And I'm not talking about offensive use like shockwave or chain lightning. 1250 battery weights 0.950kg. So technology is there :)
All I really want to say that power capacity should be balanced with bionic power usage.

Bionic power usage is another issue.
Feel free to start adjusting power draws to real life values if you have the time and will to contribute.

Was this page helpful?
0 / 5 - 0 ratings