MudBytes
» MUDBytes Community » Codebase Specific » DikuMUD » Builder-Defined Limbs
Pages: << prev 1, 2 next >>
Builder-Defined Limbs, Look Over and Opinionate!
ATT_Turan
Magician




Group: Members
Posts: 82
Joined: Jun 10, 2009

Go to the bottom of the page Go to the top of the page
#1 Posted Oct 30, 2009, 10:35 am

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.).

Code (text):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
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.
};

KaVir
Wizard






Group: Members
Posts: 1,114
Joined: Jun 19, 2006

Go to the bottom of the page Go to the top of the page
#2 Posted Oct 30, 2009, 11:11 am

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.
.........................
KaVir at God Wars II: godwars2.org 3000  Roomless world.  Manual combat.  Endless possibilities.

Last edited Oct 30, 2009, 11:12 am by KaVir
David Haley
Wizard






Group: Members
Posts: 5,728
Joined: Jun 30, 2007

Go to the bottom of the page Go to the top of the page
#3 Posted Oct 30, 2009, 11:40 am

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
.........................
-- d.c.h --
BabbleMUD Project (custom codebase)
Legends of the Darkstone (head coder)
http://david.the-haleys.org
.........................

KaVir
Wizard






Group: Members
Posts: 1,114
Joined: Jun 19, 2006

Go to the bottom of the page Go to the top of the page
#4 Posted Oct 30, 2009, 12:09 pm

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?
.........................
KaVir at God Wars II: godwars2.org 3000  Roomless world.  Manual combat.  Endless possibilities.

David Haley
Wizard






Group: Members
Posts: 5,728
Joined: Jun 30, 2007

Go to the bottom of the page Go to the top of the page
#5 Posted Oct 30, 2009, 1:14 pm

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.
.........................
-- d.c.h --
BabbleMUD Project (custom codebase)
Legends of the Darkstone (head coder)
http://david.the-haleys.org
.........................

Mabus
Sorcerer






Group: Members
Posts: 255
Joined: Aug 24, 2006

Go to the bottom of the page Go to the top of the page
#6 Posted Oct 30, 2009, 2:39 pm

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.
Code (text):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
//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:
Code (text):
1
2
3
4
	//                                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:
Code (text):
1
2
3
4
	//                                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.
.........................
-Mabus
Insomniac Coder

http://throes.slayn.net/images/ToCBanner.gif


KaVir
Wizard






Group: Members
Posts: 1,114
Joined: Jun 19, 2006

Go to the bottom of the page Go to the top of the page
#7 Posted Oct 30, 2009, 2:52 pm

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).
.........................
KaVir at God Wars II: godwars2.org 3000  Roomless world.  Manual combat.  Endless possibilities.

KaVir
Wizard






Group: Members
Posts: 1,114
Joined: Jun 19, 2006

Go to the bottom of the page Go to the top of the page
#8 Posted Oct 30, 2009, 3:16 pm

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:
Code (text):
1
2
3
4
5
6
7
8
9
10
{ // 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.
.........................
KaVir at God Wars II: godwars2.org 3000  Roomless world.  Manual combat.  Endless possibilities.

ATT_Turan
Magician




Group: Members
Posts: 82
Joined: Jun 10, 2009

Go to the bottom of the page Go to the top of the page
#9 Posted Oct 31, 2009, 12:37 am

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?

David Haley
Wizard






Group: Members
Posts: 5,728
Joined: Jun 30, 2007

Go to the bottom of the page Go to the top of the page
#10 Posted Oct 31, 2009, 1:08 am

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.
.........................
-- d.c.h --
BabbleMUD Project (custom codebase)
Legends of the Darkstone (head coder)
http://david.the-haleys.org
.........................

elanthis
Wizard




Group: Members
Posts: 760
Joined: Feb 26, 2008

Go to the bottom of the page Go to the top of the page
#11 Posted Oct 31, 2009, 4:28 am

David Haley said:
Make the common cases very easy.


Listen to David.  He will make you strong.
.........................
Cutting corners to keep your line count down is just sad.

Sandi
Wizard






Group: Members
Posts: 622
Joined: Jun 17, 2006

Go to the bottom of the page Go to the top of the page
#12 Posted Oct 31, 2009, 9:09 am


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.
.........................
The Witch of Tir na nOg

www.tnnmud.com
tnnmud.com 6789

ATT_Turan
Magician




Group: Members
Posts: 82
Joined: Jun 10, 2009

Go to the bottom of the page Go to the top of the page
#13 Posted Oct 31, 2009, 10:51 am

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?

Last edited Oct 31, 2009, 10:52 am by ATT_Turan
Runter
Wizard






Group: Members
Posts: 1,074
Joined: Jun 1, 2006

Go to the bottom of the page Go to the top of the page
#14 Posted Oct 31, 2009, 11:49 am


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.
.........................
-Heath

For once you have tasted flight Ruby you will walk the earth with your eyes turned skywards,
for there you have been and there you will long to return. --
                                              Leonardo Da Vinci Yukihiro Matsumoto

Davion
Idle Hand




Group: Administrators
Posts: 1,188
Joined: May 14, 2006

Go to the bottom of the page Go to the top of the page
#15 Posted Oct 31, 2009, 11:59 am

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).
.........................
http://mudbytes.net/mudbytessignature-davion2.png

Last edited Oct 31, 2009, 11:59 am by Davion
Pages:<< prev 1, 2 next >>

Valid XHTML 1.1! Valid CSS!