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

Refactor encumbrance #36730

Open
ymber opened this issue Jan 5, 2020 · 0 comments
Open

Refactor encumbrance #36730

ymber opened this issue Jan 5, 2020 · 0 comments
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

Comments

@ymber
Copy link
Member

ymber commented Jan 5, 2020

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 a std::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 time clothing_data is modified or an item pointed to by an item_location in it is modified.

@ymber ymber added (P3 - Medium) Medium (normal) priority Mechanics: Character / Player Character / Player mechanics Info / User Interface Game - player communication, menus, etc. Items / Item Actions / Item Qualities Items and how they work and interact labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant