Page 1 of 1

Mob body type

PostPosted: Tue Sep 01, 2009 3:55 pm
by Kakuri
I know the topic of mob body type comes up now and then - is anyone working on this? Has any plan been agreed on?

I got to thinking about it and came up with the idea of a table in the database for body types. The table would specify:
ID: the ID assigned to the body type - this would be the field that the BodyType column in the mob table is associated with.
Name: something descriptive, like "skeleton," "stone," "undead," etc. This would allow GMs to use "/mob bodytype undead" in-game instead of having to look up a number in the ID table.
Resists: ten columns, one for each damage type. Resists could of course be negative indicating a vulnerability.
DamageType: this would specify the type of damage the mob does.

Re: Mob body type

PostPosted: Tue Sep 01, 2009 4:15 pm
by Graveen
If fact, Xali gives me his own bodytype hack. This is working nice, but for mobs, we have to handle 2 types of resists:

the resists given by the bodytype - let's suppose the bodytype determines the nature of the mob , and give the mob resists or vulnerabilities.

the resists given by the equipment - let's suppose a mob wearing an armor can benefits the bonus/malus in resists/vulnerabilities.

The piece of code i have is handling only bodytype, but extend it for armor resistances; anyway, we can't rely on a stric bodytype for pve bonuses or charms.

you want the code ? it 'll save you a bit of work.

Re: Mob body type

PostPosted: Tue Sep 01, 2009 4:22 pm
by Luhz
I think there should just be a database or hashtable mapping of IDs to body types. This might take a while to build, unless you can datamine it from something, but make things simple for worldbuilding because bodytype would always be automatically set to match the model. I would then leave the resists for bodytypes hardcoded in an array since they don't need to be changed enough to require the flexibility of database use.

Re: Mob body type

PostPosted: Tue Sep 01, 2009 7:01 pm
by Etaew

Re: Mob body type

PostPosted: Tue Sep 01, 2009 7:16 pm
by Kakuri
Thanks for the link, Etaew - good discussion indeed. I would agree with the point made about needing two separate properties for a mob - one for pet charms, and a separate one for resists. I think it would also be nice to throw in the mob's damage type, as I listed above, but I'm not sure if it would be better to give this precedence over the MeleeDamageType field that mobs already have.
the resists given by the equipment - let's suppose a mob wearing an armor can benefits the bonus/malus in resists/vulnerabilities.
Is this actually implemented, or planned to be? My experience looking through the code indicates that mobs don't actually wear items - just the model. But I may have missed something.

Luhz, I would tend to agree with your approach for strictly live-like behavior. I was coming at the issue from my own perspective running a custom server - a database table allows the definition of arbitrary body types and allows them to be assigned to any mob, regardless of the model ID.

On my server I have elemental mobs, which do damage of a certain type, have high resists to most damage types, and high vulnerability to one damage type. They're implemented as a separate class, so for each mob instead of creating a GameNPC I have to create a BodyElemental, ColdElemental, etc. It occurred to me that a more flexible system would be to use tables, and perhaps this would be a wanted feature in DOL.

Re: Mob body type

PostPosted: Tue Sep 01, 2009 7:19 pm
by Tolakram
Some mobs can wear items and look normal with them. Some can only wear certain items while others either don't show up or show up with crazy mis-drawn positions, and some all items are invisible.

I had a routine on my old server that added random items to mobs, hoping they would simply not show up if the mob didn't support it. Unfortunately I was wrong.

Re: Mob body type

PostPosted: Tue Sep 01, 2009 8:15 pm
by Graveen
Is this actually implemented, or planned to be? My experience looking through the code indicates that mobs don't actually wear items - just the model. But I may have missed something.
No it is not implemented
I can give you an example: in frontiers, you have the albion rebels camp. While they are all humans - humanoids (so they share the same bodytype aka class resists), the rebels armsman wearing plate have different resists than the rebel wizard wearing clothes. Iirc, as i have aggroed them many times, ( :D ) the damage chain is respected.

Another example stands in empyreans, siabras, curmudgeon, fomorians (sorry i have only hib examples as i mainly played hib). Per factions, they all share the same bodytype, but the model visibly shows us differents equipments. Minotaurs in LotM etc... Each time you have a family, we can suppose they could have differents equipments.

I think ArmorType should be added to mob & npctemplate tables, then bodytype_resists and armortype_resists should be added. I'm even pro handling players resists based in this table.

Re: Mob body type

PostPosted: Tue Sep 01, 2009 8:35 pm
by Luhz
You could just have the body field in the Mob database, but I've always considered that to be an inferior solution because it makes content creation more flexible, but more complex. Of course, you could implement BOTH and use a ModelXBody table to select a default body, which could be overridden if specified. The thing about a ModelXBody table, is that it creating it would be the hardest part, and once created you could use it to populate the default values in the Mob table anyway, so you really accomplish both.

Re: Mob body type

PostPosted: Wed Sep 02, 2009 1:18 am
by Sand
The bodytype field in the mob db, I recently set in Storms db, to be one of tghe following, humanoid, reptile, giant, dragon, insect, animal, plant, elemental, magical, demon and undead.

This is the field we need to check for charm spells mainly, but also is something used for certain item bonuses, that only apply versus certain types of these.

There is then another property we don't define at all, which is sort of a subtype of the above which I am not sure is best way to define.

The damagetype a mob does is already in mob table and I think really needs to be defined specific to mobtemplate and possibly overwritable to be specific or defined based on equipment. A good example of this is infernalists (which mythic kinda setup as a counter to neycomancers) in DF who mythic gave some blade weapons and do blade weapon styles, and some staffs and they go around doing friar styles, and thus the damage type so mobs be all same name and model but different equipment. This don't have to be defined in mob table, it can be done in npctemplate though.

Okay some issues I found when doing above, modelid was a great guide for assigning bodytypes, it is not clear cut. Undead for example, often use say a humanoid model and make it transparent. I also did some queries where according to alla, one realm's mobs of a certain bodytype was magical while another it was humanoid. Alla could be wrong, but fairly sure some models are considered different bodytypes, based on other factors. Another one is giant, you can take any model and upsize it and then consider it a giant for bodytype.

Re: Mob body type

PostPosted: Fri Sep 25, 2009 7:05 pm
by Dunnerholl
for the armor, we could use the data from equipmenttemplate and make them actually wear it - IF the armor they wear is sent to client AND this armor is used in regards of resistances. dont have any data on this sadly

Re: Mob body type

PostPosted: Sat Sep 26, 2009 1:25 pm
by Sand
Dun, see another post of Kakuri's about mob resists, that is the plan for one way of getting resists, but we also added a field to the mob and npctemplate tables that will be used to define the base resist set.

http://www.dolserver.net/viewtopic.php? ... 01#p102201