Corpses

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

Corpses

Post by Japheth » 24 Feb 2015, 00:02

As I mentioned in my progress report, Corpses is something I've done lately. For a seemingly small part of the game world, it's actually a surprisingly challenging thing to implement design-wise. I wanted to talk here about some features of corpses in FutureMUD and how they differ from what you probably expect from the RPI Engine.

In the RPI Engine, when somebody died, it spawned a corpse. With a few hardcoded exceptions (e.g. when trolls died to sunlight), corpses followed the same pattern. Basically, an object was created that had the description 'the corpse of ...", where ... was the original sdesc, and the description when you looked at them was the same as in life. Also, the corpse was a container and had all the items it contained in life - however you couldn't put anything back into the corpse. If the corpse was an NPC corpse, it also would optionally have had a "skin object" and "skinned object" (there might've also been a "Failed skin object" but I can't remember). When the corpse was skinned, it would produce the skin object and the skinned object (if set). If there was no skinned object, the corpse would simply disappear.

All corpses when created were the same vnum, and so you couldn't really consumed an un-skinned corpse in a craft, because ANY corpse could be used, not just a specific one you're after. Hence, you skinned the corpse to get the specific vnum to be used in later crafts (e.g. butchering crafts).

In FutureMUD, I decided early on in the design of corpses to have the corpse be more strongly associated with the character it was in life. In fact, in FutureMUD the corpse item in game actually has the character loaded into it behind the scenes, so it can refer to any of the character's properties in life. I also decided that things like skinning and butchering should be built in systems rather than crafts (although skinning was not a craft in the RPI Engine either). I also wanted the corpse to decay over time and gradually become less recognisable - on that note, I wanted to leverage FutureMUD system of characteristic to make identification of old corpses more difficult, and also add the possibility of people mutilating corpses to hide their identity.

Consequently, every race in FutureMUD needs to have a "Corpse Model". These control how the Corpse is created when a character of that race dies, and how the Corpse behaves afterwards. I presently have two corpse models - a "Standard" model and a "Non-Decaying" model. There are several built in stages of decay in the Standard model - Fresh, Normal, Decaying, Decayed, Heavily Decayed and Skeletal. You can set the "decay points" required to reach each of those thresholds, the contribution of different terrain types in terms of decay points gained per minute, and how the corpse is described at each of those stages.

As an example, here are the descriptions that I have for each of the decay levels:

Fresh (sdesc: the fresh corpse of @@sdesc):

Code: Select all

@@desc
#3Death has taken hold of this individual, but they still look much the same as they did in life.#0
@@wounds

@@inv
Normal (sdesc: the corpse of @@sdesc):

Code: Select all

@@desc
#3Rigor Mortis has set in with this individual, and the blood has begun to pool in the extremities. Flies and other carrion insects have begun to lay eggs in the skin.#0
@@wounds

@@inv
Decaying (sdesc: the decaying corpse of @@sdesc):

Code: Select all

@@desc
#3This corpse has begun to bloat and putrefy as decay sets in. Maggots and other carrion insects have firmly taken hold of the corpse.#0
@@wounds

@@inv
Decayed (sdesc: the decayed corpse of a &a_an[&male &race]):

Code: Select all

This is the decayed corpse of a &male &human. The features are no longer easily recognisable, but in life, &he had $skincolour coloured skin and $?hairstyle[&a_an[$haircolour $hairstyle]][was completely bald].$?facialhairstyle[ &he had &?a_an[$facialhaircolour $facialhairstyle.]][] &he was @@height tall and $framefancy. &his nose was $nosefancy and he had $feature1fancy, as well as $feature2fancy.
#3This corpse is well along the process of decay. The flesh has sloughed off in places and particularly soft parts such as the eyes have been eaten by carrion insects.#0
@@wounds

@@inv
Heavily Decayed (sdesc: the heavily decayed &race corpse):

Code: Select all

This is the heavily decayed corpse of a &human of indeterminate gender. The individual had $skincolour skin, $?hairstyle[and $haircolour hair.][but was bald.]$?facialhairstyle[ They had $facialhaircolour facial hair.][] &he was @@height tall.
#3This corpse in a very advanced state of decay. The flesh is almost entirely gone and the corpse has largely liquified. At this stage, the only parts remaining are what the carrion eaters find tough to digest.#0     

@@inv
Skeletal (sdesc: the skeletal remains of &a_an[&race]):

Code: Select all

This is the skeletal remains of a &human that was @@height tall. Nothing remains of their other features.

@@inv
I use a bit of the internal markup for these descriptions but they should be mostly human readable to you. As you can see, I use the original sdesc and desc for the corpse so far as the "decaying" stage, but then I gradually begin to strip out features that people can recognise. For example, by the time they are decayed, their eyes will have been eaten by carrion animals so you can no longer tell their eye colour. By the time they become heavily decayed, you can't tell what wounds they had by casual examination (but I do intend to make some kind of "autopsy" type command whereby a skilled character can determine this kind of information even with a very far gone corpse, but a casual observer won't be able to tell). By the time they are a skeleton, you can't tell much at all. You can use a similar approach yourself or come up with your own rules.

As mentioned earlier, there will be the ability for players to mutilate a corpse to hide certain features. Which features can be mutilated will be configurable on a per-feature basis.

In addition to the corpse model, a race also has a skin difficulty, a list of skin products (can be more than one), as well as a list of butcher products (again, can be more than one). Butchering a corpse will destroy it, but skinning a corpse doesn't.

Moving on from the corpse model, one prominent difference between corpses in FutureMUD and the RPI Engine is that because they still have their original character, they are still a fully functioning inventory - so instead of being a simple container, you can actually dress and undress corpses as you would any other character. This is true no matter how far gone the corpse, so if you dressed up a dead soldier in his dress uniform and buried him in a coffin, and then later exhumed him - he'd still be in the same uniform. You could also use this to, for example, plant a weapon on someone that you'd killed, and it would look just the same as if they had been wielding the weapon themselves before they died.

On a related note, in refactoring the inventory-manipulation commands (get, give, take, etc.) to support interacting with corpses, I also supported them interacting with characters - so I'm going to implement a system whereby you can do the same thing to non-resisting characters (whether unconscious or simply willing - if you are a noble, you shouldn't have to put on your own pants when a servant can do it for you!). The "non-resisting" criteria will be implemented soon.

Probably the most exciting thing about corpses is that you can resurrect them quite smoothly with a command. This was a problem in the RPI Engine when you had a stayput variable mob that died for example - there was no easy way to resurrect it. In FutureMUD, it's pretty simple. I will implement the ability to restrict who can use this command and upon whom it can be used (so you don't have junior admins resurrecting PCs all over the place). At the moment it's head-admin only. The ability to easily resurrect a corpse though does mean it can be used in spells or progs for example - if your world has such magic, it will be quite trivial for you to allow it to happen.

At the moment, no matter how far gone the corpse, it doesn't carry back to the resurrectee - but I can see where that might be useful. I will look into that as an optional resurrection side effect in the future.

With corpses and dying/resurrection out of the way, I can proceed now to work on HOW characters die - the health and wounds system. I have planned a small round of intensive bugfixing to get to the bottom of a couple of critical but probably small issues that have arisen, and then I shall begin work on health.

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