Health, Healing and Death

A forum for discussion of topics relating to the design and operation of the MUD engine itself
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
User avatar
Japheth
Site Admin
Posts: 48
Joined: 08 Jul 2014, 01:28
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Health, Healing and Death

Post by Japheth » 14 Apr 2015, 02:03

As I have made some progress towards getting wounds completed I thought that I would give an update to everyone on how it all works, as I know this will be an area of major curiosity for users of the engine. I should also note that I have purposefully written the system to be a bit of a framework - that is to say, there is a framework through which a number of different models of wounds can work. That means that if one person wants to use FutureMUD to make a simple HP based system, they can do that, but equally they could even have different characters with the more complicated FutureMUD setups in coexisting. I might use the simple setup for disposable badies for instance, whereas PCs and important NPCs might use the more complicated setups.

So, where to begin?

I suppose I should define some terms first of all. In FutureMUD, every Character (PC or NPC) and every Item must have a Health Strategy. A Health Strategy is ultimately responsible for 4 main things:
  1. Deciding when something "dies" (death in the case of a Character, destruction in the case of an object).
  2. Deciding what happens when something takes damage - the Health Strategy determines the types and degree of wounds created when damage is suffered.
  3. Deciding what happens on the "Health Tick", which happens every 10 seconds. For organic Health Strategies this might include checking things like bleeding, or damaging organs under stress.
  4. Deciding what happens on the "Healing Tick", which happens every minute.
The details of HOW they do every one of those things is completely up to the strategy. This is what I mean when I say that I have set it up as a framework, because if I can easily extend the game by just making a new strategy. It's quite neat and self-contained and I'm pretty happy with the outcome.

An additional part of the picture are Wound Types. There are different Wound Types and they behave in very different ways. Which wound types are created in response to damage is determined by the Health Strategy, but some of the things wound types are responsible for are:
  1. What happens at each "Health Tick", from the wound's own perspective. This is generally going to be mostly bleeding.
  2. What happens on each "Healing Tick", again from the wound's own perspective.
  3. What happens when someone tries to "Treat" the wound in a particular way.
  4. How the wound is described in various scenarios (such as when looked at, medically examined, admin looking at it, etc.)
You will probably notice that there is some overlap between Health Strategies and Wounds. It is the Health Strategies themselves that are evoking these processes on Wounds, but additionally, the Health Strategies are looking at what is happening to the Character or Item as a whole, whereas the Wounds are only concerned with themselves. A wound might decide that it bleeds 5ml of blood and causes some additional pain, but it is the Health Strategy that aggregates what this all means for the Character.

So, what Health Strategies are there at the moment?

I've completed 3, which is probably where I will stop for LabMUD opening. The three are:
  1. Simple Item - Simple HP model. Simple Item Strategies have a formula for maximum hit points for an item based on its properties, and consider only the damage component of wounds. Exceeding maximum hit points in damage results in item destruction. No bleeding or healing or other biological processes.
  2. Simple Construct - More or less the same as Simple Item, but for characters. Designed for things like Golems or Undead or other stuff.
  3. Simple Organic - Also a hit point model, but also considers pain and stun. Too much pain or stun will see the character lose consciousness. Also considers bloodloss for both consciousness loss and death. Healing ticks do occur, probably at a slightly accelerated rate compared to real life. Doesn't consider limb severing or broken bones etc.
In the future, I will also include an Advanced model that does not base death on HP, but rather death of the brain. This should fit neatly into the existing framework but I want to focus on getting LabMUD open for now, so it'll open with the Simple Organic model for PCs.

It is probably worth noting that there are a number of "treatments" available in FutureMUD as well. Each of these treatment types works in a slightly different way, but every Health Strategy must respond to them in some way (though the response might be "You can't do that particular kind of treatment on this wound"). Additionally, there are "Treatment Items" that can be built for each treatment type. Generally these items are consumable and make it easier to succeed at the required check, but exceptions to this will be noted below.

The basic treatment flows are as follows:

If a wound is external and bleeds, it will require the following sequence:
  1. Trauma - trauma controls the immediate problem of bleeding. This represents physically closing wounds and applying pressure, as well as (if you have treatment items) actions such as clamping, tourniquetting or otherwise physically arresting traumatic blood loss. The main way to apply traumatic control is through the BIND command. It should also be noted that at this stage of treatment, exertion of any kind makes it highly likely for the wounds to begin bleeding again. Exertion basically involves any stamina expenditure whatsoever.
  2. Cleaning - this step is optional, but probably recommended. This involves physically cleaning foreign material and debris from the wound, so as to reduce the chance of infection once the wound begins to heal. It can be attempted without any treatment items (representing simply physically brushing the wound out or licking the wounds clean or whatnot), but is greatly helped by them. The main way this is done is through the CLEAN command. It should also be noted that you cannot clean a wound once it has been closed, and also you never know whether you have succeeded entirely with cleaning a wound.
  3. Antiseptic - this step is also optional, and will not always be appropriate in every MUD depending on setting. It involves using actual antiseptic treatment to kill off bacteria and other contaminants. Unlike cleaning it can be done after a wound has been closed but is less effective. It is done through the CLEAN command but cannot be done without a treatment item.
  4. Remove - this step is only required if there is a foreign object lodged in the wound like a bullet, arrow or sword. Wounds cannot be physically closed until any lodged objects are removed, which itself can cause additional trauma. This is done through the REMOVE command. It should also be noted that often lodged items (particularly bullets) will wind up lodging in INTERNAL wounds, so the external wound may be able to be closed with a bullet still lodged further in.
  5. Close - this step involves physically closing the wound, for example via suturing. Wounds have a chance to close on their own, but are almost certain to become infected if they do. This treatment is applied via the SUTURE command and always requires a treatment item.
Additionally, internal wounds require surgical intervention. This is the "Surgical" treatment type, and will be undertaken via the "Surgery" command. Surgical intervention is extremely painful (so the patient should be unconscious) and risky (so it should only be attempted by people with the actual skills). It always requires treatment items, and takes a lot of time, but is highly effective. This does mean that characters without access to surgical healing that take a serious internal wound are likely to die - which is pretty consistent with actual expected prognosis in the real world.

There are a few other treatment types that I haven't yet got around to implementing but will be doing in the future, such as "Set" for setting broken bones, "Relocate" for relocating dislocated joints, "Anti-Inflammatory" for controlling excessive swelling, and "Cauterising" for a simple but effective way of halting bleeding and closing wounds (with its own additional risks).

Finally, there are two special treatment types: "Repair" is used to repair damage to items only (heals wounds on items basically), and "Mend" is used to represent magical healing that physically betters the condition of the wound (so magical spells might apply the "Mend" treatment for example, rather than say healing a specific amount of damage). Mending can also stop trauma and close wounds.

So, what else do you need to know?

Well, at levels of casual observation (such as would be seen with the LOOK command) wounds are obscured by equipment. If you are in a Zombie MUD and a zombie bites you on the neck, well, you'd probably better put on a turtle neck sweater and hide that festering wound from your fellow survivors so you can turn at some point and kill them all. Keep in mind that equipment may also be damaged, so if someone slashes your belly open with a sword they probably also slash open the armour and clothes that are covering it. Additionally, I intend to make the ability for wounds to bleed into items so that people can see something is clearly wrong underneath without necessarily being able to see the wound.

There are additional levels of examination: Triage, which represents a quick physical examination of a willing (or unconscious) patient, with the assumption that you can move equipment about and poke and prod a bit. This gives a thorough list of wounds and even some indication of problems like broken bones and sprains and strains.

Next up there is "Examination", which presumes a much more thorough physical examination possibly including medical tools. This will give you a lot more information about the condition of wounds and also an indication of possible internal injuries. The latter is probably the important point, because players themselves don't even see their own internal injuries.

Finally there is "Surgical Examination", which is done through the SURGERY command. This will tell you exactly what is wrong with them, but does carry the same restrictions as surgery. The assumption is you're physically cutting them open to have a look. In the future, this will probably also tell you things like what implants and such they have, once such systems are in place. For now it's just about wounds.

Well, that's about it on Wounds for now! I am working backwards as you know, I started with corpses and dying, and now I have wounds and when to die - next I am going to work on actual sources of damage such as Weapons. After that, I will begin looking at combat itself.

Questions and feedback welcome!

Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable