30 Oct, 2009, ATT_Turan wrote in the 1st comment:
Votes: 0
Something that pops up occasionally in my discussion of MUD's with various people is the lack of realism when it comes to battle damage. We're probably all familiar with stock Diku where you can lop arms off of mobs when you kill them (and then eat them and get poisoned O_o ). I happen to be coding off of a GodWars base, so there's more complexity with being able to break arms, cut off toes, pop out eyes, etc. - but this still leaves you with cutting arms off of wolves and making skeletons bleed.

I therefore resolved a few weeks ago to come up with a system for allowing builders in the OLC to define what limbs their mobs have. If they're humanoid mobs, well and good, they just leave things the way they are and use the existing system to deal with damaging that way. If they're not, however…I present my mission statement and the basic structure for your opinionating.

* Limbs have user-defined names, and predefined purposes. They can use either a boolean to indicate the anatomy
of the limb is like a human, or not have the value in which case they can perform only generic actions, such
as making cuts, breaking and severing the limb.

* The mob will also store boolean values for heads, torsos and cuttable -
possessing a head or torso presumes mammalian bone structure; jaw and teeth in the head, ribs and spine in the torso.
A nose, ears and stomach will be presumed if cuttable is true. Eyes are defined as limbs.

* Limbs can be defined as miscellaneous so as to not serve any mechanical gameplay purpose, but still be accessible for
cutting/breaking/severing (cutting and breaking will be user-defined). Mobs will have an integer array of how many limbs of each type they
have (there will be a random chance to hit a misc instead of an arm/leg if any are present), and will also store an integer array of how of
each type is currently severed (this can be used to check whether they are able to stand, hold things, see, etc.).

struct limb_data
{
char *descriptor; // Left, third, front, etc.
char *name; // The base name of the limb.
int type; // Arm, leg, eye, miscellaneous.
bool can_cut; // Can the limb be cut and bleed? Irrelevant for eyes.
bool can_break; // Does the limb have bones that can be broken? Irrelevant for eyes.
bool is_human; // For arms and legs; does the arm have a hand with
// fingers? Does the leg have a foot with toes?
int damage; // Holds bits as to whether this limb has been cut, broken or severed.
LIMB_DATA *next; // Pointer to the next limb in the creature's list.
};
30 Oct, 2009, KaVir wrote in the 2nd comment:
Votes: 0
The approach I used was to give each creature a 'shape' attribute, with each shape defining a number of properties appropriate to that particular form (a normal human uses the default for everything). Individual properties can also be overridden for specific mobs.

It's pretty simple, but it works and it's easy to use. Your approach looks like it could become quite complicated for the builders.
30 Oct, 2009, David Haley wrote in the 3rd comment:
Votes: 0
I think it's fine to have complexity like that, as long as you make it easy to do common things. You can keep all of your complexity while also having most of the simplicity KaVir is talking about by having "limb templates" that are easily applied to mobs.

E.g.,
makemob greywolf
setlimbs greywolf mammal
30 Oct, 2009, KaVir wrote in the 4th comment:
Votes: 0
David Haley said:
E.g.,
makemob greywolf
setlimbs greywolf mammal

But a human is also a mammal, and has a very different shape from a wolf for the purposes of chopping off arms, legs and tails. Or are you talking about a multiple template approach, where the builders combine several options?
30 Oct, 2009, David Haley wrote in the 5th comment:
Votes: 0
You can call it "four-legged mammal" if you prefer, the point was just to have a set of templates that you can easily apply. You would have things like "humanoid", "four-legged animal", "snake", "dragon", "fish", etc.

Think of it as your "shape" attribute, except that by setting "shape", you are implicitly setting a whole host of attributes, that you can then customize.

Combining templates would be interesting too, although I'm not sure what would happen if you combined, say, snake and humanoid.
30 Oct, 2009, Mabus wrote in the 6th comment:
Votes: 0
I have been recoding our game's combat to more accurately use hit-locations (and the armor being worn on them) lately, so I have been messing with "body parts" a lot. We are based off of CoffeeMUD.

In CoffeeMUD the body parts are set by the race. Each MOB is set to be of a specific race.
//From Race/interfaces/Race.java
/** the number of body part constants*/
public final static int BODY_PARTS=16;
/** constant string list naming each of the BODY_* constants in the order of their value*/
public final static String[] BODYPARTSTR={
"ANTENEA","EYE","EAR","HEAD","NECK","ARM","HAND","TORSO","LEG","FOOT",
"NOSE","GILL","MOUTH","WAIST","TAIL","WING"};

//From Race/StdRace.java
// an ey ea he ne ar ha to le fo no gi mo wa ta wi
private static final int[] parts={-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
public int[] bodyMask(){return parts;}


So a giant spider with 10 eyes and 8 legs:
//                                an ey ea he ne ar ha to le fo no gi mo wa ta wi
private static final int[] parts={0 ,10 ,0 ,1 ,0 ,0 ,0 ,1 ,8 ,8 ,0 ,0 ,1 ,0 ,0 ,0 };

Which differs from a human:
//                                an ey ea he ne ar ha to le fo no gi mo wa ta wi
private static final int[] parts={0 ,2 ,2 ,1 ,1 ,2 ,2 ,1 ,2 ,2 ,1 ,0 ,1 ,1 ,0 ,0 };



Which all goes along with the "template" idea that David brought up.
30 Oct, 2009, KaVir wrote in the 7th comment:
Votes: 0
David Haley said:
You can call it "four-legged mammal" if you prefer, the point was just to have a set of templates that you can easily apply.

Ok, I wasn't sure if you were suggesting "four-legged" (as opposed to "two-legged", etc) and "mammal" (as opposed to "reptile", etc) as a sort of multi-part template system. I think that could work too, but depending on the detail you want it might get difficult to avoid conflicts.

David Haley said:
Combining templates would be interesting too, although I'm not sure what would happen if you combined, say, snake and humanoid.

Yeah, that sort of thing can get messy. But I think the D&D approach to templates could provide an interesting basis for a mob taxonomy system, and would be particularly nice for things like necromancy (being able to automatically create undead versions of existing creature shapes).
30 Oct, 2009, KaVir wrote in the 8th comment:
Votes: 0
Mabus said:
So a giant spider with 10 eyes and 8 legs:

10 eyes? It's a mutant!

I like the idea of being able to specify that amount of detail, but the layout is hard to read and I can't imagine it being much fun to update them all when you add new body parts. Personally I'd go for something more like this:
{ // Spider
{ PART_EYE, 8 },
{ PART_HEAD, 1 },
{ PART_TORSO, 1 },
{ PART_LEG, 8 },
{ PART_FOOT, 8 },
{ PART_MOUTH, 1 }
},

Or better yet, read it from file.
31 Oct, 2009, ATT_Turan wrote in the 9th comment:
Votes: 0
I considered the idea of having multiple templates, and it's possibly I may still implement something like that. Right now I'm leaving in a boolean field that builders can toggle to say if it's a regular humanoid, and it wouldn't be too much work to change that to a field that would store a template value. Cratylus told me that his codebase uses something that sounds similar to Mabus' game where the limb information is stored as part of a race data, but I wanted to allow builders more reign - rather than me adding in an imp race for one mob, they can just specify it to be of the humanoid type and add two miscellaneous limbs for wings that can be broken or severed. I figure I can add some submenus to the medit function of the OLC so you can, say,
>showlimbs
1. left wing
2. right wing
3. dorsal tentacle

then just
>limbedit 3
Descriptor: dorsal
Name: tentacle
Type: miscellaneous
Cuttable? yes
Breakable? no

And then they can edit those fields just like they would when editing any other aspect of their area. I like the notion of keeping this versatile - make a mindflayer mob and give it six facial tentacles that can get lopped off, or make a chimera with breakable goat horns. Any other thoughts? Is there something that is both obvious and outrageously cool that I should think of before implementing this junk?
31 Oct, 2009, David Haley wrote in the 10th comment:
Votes: 0
I think you need to make it very, very easy for builders to use the system: not only use it, but use it correctly. Make the common cases very easy. It's ok if fancy customization is harder than very common cases for limb arrangements.

I don't think you should have a hard-coded list of limb types with a count for each, pretty much for the same reason KaVir gave. It would be better to store it as a map from type to properties, or whatever it is exactly that you're storing.

One thing I would consider is why you're doing this in the first place. Is it just fun to sever limbs randomly? Will severed limbs impact gameplay, or be for cosmetics? (etc.) The answers to these questions will determine the amount of detail you need, in addition to the importance of getting it right.
31 Oct, 2009, elanthis wrote in the 11th comment:
Votes: 0
David Haley said:
Make the common cases very easy.


Listen to David. He will make you strong.
31 Oct, 2009, Sandi wrote in the 12th comment:
Votes: 0
David Haley said:
You can call it "four-legged mammal" if you prefer, the point was just to have a set of templates that you can easily apply. You would have things like "humanoid", "four-legged animal", "snake", "dragon", "fish", etc.

Think of it as your "shape" attribute, except that by setting "shape", you are implicitly setting a whole host of attributes, that you can then customize.

Combining templates would be interesting too, although I'm not sure what would happen if you combined, say, snake and humanoid.

ROM has this. Mobs have both 'form' and 'parts' attributes. You can make a Pegasus by choosing the 'horse' form and adding the 'wings' parts.
31 Oct, 2009, ATT_Turan wrote in the 13th comment:
Votes: 0
David Haley said:
One thing I would consider is why you're doing this in the first place. Is it just fun to sever limbs randomly? Will severed limbs impact gameplay, or be for cosmetics? (etc.) The answers to these questions will determine the amount of detail you need, in addition to the importance of getting it right.


I'm doing it to add some bit of realism and to impact gameplay. For example, it doesn't make sense to break a skeleton's nose in combat, and one of my tradeskills involves harvesting organs and parts from corpses, so it doesn't make sense to be able to cut off a wolf's hand. The additional cosmetic functionality is just for visual fun.
Sandi said:
ROM has this. Mobs have both 'form' and 'parts' attributes. You can make a Pegasus by choosing the 'horse' form and adding the 'wings' parts.


Really? Which RoM, whatever the newest thing in the repository is?
31 Oct, 2009, Runter wrote in the 14th comment:
Votes: 0
ATT_Turan said:
David Haley said:
One thing I would consider is why you're doing this in the first place. Is it just fun to sever limbs randomly? Will severed limbs impact gameplay, or be for cosmetics? (etc.) The answers to these questions will determine the amount of detail you need, in addition to the importance of getting it right.


I'm doing it to add some bit of realism and to impact gameplay. For example, it doesn't make sense to break a skeleton's nose in combat, and one of my tradeskills involves harvesting organs and parts from corpses, so it doesn't make sense to be able to cut off a wolf's hand. The additional cosmetic functionality is just for visual fun.
Sandi said:
ROM has this. Mobs have both 'form' and 'parts' attributes. You can make a Pegasus by choosing the 'horse' form and adding the 'wings' parts.


Really? Which RoM, whatever the newest thing in the repository is?


Nah, I've seen it in different diku flavors but I've never actually seen it doing anything other than determining which random entrails corpses may spawn upon death. etc.
31 Oct, 2009, Davion wrote in the 15th comment:
Votes: 0
ATT_Turan said:
Really? Which RoM, whatever the newest thing in the repository is?


Any ROM. It's stock! But ya, as Runter said, mostly has to do with corpse mangling :P. It's no where near to the detail you want, as the parts are simply just bitvectors (has, or doesn't have).
31 Oct, 2009, ATT_Turan wrote in the 16th comment:
Votes: 0
Davion said:
ATT_Turan said:
Really? Which RoM, whatever the newest thing in the repository is?


Any ROM. It's stock! But ya, as Runter said, mostly has to do with corpse mangling :P. It's no where near to the detail you want, as the parts are simply just bitvectors (has, or doesn't have).


Ah, thanks. I shan't bother looking it up, then.
31 Oct, 2009, Scandum wrote in the 17th comment:
Votes: 0
Emud uses body parts for unarmed combat spams, purely cosmetic stuff.
31 Oct, 2009, David Haley wrote in the 18th comment:
Votes: 0
ATT_Turan said:
I'm doing it to add some bit of realism and to impact gameplay. For example, it doesn't make sense to break a skeleton's nose in combat, and one of my tradeskills involves harvesting organs and parts from corpses, so it doesn't make sense to be able to cut off a wolf's hand. The additional cosmetic functionality is just for visual fun.

OK then. So it's quite important that it be correct, because it sounds like some skills or effects will only work against mobs with the right body parts. There's nothing more annoying than thinking that some skill sounds good, and it only works against orcs (or whatever), just to find out that there are no orcs in the world or worse yet there are orcs but they don't have the right body parts set up…
Similar story for organs etc.

If it were just cosmetics, it would be less important to get the details right, but if it's going to play a non-trivial role in gameplay (which is what it sounds like from your description) you probably do want detail, which means it has to be easy for builders to provide that detail.

In fact, you could probably set limb templates for them automatically as soon as they set the 'race' attribute a mob. Then, let them choose other templates if they feel like it. Sandi's description of basic form vs. extra features sounds pretty nice, too: you would have a list of core forms, and then a list of extras you can add on top of those forms, so you could easily mix and match all kinds of things without having to deal with the complexities of resolving conflicts among whole templates. (That is, if you only had full forms, you'd have to figure out what happens when you mix a four-legged animal and a dragon, whereas you might have only wanted the four legs and the wings, etc.)
31 Oct, 2009, Sandi wrote in the 19th comment:
Votes: 0
Davion said:
ATT_Turan said:
Really? Which RoM, whatever the newest thing in the repository is?


Any ROM. It's stock! But ya, as Runter said, mostly has to do with corpse mangling :P. It's no where near to the detail you want, as the parts are simply just bitvectors (has, or doesn't have).

ROM has templates, which is what David was suggesting.

And bits make sense in combat related code. The "level of complexity" is determined by what the bits represent.

From experience, I'd suggest that when a Builder selects a form template (simplicity), you display the parts included (information).
31 Oct, 2009, ATT_Turan wrote in the 20th comment:
Votes: 0
I'm halfway through implementing this system - I've written the interface for editing limbs into the OLC, and I'm starting to write the code for damaging them in fights and what the effects of that will be. I decided against having any templates other than two toggled values in the basic meditor that determine whether the mob uses normal human anatomy and can bleed. I figured there was little point in both allowing builders to define custom limbs and have some number of predetermined templates - it's more work for me, and there are few enough values to set for limbs that adding them yourself is not difficult. Of course, this can always be changed later if I get builders who have problems with it or find it highly inefficient as is.
0.0/29