Refactor encumbrance #36730
Labels
Info / User Interface
Game - player communication, menus, etc.
Items / Item Actions / Item Qualities
Items and how they work and interact
Mechanics: Character / Player
Character / Player mechanics
(P3 - Medium)
Medium (normal) priority
Is your feature request related to a problem? Please describe.
The encumbrance handling code is disgusting. It's a mountain of hacks piled on top of a bad implementation from before DDA and its complexity is blocking improvements.
Describe the solution you'd like
Refactor the code handling coverage and encumbrance. It's possible this is a set of linked problems and the body part rework we need for proper injury modeling should come first. Encumbrance should be cached and recalculated whenever it may change. Calculating it every time the values are needed would be terrible for performance. The new system has to allow for the UI improvements jbtw made last time this code got major changes to work.
We may want to give
Character
astd::set<std::list<std::pair<layer, item_location>>> clothing_data
storing a list of <item_location, layer> pairs for each body part. A separate structure is a cache storing ints for encumbrance per bodypart and is updated every timeclothing_data
is modified or an item pointed to by anitem_location
in it is modified.The text was updated successfully, but these errors were encountered: