Page 1 of 2

a few problems with standardmobbrain

PostPosted: Sun Mar 05, 2017 7:19 pm
by ontheDOL
a few problems i see with the brain which have big impact is how easy it is to exploit a mob at their maxdistance.

doing tests, you can pull mob to what his maxdistance range is. On next think cycle, he will see he is max distance from spawn and turn around to go home. Then you can attack him again, he turn to chase you. then next think cycle he see he is max distance from spawn and turn around to go home.
So you can sit there( easy as caster) and nuke/kill the mob as he comes back and forth confused.

Tether range also appears to do nothing. Mob will always chase you to what his max distance is. tether set to 1000, max distance 3000, mob chase you to 3000. Even if you sprint after first hit, and mob is out of attack range. this is the code
Code: Select all
if (Body.IsOutOfTetherRange && !Body.InCombat) { Body.WalkToSpawn(); return; }
Something is wrong here in Body.InCombat, where mob will always think its in combat even if its last attack on you was 20seconds ago.

I think a mobs MaxDistance should be, the max distance it will chase you on that attack cycle. For example, mob max range is 2000, you attack/aggro mob, it will chase you for 2000 units before giving up, if you reaggro mob on his way home, he will chase you for another 2000 before deciding to go home. I remember this was similar to how it was on Live servers.
Epic mobs can ofcourse just override this too prevent kiting them somewhere.

anyway just some thoughts. I will be trying to modify this a bit to make it more desirable, instead of killing mobs without risk of death :)

Re: a few problems with standardmobbrain

PostPosted: Sun Mar 05, 2017 8:29 pm
by PlanarChaosRvrtwo
If you remove range from the mobs they work like its meant to be

Re: a few problems with standardmobbrain

PostPosted: Sun Mar 05, 2017 8:32 pm
by ontheDOL
range as in maxdistance? if mob has 0 as maxdistance, he will chase you forever and not turn around, that is not livelike

Re: a few problems with standardmobbrain

PostPosted: Sun Mar 05, 2017 8:50 pm
by PlanarChaosRvrtwo
He only chase you forever if you dont escape his melee range and wait 20 seconds (if they not changed the code^^)
and yes meant distance not range.

Re: a few problems with standardmobbrain

PostPosted: Sun Mar 05, 2017 8:57 pm
by ontheDOL
you clearly have not tested this, test then come back and tell me im wrong :)

Re: a few problems with standardmobbrain

PostPosted: Sun Mar 05, 2017 10:00 pm
by PlanarChaosRvrtwo
i tested it but it were a few revisions before so i need retest^^

Re: a few problems with standardmobbrain

PostPosted: Sun Mar 05, 2017 10:08 pm
by ontheDOL
here is a short video i made showing the two problems
sorry for quality, filmed on phone because laptop is too slow to run capture software.

The first minute is me on Storm RvR on a lvl 1 cabby exploiting a red con puny skeleton with a maxdistance set

the rest of video is on my server, making a mob with tether set to 500, maxdistance set to 0. Show mob chasing me into oblivion without it ever hitting me for over a minute.
https://youtu.be/BdCx-fZq4iM again, sorry for quality but you can see whats happening

not sure what revision you talking about becuz i dont think SMB has been changed for years
if it was on a shard, then they probably edited the brain.

Re: a few problems with standardmobbrain

PostPosted: Sun Mar 05, 2017 11:04 pm
by PlanarChaosRvrtwo
correct tested it it dont work anymore but i gonna ask an old admin friend to share his script with me soon as i see him again if he share i upload it

Re: a few problems with standardmobbrain

PostPosted: Mon Mar 06, 2017 9:38 pm
by ontheDOL
so i did some looking and there is this code in GameNPC.cs which looks like what you were talking about, but for some reason is not working.
Code: Select all
if (this.Brain is StandardMobBrain) { StandardMobBrain brain = this.Brain as StandardMobBrain; //if the npc hasn't hit or been hit in a while, stop following and return home if (!(Brain is IControlledBrain)) { if (AttackState && brain != null && followLiving != null) { long seconds = 20 + ((brain.GetAggroAmountForLiving(followLiving) / (MaxHealth + 1)) * 100); long lastattacked = LastAttackTick; long lasthit = LastAttackedByEnemyTick; if (CurrentRegion.Time - lastattacked > seconds * 1000 && CurrentRegion.Time - lasthit > seconds * 1000) { //StopFollow(); Notify(GameNPCEvent.FollowLostTarget, this, new FollowLostTargetEventArgs(followTarget)); //brain.ClearAggroList(); this.WalkToSpawn(); return 0; } } }
I will play around with the maths here and see if it can work

Re: a few problems with standardmobbrain

PostPosted: Mon Mar 06, 2017 10:53 pm
by PlanarChaosRvrtwo
one line wonder me a bit:
long seconds = 20 + ((brain.GetAggroAmountForLiving(followLiving) / (MaxHealth + 1)) *

is it possile that the +1 is outdated?

Re: a few problems with standardmobbrain

PostPosted: Tue Mar 07, 2017 1:26 am
by ontheDOL
i think you are right something here is odd. I tried putting a flat value here ( basically it is just seconds) If i put a value under 10( i tried 5 and 9). The mob turned around after 5 seconds of not attack. after 9 seconds on the 9 test. If I put a value of 10 or more, mob will just chase you forever no matter how long out of combat.... not sure why more than 10 seconds breaks the code it seems.

Re: a few problems with standardmobbrain

PostPosted: Tue Mar 07, 2017 2:18 am
by PlanarChaosRvrtwo
If more then 10 seconds is an issue i think its couse of bugged region time:
if (CurrentRegion.Time - lastattacked > seconds * 1000 && CurrentRegion.Time - lasthit >

Re: a few problems with standardmobbrain

PostPosted: Tue Mar 07, 2017 6:31 am
by ontheDOL
it looks like it should be an easy fix , but i cant figure it out why more that 10 causes problem. pretty much the same values are called in the /quit command to get the time to quit time after combat, but no issues there.

it also seems odd to me that we have a separate timer in the code for pvp combat and pve combat. i thought that most timers, as far as using an ability (MCL for example) all use a combat timer, which is the same pvp and pve. So to me we only need one timer but i could be wrong

Re: a few problems with standardmobbrain

PostPosted: Tue Mar 07, 2017 6:35 am
by PlanarChaosRvrtwo
pve quit ld log timer is only reason reason for diffrence.
but ofc its maybe bugged region timer couse i got 21 issues on my server all based to region timer

Re: a few problems with standardmobbrain

PostPosted: Tue Mar 07, 2017 6:47 am
by ontheDOL
oh pve and pvp quit timer is different? ok i didnt know that.
Looking at the code it seems kinda confusing with these different combat timers, but im a noob so that doesnt help,

also with the tether code, removing the "!body.incombat" check sends the mob home at the set tether distance. So it does seem there is problem with combat timers and mob maybe being permanently "incombat"