05 Jul, 2012, KaVir wrote in the 1st comment:
Votes: 0
I thought I'd split this thread off to describe my own approach.

Each item type may use one or more magic bonus tables. If there are no magic bonus tables listed then it's not possible to have a magic version of the item. If there are multiple tables, then one is selected at random when the magic item is created.

Once a table has been selected, the mud calculates how many bonuses to apply, depending on the magic type (magical, legendary, mythical, relic or artifact) and rarity (common, uncommon or rare).

Each bonus in the table has a number of properties:

* Name: The (enum) name of the bonus.

* Description: The postfix added to the object name by this bonus. This is stored in the table because each item can have a different name for the same bonus, for example a "net of entanglement", a "shortbow of accuracy" and a "quarterstaff of striking" all have the ITEM_ATTACK bonus.

* Type: Various properties, such as "start" (the first bonus of the item must always have this property), "unique" (items cannot have more than one unique bonus), "single" (this bonus cannot be selected more than once per item), "non-enhanced" (this bonus isn't modified by the power of the mob that dropped the item), "heat" (bonus isn't available for material types that block heat bonuses), etc.

* Magic Requirement: The minimum magic type required to get this bonus, for example some bonuses are only available for legendary items, or mythical items, etc. It's also possible to define bonuses that never appear randomly (this is used to indicate bonuses that can be enchanted onto the item).

* Colour Requirement: The bonus is only available for items of the specified colour. However this is the colour variable used to generate object descriptions rather than a literal colour, and can therefore also be used for things like teeth - the "colour" of a tooth is specified by the creature type, so a dragon would have "a dragon fang". This allows teeth to have random bonuses based on the type of creature they come from.

* Radiation: The number of points of radiation per point of bonus (radiation is a form of item restriction - each character has a maximum amount of radiation they can wear at any one time). Once again, this is stored in the table because it can vary between items - a vorpal longsword has much cheaper cut bypass than a regular longsword, for example.

* Bonus range: A minimum and maximum value for each of the five magic types (magical, legendary, etc). This is usually adjusted by the power of the mob that dropped the item.

* Requires previous: This bonus can only be selected if the previous bonus in the table has also been selected.

This means that the bonus is always appropriate for the item type, and the name is always appropriate to the bonus - so no "gloves of kicking" or "boots of biting". The name is based on the most expensive bonus (in terms of radiation), so if you have a "crown of vision" it's because "detect invisibility" is its most expensive bonus. Similarly, the material restrictions mean that red dragonscale bracers can't have cold bonuses, and so on.

Note that I don't use name prefixes, because these are already determined by other factors (primarily colour and/or material type, but as the descriptons are dynamic it can also include damage, corrosion, wetness, blood, etc).

EDIT:

I still remember the first time I encountered a swarm of insects while playing Diablo II. My first instinct was to run - what could I do against a swarm of insects? But while running I accidently misclicked, swiftly slaying the entire swarm with my sword. Then a breastplate fell from the "corpse".

While my solution for random magic items was originally inspired by Diablo, my above experience with the swarm also inspired two further changes. The first was that swarms should be treated differently to regular mobs in terms of combat. The second was that creatures should only drop items they could feasibly have on them.

Thus when determining random drops, each mob has its own separate "treasure list". One item type is selected at random from the list, assigned random magic bonuses (if appropriate), and then dropped on the ground.
05 Jul, 2012, plamzi wrote in the 2nd comment:
Votes: 0
If your postfixes are always tied to a bonus, and if your items have multiple bonuses, how do you decide which bonus to name the item after?
05 Jul, 2012, KaVir wrote in the 3rd comment:
Votes: 0
As I said, "The name is based on the most expensive bonus (in terms of radiation), so if you have a "crown of vision" it's because "detect invisibility" is its most expensive bonus".
05 Jul, 2012, plamzi wrote in the 4th comment:
Votes: 0
So you have a table for sorting out how "expensive" bonuses are and specifying that, e. g. +5 armor is actually less expensive than +2 damage and that "detect invisibility" trumps them both? That sounds complicated to me.

If the most "expensive" bonus is always reflected in the name, then are you getting a good degree of randomness from all the other elements that go into the name? The way I do it is, there's a chance that a bonus will be reflected in the name, but there's also a chance that it won't be, with some cool postfix added that doesn't indicate actual properties, e. g. "of the Valkyrie", etc.
05 Jul, 2012, KaVir wrote in the 5th comment:
Votes: 0
plamzi said:
So you have a table for sorting out how "expensive" bonuses are and specifying that, e. g. +5 armor is actually less expensive than +2 damage and that "detect invisibility" trumps them both? That sounds complicated to me.

It's a single integer for each bonus. If "detect invisibility" has a radiation cost of 40, and the item gives +10 "detect invisibility", then it's worth 400 points of radiation. If "damage" has a radiation cost of 10, and the item gives +2 damage, then it's worth 20 points of radiation. 400 is higher than 20, so that's the bonus type used to determine the postfix name.

plamzi said:
If the most "expensive" bonus is always reflected in the name, then are you getting a good degree of randomness from all the other elements that go into the name?

Yes, it works pretty well.
06 Jul, 2012, Rarva.Riendf wrote in the 6th comment:
Votes: 0
Quote
While my solution for random magic items was originally inspired by Diablo, my above experience with the swarm also inspired two further changes. The first was that swarms should be treated differently to regular mobs in terms of combat. The second was that creatures should only drop items they could feasibly have on them.

My point of view is the loot is in the room, and sometimes hidden. Basically the loot does not 'fall' from the mobs, but is stuff they got from their previous victim. That can be anything (but not a lot higher than them as they would be the victim then)
Only the eq that has been set on the mob must be wearable/carryable by them. But that is the builder job.
06 Jul, 2012, KaVir wrote in the 7th comment:
Votes: 0
Rarva.Riendf said:
My point of view is the loot is in the room, and sometimes hidden. Basically the loot does not 'fall' from the mobs, but is stuff they got from their previous victim.

So you have to search the room to get the treasure? What if you're invisible? Does that mean you can get the loot without having to kill the mob? What about wandering mobs that constantly move around?

The idea of a swarm of insects burying a breastplate, only to later dig it up and rehide it as they move around, doesn't actually seem any better than the scenario I described in Diablo, to be honest.
06 Jul, 2012, Rarva.Riendf wrote in the 8th comment:
Votes: 0
I explain it by the fact you cannot really search the loot while the mob sit on it :) .
And I do not say the insects buried the loot, but simply that vegetation hid it since last time it killed something.

So the only problem is for wandering mob. Let say those has multiple hidden places for their loot, and that the only way you have to find them is to kill the mob. Sure it needs a little suspension of disbielief, but it is more easily achieved if the loot is not in the corpse in the first palce. On the contrary of a visual game where you need a visual clue (and then yes an armor dropping from a swarm of insects feels odd, you dont have any text clues unless you look again in the room, and sometimes specifically search for hidden stuff.
Where you put the cursor is up to you . (and then…lets talk about inventory then….no one should have any armor on him except the one he wears).
06 Jul, 2012, KaVir wrote in the 9th comment:
Votes: 0
Rarva.Riendf said:
Let say those has multiple hidden places for their loot, and that the only way you have to find them is to kill the mob. Sure it needs a little suspension of disbielief, but it is more easily achieved if the loot is not in the corpse in the first palce.

If I kill someone who's wearing a breastplate, then I don't see any need for suspension of disbelief to justify finding a breastplate in their corpse. It certainly seems more logical than discovering they've removed and hidden the breastplate in the moment before death.

This is also the way most muds handle it, at least for equipment, so it's not as if it requires any special coding effort. It's not uncommon for all mobs to drop gold, however, which is a bit weird.

My own drop system was designed to be more like Diablo, though. Instead of looting corpses, a random item drops on the ground when you kill your opponent. The way my approach differs is that (as I mentioned before) each mob has their own list of potential items they can drop. I don't have gold, so there's no issue there either.

This isn't just about suspension of disbelief though. It also provides an incentive to hunt different mobs based on the type of gear you want.
06 Jul, 2012, Rarva.Riendf wrote in the 10th comment:
Votes: 0
Quote
If I kill someone who's wearing a breastplate, then I don't see any need for suspension of disbelief to justify finding a breastplate in their corpse

For sure, but unrelated to the discussion.

Quote
Instead of looting corpses, a random item drops on the ground when you kill your opponent. The way my approach differs is that (as I mentioned before) each mob has their own list of potential items they can drop.

They way my approach differ is since it does not drop from the mob in the first place, I see no point in putting a limitation there, and if the mob was using it, it is not that 'random' anymore.

Quote
I don't have gold, so there's no issue there either.

I just removed gold from every non sentient mobs, or not big enough to gather loot (and consider that like even less credible than real life since some birds actually collect shiny stuff irl).

Quote
It also provides an incentive to hunt different mobs based on the type of gear you want.

Why would the mobs only keep the stuff they can wear, and not actually wear it? Or do you eq your mobs with the random item you give them ?
06 Jul, 2012, KaVir wrote in the 11th comment:
Votes: 0
Rarva.Riendf said:
KaVir said:
Rarva.Riendf said:
Let say those has multiple hidden places for their loot, and that the only way you have to find them is to kill the mob. Sure it needs a little suspension of disbielief, but it is more easily achieved if the loot is not in the corpse in the first palce.

If I kill someone who's wearing a breastplate, then I don't see any need for suspension of disbelief to justify finding a breastplate in their corpse.

For sure, but unrelated to the discussion.

You brought the subject up, so I responded.

Rarva.Riendf said:
KaVir said:
It also provides an incentive to hunt different mobs based on the type of gear you want.

Why would the mobs only keep the stuff they can wear, and not actually wear it?

They don't necessarily drop stuff they can wear, they "drop items they could feasibly have on them". Anything that could feasibly come from (or be taken from) the creature.

So a dire lion won't drop a breastplate, or a greatsword, but it might drop a pelt. One might argue that the player should have to explicitly skin the lion to get the pelt, but for gameplay reasons I chose not to go that route.

Rarva.Riendf said:
Or do you eq your mobs with the random item you give them ?

The treasure/drop list is separate from the worn gear, but (when possible) it usually mirrors it, or is at least a subset. So for example if you're fighting a creature armed with axes, one of his drops will probably be an axe, and he certainly won't ever drop swords.

Note that my loot system works like Diablo. You cannot "loot" corpses like in most muds, instead you get an item drop after a kill. The main difference is that I wanted the drop to be something that could reasonably come from the creature. I didn't want people killing a swarm of insects and seeing a breastplate drop on the floor.
0.0/11