31 Jul, 2009, KaVir wrote in the 1st comment:
Votes: 0
Has anyone had a go at generating descriptions based on worn equipment? I've been playing around with the concept, but it's pretty fiddly trying to make the descriptions read nicely. I'm sure I've seen something similar before, but I can't recall exactly what it was or how they did it.

My basic idea was that a character's description could be made up of 4 sentences, as follows:

Sentence 1: Head and face equipment. Include skin, eyes and hair info if appropriate.
Sentence 2: Body, arms, forearms and hands equipment.
Sentence 3: Groin, legs, shins and feet equipment.
Sentence 4: General sentence based on non-equipment factors.

For example:

Sentence 1: A pair of light brown eyes gaze out through the slit in the closed visor of his full helm, which fully conceals the rest of his features.

Sentence 2: He is wearing a breastplate over his chainmail shirt, and a pair of battle bracers are strapped to his forearms.

Sentence 3: He is wearing a pair of trousers tucked into his boots, with greaves strapped over his shins.

Sentence 4: He is about six feet tall, and moves with cat-like grace.

These would then be formatted into a single paragraph.

The problem is that players can wear any combination of equipment, and you really don't want descriptions which say things like "He is wearing a breastplate. He is wearing a pair of trousers."

I tried to get around the issue by including naked and partially naked descriptions - so that for example, the above text would be displayed as "He is wearing a breastplate, leaving his arms bare. He is wearing a pair of trousers which come down to his bare feet."

However that still doesn't read so well, so then I tried combining sentences 2 and 3 in situations where both sentences were pretty short. Thus you'd have "He is wearing a breastplate, leaving his arms bare, and a pair of trousers which come down to his bare feet." I'm not entirely happy with that either, but I'm at a bit of a loss as to how I could improve it further.

Then start coming all the special cases, like trousers which can be tucked into boots (but not into shoes), skirts which can't be tucked in to anything, shifts which cover the body and groin (but leave the legs bare), dresses which cover the body, groin and legs, robes which also cover the arms, and so on. There are so many special cases that require sentences 2 and 3 to be merged that I'm wondering if they should just be generated as one chunk of text, even though it was originally easier to break them down into two parts.

I've not yet even started looking into things like belts, necklaces, wielded weapons and the like. The original plan was that they could be tacked on to the end of the description, or perhaps inserted at specific points. But I'm now worried that the descriptions could start becoming uncomfortably long.

Anyone have any (design) thoughts on this, or done something similar? There must be an easier way to break the description down into managable chunks.
31 Jul, 2009, flumpy wrote in the 2nd comment:
Votes: 0
KaVir said:
Anyone have any (design) thoughts on this, or done something similar? There must be an easier way to break the description down into managable chunks.


It sounds like you are trying to solve the problem using the objects themselves, would this be true to say?

I have used a concept of a templated "view" on the object, and although in its infancy with my codebase, could be the answer.. The description is abstracted away from the object its self, but objects of that "type" all use the same "view". When a player looks at an object, they don't look at its description, they use the object's view interface to get feedback on what the object looks like. This means that I can put all sorts of logic in there and even use dynamic templates (including other templates if i need them), and let the view sort it out rather than adding extraneous logic somewhere to sort it all out at once.

In this way, if the player is wearing a set of objects, then the view of the player object would use the list of inventory items from the player's inventory to generate a description of what they were wearing. I expect you could recursive call the description of the item with an object that is worn over the other item, and thus changing its generated description based on that object.. if the item effectively covers all the items worn under it, it just doesn't call other object's views "worn underneath".

I haven't actually done this but it sounds about right, and its probably a lot trickier than I am making out.
31 Jul, 2009, KaVir wrote in the 3rd comment:
Votes: 0
Working out which items need to be displayed isn't a problem - I just iterate through the character's inventory, and store the highest layered worn item for each location.

Thus I have a pointer for each of head, face, eyes, body, arms, forearms, hands, groin, legs, shins and feet. A NULL pointer indicates that nothing is worn on that location, and two or more identical pointers indicate that the same item is worn on multiple locations.

So I've already determined which items need to be included, the difficulty I'm having is finding a generic solution for generating the actual grammatical structure of the description.
31 Jul, 2009, flumpy wrote in the 4th comment:
Votes: 0
KaVir said:
Working out which items need to be displayed isn't a problem - I just iterate through the character's inventory, and store the highest layered worn item for each location.

Thus I have a pointer for each of head, face, eyes, body, arms, forearms, hands, groin, legs, shins and feet. A NULL pointer indicates that nothing is worn on that location, and two or more identical pointers indicate that the same item is worn on multiple locations.

So I've already determined which items need to be included, the difficulty I'm having is finding a generic solution for generating the actual grammatical structure of the description.


I see, sorry for the confusion there then.

How do you actually do it for the descriptions of the locations in Godwars 2? That looks like you integrate descriptions there.. isn't it similar? Doesnt it use some sort of look-ahead to find out what surrounding tiles are? Can't you do that for head, necks and bodies as you iterate?

Or should I just shut the hell up ;)
31 Jul, 2009, KaVir wrote in the 5th comment:
Votes: 0
I appreciate the feedback, but to be honest the location descriptions use a different approach - they obviously contain dynamic elements as well, but mostly in the form of tags inserted into static blocks of text which are slotted together to form a description. The descriptions I'm discussing here can't really be constructed that way though, because they depend so heavily on the precise combination of items you're wearing.

Here's an article written by Tyche some time ago - I think this may have been where I got the original idea from: http://sourcery.dyndns.org/wiki.cgi?Wear...

He mostly focuses on wear locations (as that's what the article is really about), but he does also mention generated descriptions at the end. Sadly he doesn't go into much detail, but perhaps the article can better explain what I'm trying to achieve.
31 Jul, 2009, Idealiad wrote in the 6th comment:
Votes: 0
Just my .02 here, but the problem you're facing is that the descriptions read unnaturally because nobody describes things like that anymore, maybe with some exceptions like objectivist French authors from the 1960.... So unless you want your mud to read like the Iliad or Beowulf, you'll need to make some compromises. My best suggestion would be notto describe everything that is visible.

eta: come to think of it. romance novels might be a good inspiration as well.
31 Jul, 2009, Erok wrote in the 7th comment:
Votes: 0
KaVir said:
Thus I have a pointer for each of head, face, eyes, body, arms, forearms, hands, groin, legs, shins and feet.

That's 11 locations (so far). No matter what you come up with, I think the description is going to be cumbersome for fully equipped characters. Maybe you could just pick a few random locations to compose a briefer but more natural description, and have a separate command for a detailed view of what is worn in each location.

You could even choose what to include in the description based on the item rarity or value, since those are likely to be noticed more than common stuff.
31 Jul, 2009, Skol wrote in the 8th comment:
Votes: 0
Kav, maybe you show the 'main' ones, like head/chest, and then randomly show the others?
So each person might notice a different thing. But not every bit of information on the character, unless perhaps a timed action of like 'study joe' and then you get the full stuff.

I did a similar thing with my fishing code, rather than showing like:
A fishing pole holds:
a heavy sinker
shark line
a 5" iron hook
etc.

A large piece of kraken tentacle is stuck on a huge iron fishhook attached to massive Dimernesti shark cable hangs from a Modified deepsea fishing pole, a large lead weight is fixed about a foot or two above the end.
A large piece of kraken tentacle has been chewed down to baitfish sized.

And yeah, I need to fix it, but a similar 'sentence' type approach. (and probably not show 'size' in short descs when they get altered in game heh).

I do like the idea though Kav, I'd thought of doing a similar thing myself. The only thing that has stopped me is that my game allows color restrung equipment, and often the players have (Blackened) a pair of greaves… doesn't lend itself to sentence structure (or taste ;p).
31 Jul, 2009, elanthis wrote in the 9th comment:
Votes: 0
KaVir said:
Has anyone had a go at generating descriptions based on worn equipment?


Yes. Source MUD does a simple but workable equipment description. I don't have complex equipment stacking (more detail than is at all useful or necessary) so my code didn't have to deal with upper layers hiding what's worn in lower layers, but adding that wouldn't be terribly hard. Source MUD also has explicit selections for height, build, skin color, hair color, eye color, and hair style, which are automatically compiled into a character description.

If you have a stacked-slot system, it would be quite easy to deal with layered equipment. The logic would get a little hairy looking in a few places, but still maintainable and readable. It's really mostly all about doing crpa like:

if equip.cloak or equip.tabbard or equip.armor or equip.shirt then
description += " {player.name} is wearing "
if equip.cloak then
description += " {equip.cloak.indirect_name}"
if equip.tabbard or equip.armor or equip.shirt then
description += " over"
end
end
if equip.tabbard then
description += " {equip.tabbard.indirect_name}"
if equip.armor then
description += " on top of {player.his_or_her} {equip.armor.possessive_name}"
end
else if equip.armor then
description += " {equip.armor.indirect_name}"
if equip.shirt then
description += " over {equip.shirt.indirect_name}"
end
else if equip.shirt then
description += equip.shirt.indirect_name
end
end


That would (ignoring any typos/thinkos I may have typed in accidentally) print descriptions like:

Sean is wearing a red shirt.
Sean is wearing a chain chauberk over a blue shirt.
Sean is wearing a red, wool cloak over a green dragon tabbard on top of his steel breastplate.
Sean is wearing a fuzzy cloak over a chain shirt over a wool arming coat.
Sean is wearing a red bear tabbard on top of his chain hauberk.

You need to be able to generate proper names for wearable items. We had a thread about that a few months back. Things like knowing the difference between using "a" for red shirts and "an" for orange shirts. In Source MUD, I just require those to be put in the item name, and it does the munging as necessary. That is, the object's name is "a red shirt" and Source MUD sees that the first word is "a" and internally stores the name as "red shirt" with the article type set to ARTICLE_A. When doing a possessive reference the article is dropped (the his/her/your/their word is the article, but that is not determined by the object itself, but instead by the possessor). When doing a direct reference the article is replaced with "the." It also recognizes the special case of a proper noun, so objects that start with a capital letter never have an article. It gets a little funny with possessive articles as it'll say something like "You drop your Red Fang" when it should probably say "You drop Red Fang." That wouldn't be hard to do with a new function that takes both the possessor and the object, something like "You drop {possessive 'your' $item}" or "{$player.name} drops {possessive $player.his_or_her $item}".
31 Jul, 2009, KaVir wrote in the 10th comment:
Votes: 0
Erok said:
That's 11 locations (so far). No matter what you come up with, I think the description is going to be cumbersome for fully equipped characters. Maybe you could just pick a few random locations to compose a briefer but more natural description, and have a separate command for a detailed view of what is worn in each location.


Skol said:
Kav, maybe you show the 'main' ones, like head/chest, and then randomly show the others?


I may need to do that to a certain degree, but if possible I'd at least like to include the main coverable locations.

elanthis said:
That would (ignoring any typos/thinkos I may have typed in accidentally) print descriptions like:

Sean is wearing a red shirt.
Sean is wearing a chain chauberk over a blue shirt.
Sean is wearing a red, wool cloak over a green dragon tabbard on top of his steel breastplate.
Sean is wearing a fuzzy cloak over a chain shirt over a wool arming coat.
Sean is wearing a red bear tabbard on top of his chain hauberk.


That's the sort of thing I'm talking about - but those are still just single sentences. What sort of overall descriptions do you have for a fully-equipped character? If the character had trousers, greaves and boots as well, would those be a separate sentence, or would they be tacked on to the end of the above sentences? And how do you handle cases where a character is partially (or even completely) naked?
31 Jul, 2009, quixadhal wrote in the 11th comment:
Votes: 0
It might also be worth assigning description weights to various wearable objects, so that you have a limit on the number of things you describe. In other words, nobody cares if I'm wearing an ordinary T-shirt, if I have a diamond bracelet on my arm. So rather than trying to push ALL the top-level slots into the description, only show the most interesting ones.

Perhaps something like slot-weight * object-weight, so exceptional rings would outweigh ordinary shirts, but perhaps not mediocre chest armour.
31 Jul, 2009, KaVir wrote in the 12th comment:
Votes: 0
quixadhal said:
It might also be worth assigning description weights to various wearable objects, so that you have a limit on the number of things you describe. In other words, nobody cares if I'm wearing an ordinary T-shirt, if I have a diamond bracelet on my arm.

Problem is you'd look at someone wearing a t-shirt, see them slip a diamond bracelet around their wrist, look again, and the t-shirt would no longer be there - that would look pretty odd, and would no doubt be repeatedly reported as a bug.
31 Jul, 2009, Koron wrote in the 13th comment:
Votes: 0
"Someguy is wearing a whole bunch of boring stuff, but also a shiny diamond bracelet on his right wrist. How do you suppose a guy wearing such boring clothes afforded such an expensive trinket?"
31 Jul, 2009, tphegley wrote in the 14th comment:
Votes: 0
I think random would be best, with like three main ones always shown, head, body, legs.

Whenever you see someone the first time, you can remember certain things about them, and if you see them again, you might notice something different.

So show head, body, and legs with 2 extra random pieces thrown in.

I've never played a godwars mud or anything, but normal mud is when you look at someone, yes, you see their description, but then you see their eq. What's the point of making the description dynamic unless you are going to take away the ability to see eq.

I'm not sure what this design 'makes better' rather then just being extra fluff, but then again, I don't know your full reasoning behind it or how your mud works.
01 Aug, 2009, Koron wrote in the 15th comment:
Votes: 0
The problem with random displays is that you're basically just forcing people to spam the look command just to see what someone else is really wearing. Spam is not fun unless you're from Nigeria!
01 Aug, 2009, Davion wrote in the 16th comment:
Votes: 0
Have you ever thought about maybe setting a template and generating the descriptions by that? That's how ADP generates automatic descriptions. Uses something similar to the tagline snippet you find here on MudBytes. The only way I can really think of outside of this, is by first gathering your equipment. Then going through them all and linking them together for the sentence structure. Then go through each 'batch' of objects and generate a sentence for it.
01 Aug, 2009, KaVir wrote in the 17th comment:
Votes: 0
tphegley said:
I think random would be best, with like three main ones always shown, head, body, legs.

If the face is covered, people wouldn't be able to see what you look like. If face-worn gear isn't mentioned, it'll look like I just forgot to include your appearance in the description. Groin is also important, probably more so than legs, as then it'll include loincloth as well as trousers (the only thing that covers legs and not groin is greaves).

tphegley said:
Whenever you see someone the first time, you can remember certain things about them, and if you see them again, you might notice something different.

You'll just end up with people spamming 'look'.

tphegley said:
I'm not sure what this design 'makes better' rather then just being extra fluff, but then again, I don't know your full reasoning behind it or how your mud works.

Don't underestimate the value of cosmetic fluff - it can be just as important as gameplay. Other than flavour, the main reason behind this is that I want descriptions to accurately describe what the character really looks like, rather than just "You see nothing special", or ASCII phallic symbols, or some description that has no actual bearing on what the character really looks like, etc.
01 Aug, 2009, KaVir wrote in the 18th comment:
Votes: 0
Davion said:
Have you ever thought about maybe setting a template and generating the descriptions by that? That's how ADP generates automatic descriptions.

I'm not familiar with ADP, sorry. I don't think templates would work so well, because the structure of the description can be so varied - unless you had lots of small templates that could be combined, which is basically what your second suggest does:

Davion said:
The only way I can really think of outside of this, is by first gathering your equipment. Then going through them all and linking them together for the sentence structure. Then go through each 'batch' of objects and generate a sentence for it.

That's pretty much the approach I described in my first post. The difficulty I'm finding is in constructing and combining multiple sentences into a nicely readable format.
01 Aug, 2009, quixadhal wrote in the 19th comment:
Votes: 0
KaVir said:
quixadhal said:
It might also be worth assigning description weights to various wearable objects, so that you have a limit on the number of things you describe. In other words, nobody cares if I'm wearing an ordinary T-shirt, if I have a diamond bracelet on my arm.

Problem is you'd look at someone wearing a t-shirt, see them slip a diamond bracelet around their wrist, look again, and the t-shirt would no longer be there - that would look pretty odd, and would no doubt be repeatedly reported as a bug.


I wasn't suggesting displaying the slot as empty, I was suggesting not displaying it at all.

"You see a young man with brown hair and green eyes, wearing a baseball cap. He holds a Louisville Slugger in his right hand, and wears a diamond bracelet on his left wrist. His shoes are made from fine leather, tinted black."

No reference to the blue jeans or T-shirt he's wearing because they're not memorable. That's the kind of description you'd give someone when trying to describe them, and seems appropriate for a "long description". If you care about exactly what the guy is wearing in every slot, there should be a more intense "examine" command to see that (IMO, of course).
01 Aug, 2009, flumpy wrote in the 20th comment:
Votes: 0
Koron said:
The problem with random displays is that you're basically just forcing people to spam the look command just to see what someone else is really wearing. Spam is not fun unless you're from Nigeria!


I agree…

I've always preferred a list.

> look flumpy

Flumpy is wearing a long coat, an I love Fosters t-shirt, a pair of silver greaves,
a stained pair of brown trousers and a condom.

He is carrying a mad looking chicken.


What might be good would be if you looked at the individual items in someone's inventory so you got the details:

> look flumpy's coat

Flumpy is wearing a long coat over a white shirt.

> look flumpy's greaves

Flumpy is wearing a tarnished pair of greaves over a nasty looking pair of stained trousers.
His bare feet stick out the end of his trouser legs, they seem far too small for him.


Whether this would be a feature that was used much would be another thing.
0.0/63