Long time lurker, first time attempting to contribute, so please advise if I've made a faux pas or have done something wrong.
I've been perusing the repo for a little while, and I see there's a bunch of issues referenced under the Wound System project that could be all tied together with good framework.
Proposal: a system of attaching body parts to each other in a trie, where the "main" part is the head, and each "attached" part is a child. Torso has head, l_arm, r_arm, l_leg, r_leg as children. There are several trie-type topologies possible depending on how memory efficient or fast this needs to be.
This would allow:
@kevingranade has assigned himself on a few things on the wound system. Would it be acceptable for me to make an effort here?
Under this system, each body part would have a series of features it provides, as well as a list of status effects, integrity (this can be expanded into full anatomy as per DF in the future).
For example, the human head would have L_EYE, R_EYE. Eyes are tagged ALLOW_SIGHT. The head would have a list of effects. For example, CUT, BRUISE, etc. Each effect can have a severity, which is just a LUT against the possible effects.
This can go super deep, but the initial proposal is :
Additional context
I'm taking inspiration from the spirit of NEO Scavenger's infection/recovery system, and the mechanics of how Dwarf Fortress uses a body part system to create anything from sponges to horses to humans to dragons.
I've been talking about a more detailed body system in the discord for a few days now while I'm looking for projects to kill my time with while my main project is waiting for merge. What I took away from kevin's feedback on the idea is that there can't be simulation for the sake of simulation - there needs to be a clear benefit for this.
(N.B. I don't mean to be rude here)
How would you define benefit? Legitimate question. As per proposal, this resolves several issues, allows for targetted/aimed attacks down the line (if anyone wants to implement), allows you incapacitate an enemy without killing them (useful for NPC interaction, when NPCs actually have good AI), and forces interesting decisions on the player. What do you do if your arm gets lopped off (also allows for bionic or biological replacements -- Slime could grow new limbs as a trivial suggestion).
I guess what I'm trying to say is the benefit is that such a framework allows for a lot of supplementary features that would increase the game space and player option pool.
EDIT: It also directly contributes to the Wound System project by virtue of allowing limbs to have wounds and doing away with HP.
I'm personally for this too, but there is a reason things are the way they are. This is a ton of extra work of any future contributions related anatomy.
Also, monsters have no anatomy at all, I'm told the benefits of giving them bodies needs to outweigh the sheer amount of extra work that will be required any time someone wants to make a new monster.
EDIT: I also got half a design document about this somewhere, but that's more of idle notes at this point than a serious attempt to contribute to this game.
I noticed monsters have no anatomy actually. It's half the reason this came to mind.
I would argue that there is no extra effort required, just effort elsewhere. Currently people need to create butcher lists and loot lists. If monsters have anatomy (importantly linked anatomy), then the butcher products and parts of the loot list can be parametrised. The time you would spend on loot lists and butcher lists now go into describing a linked anatomy.
The player and npc already have such a body part system, it's used for targeting, damage, armor coverage, and I think some other things. The only thing you mention that's not included is left eye vs right eye.
Monsters do not have such a system by design, they have no use for tracking seperate limb states.
The existing system should be sufficient for wound tracking to supplant HP tracking, if we find we need more seperate parts for some reason we can add them. There's no need to go crazy tracking individual sub-parts except as necessary to place wounds and armor coverage.
I can see the system already exists, but it's hard-coded into the C++, and through enums, thus it's inflexible. What I'm going for is a system that gives you a data structuring method where modders (and developers) could develop monsters via JSON, and would only need to touch C++ when adding new features or tags to the system.
Why is it important to track states of limbs (and ability to use them) for the player but not for any other creature? The ability to target and deal with individual limbs adds tactical decisions that the player can make (as well as the option of grappling, technically, but that's just an idea). I would argue that more options for the player is almost always a good thing.
The thing that comes to mind is that tracking only one kind of body (humanoid bipedal) is convenient, but that's precisely why I'm suggesting this. You don't have to care if the monster has a head, or eyes, or what eyes do. All you have to program is what happens when ALLOWS_SIGHT organs take above each threshold of damage (swollen, damaged, blinded, missing, and so on). Then the monster designer can specify that a bug man has 18 compound eyes, needs to lose 7 to have "impaired sight", and at least 14 to be "blinded", and each one can take X structural damage, or only a wound of severity Y or less. Alternatively, a Slime threshold mutation could become "all limbs provide ALLOW_SIGHT - because you grow eye stalks". It provides tools for people who aren't making monsters too.
The existing system is sufficient for wound tracking on bipedal humanoids only. And I guess that's the point I'm getting at here.
EDITed to be less rude. I'm getting heated and I apologise.
Ok, you want a configurable anatomy system, and one that is extended to monsters as well as players.
The player and NPCs are special because we care a great deal about minute details of player and NPC interactions, and much less so about interactions with monsters. Monsters tend to either get killed outright or escape unscathed, and even if they are wounded a bit, we don't really care about tracking that long term. Players on the other hand are fully expected to accumulate various kinds of negative status effects, wounds, and equipment damage over time, so we track all of that stuff in high detail.
Backing away from the system, of tracking individual limbs, it's better to focus on the outcomes you want to see. If you're interested in a wound system for monsters, what kind of limb or body part the individual wounds appear on isn't that meaningful, we can instead just have attack outcomes that lead to the conditions you're interested in, such as downed, blinded, unable to walk, unable to attack, etc. Similarly with targeting, the player would declare their attempt to try to blind, knockdown etc their target rather than "targeting a limb" or "targeting the eyes". None of this needs to be mediated by an anatomy system. If a monster is resilient against a particular attack, they can just have a resistance to that attack rather than handling that by building up every body part and giving them properties.
Monsters tend to either get killed outright or escape unscathed
I guess that's fair enough. You are incentivised to murder monsters. I'm willing to concede that their anatomy hardly matters most of the time, however I think that there's still value to be gained from everything being modeled under one coherent system. I stand by my statement of more options for the player being a good thing. I know I can't take a hulk, but if I can put a few rounds into his legs and slow him down enough to get on my bike and leg it, then that's a good option to have.
I absolutely agree that it's easier to just do this outcome-based, and have status effects and conditions, however I think there's more value to be had from not just black box-ing monster anatomy.
On the topic of targeted attacks, that's part of it, and a smaller thing to implement, so I may start there.
I'll close this issue for now, and mull over it. You're right that it's effort, and it is a code restructure, and it does mean monster (and animal/NPC/living thing) designers need to re-learn a system. Also agree that this adds a big reason not to change anything, however I still think there's more to be gained than lost from a system like this.
Most helpful comment
Ok, you want a configurable anatomy system, and one that is extended to monsters as well as players.
The player and NPCs are special because we care a great deal about minute details of player and NPC interactions, and much less so about interactions with monsters. Monsters tend to either get killed outright or escape unscathed, and even if they are wounded a bit, we don't really care about tracking that long term. Players on the other hand are fully expected to accumulate various kinds of negative status effects, wounds, and equipment damage over time, so we track all of that stuff in high detail.
Backing away from the system, of tracking individual limbs, it's better to focus on the outcomes you want to see. If you're interested in a wound system for monsters, what kind of limb or body part the individual wounds appear on isn't that meaningful, we can instead just have attack outcomes that lead to the conditions you're interested in, such as downed, blinded, unable to walk, unable to attack, etc. Similarly with targeting, the player would declare their attempt to try to blind, knockdown etc their target rather than "targeting a limb" or "targeting the eyes". None of this needs to be mediated by an anatomy system. If a monster is resilient against a particular attack, they can just have a resistance to that attack rather than handling that by building up every body part and giving them properties.