Page 1 of 1

Mob Brain

PostPosted: Fri Apr 29, 2005 6:26 pm
by alex_speed
Hi,

I've took a look on the StandarMobBrain, and I have some questions about the CheckNPCAggro, as I know, mob will check aggro only if it's not the same faction and mob won't check to attack an NPC, it's the NPC (guard, maybe other brain?) which will check if a mob is near it.

So I think it's more like this :

Mobs vs Mobs => ok if not same faction
Mobs vs NPC => nop
NPC (guard) vs Mobs => ok (but not for all npc)

Because in the game there is some npc that won't attack mob (realm guard which will only check to aggro a player, not a mob) and as I know, realm guard which walk around mobs, mobs won't attack guards

It's my opinion, maybe I'm wrong.

PostPosted: Fri Apr 29, 2005 7:42 pm
by nor
Basically question is how do we make guards and realm guards. Think that would be another brain for each type of guard.

PostPosted: Sat Apr 30, 2005 8:26 am
by Smallhorse
Yes exactly ... either that or one guard brain with different parameters/flags that can be set via parameter string or directly (like for the single npc table on Twiki)

Actually I think we need to get away from terms like Mob and NPC ... ALL living objects beside players in game are actually NPCs ... non player characters ...

We used classes like GameMob etc because we needed different behavior, but this can be done via braintypes and brainparameters now ... so I think perhaps at one point or another we won't need a GameMob class perhaps ... because GameNPC with mob-brain would do that ...

PostPosted: Sat Apr 30, 2005 9:11 am
by alex_speed
Ok but I was pointing that with the current code I've seen, npc realm 0 will check to attack mob !=0 but I think only npc !=0 will check for npc=0

Guard and Realm guard shouldn't be to hard, maybe for realm guard, just remove the npc check and for guard inside the realm, remove the player check ? But if we do that, mob that are in the frontier will aggro realms guards.
So option are :
1) remove the npc check on standardmobbrain.
1) create new brain for frontier mob.

Edit : I think about the examine message, maybe it could be integrated with mob brain ? So we can make different examine message with brain instead of the class ? And we will have only one class, GameNPC which can have different brain

PostPosted: Sat May 14, 2005 2:46 pm
by alex_speed
Another question, is it possible at the moment to switch the brain of a mob ?
I would like to create a GuardBrain, but if I can't change the mobbrain type.. ^^

PostPosted: Sat May 14, 2005 4:29 pm
by Smallhorse
Yes, the brain can be changed :) ... or rather stacked ... Noret knows more about this than me :)

PostPosted: Sat May 14, 2005 5:16 pm
by alex_speed
Ok thanks, but could you (or Noret) explain how without making a new class ?

PostPosted: Sat May 14, 2005 11:40 pm
by nor
Right now there are 2 ways;

npc.SetOwnBrain(ABrain) - sets own npc brain, has certain problems with restoring old brain if that new brain is temporary;
and
npc.AddBrain/npc.RemoveBrain - current solution for temporary brains; own brain becomes inactive while there are other brains in the list.

PostPosted: Tue Jan 31, 2006 11:57 pm
by FireBurst
What do I have to do if I want to set a mob to attack other players of my choice (realm or faction)? Guard mob

but I noticed that they attack players + mobs... how the hell can I set them to ONLY attack players and not mobs? cause not its TOTAL CHAOS and its ''gay''

PostPosted: Mon Mar 27, 2006 2:57 pm
by Batlas
I agree with SH. Creating a different brain for diff. type of mobs doesnt seem feasible.. Maybe for Dragons/Bosses but not for guards and other types of mobs that could be thought of.. setting perameters would definately be the ideal way to go about it.. Less of a resource hog imo :). Think about how many guards you would have.. And lets say for example you wanted to set animals and insects to have there own brain(For hunters to only be able to charm one or the other) and then you decide that Keep guards need there own brain as well. Now you have 1000's of mobs all pulling seperate scripts everytime they are called to do something.. I believe that would just take up memory that could be better used elsewhere. This is just speculation of course.. I might be wrong, but if I am.. Im sure one of you guys will correct me :-D

PostPosted: Tue Mar 28, 2006 5:57 am
by duff
the bew db architecture is :
DBNPC

NPCID
ClassType
Name
X
Y
Z
Heading
Region
TemplateID
NPCTypeParameters
BrainClass
BrainParams

For npc and it is linked to a npc template
DBNpcTemplate

NpcTemplateID
Name
GuildName
Model
Size
MaxSpeed
EquipmentTemplateID
MeleeDamageType
ParryChance
EvadeChance
BlockChance
LeftHandSwingChance
Spells
Styles
Gender
Race
FactionID
Realm
Level
MaximumHealth
...
BrainType
BrainParams


So here you see that mob or npc can have brain param.
for this a function parseparam has been made.
I f you hwant to have param in your brain use it in code to parse param.

Npc template brain and brain param can be override in DBNPC (for npc) and in DBMobSpawner for mob.