Page 1 of 1

solution to mobs not attacking problem

PostPosted: Mon Mar 22, 2004 6:55 am
by nor
GameNPC.cs
function FollowTimerCallback
Code: Select all
//Subtract the offset from the target's position to get
//our target position
uint newX = (uint)(followTarget.X-diffx);
uint newY = (uint)(followTarget.Y-diffy);
WalkTo(newX,newY,0,MaxSpeed);
return FOLLOWCHECKTICKS;
}
If mob is already standing on (newX, newY) location, WalkTo() cause it to face wrong direction (zero) what cause Target to be not in view. Adding

TurnTo(followTarget);

after WalkTo() fixes the problem but it shouldn't have reached that point. (it is commented out earlier)

PostPosted: Mon Mar 22, 2004 10:48 am
by Smallhorse
Well then it is better to check if mob is on newx,newy and if it is, then call turnto ... and if it is not ... then call walkto normally ...

PostPosted: Mon Mar 22, 2004 10:26 pm
by nor
Well to player mobs always look like they are facing to him, no matter where and how they move.

Think there should be no "player not in view" for melee mobs, it only makes more problems like this (and you have to calculate 90degree arc for every swing for every mob) and mobs supposed to be dumb and angry. Should be LOS check for casting mob tho.

PostPosted: Thu Mar 25, 2004 5:41 am
by nor
It works fine with latest CVS but i still don't like how mobs move. It should be almost like /stick:
- if player is out of attack range, mob moves closer;
- if player is in attack range (e.g. 300), mob just /face player and not moving;
- if player is too close (e.g. 50), mob moves away (think it's supposed to simulate pushing mob back).

Mob shouldn't move if player is inside of 50 to 300 range.

PostPosted: Thu Mar 25, 2004 9:54 am
by Smallhorse
I am not sure that is the way it works on the live servers currently. The mobs may stay at the spot when they are in attack range, but I don't remember being able to push any mob backwards, or them moving away from me after attacking ... that would definitly be an issue since you could push mobs back over cliffs or chasms or whatever you like... and on live servers this is certainly not possible, actually you can walk right into the mob during fighting.

PostPosted: Thu Mar 25, 2004 12:03 pm
by Blue
I think the client is doing that pushback, when we send CombatAnimation

PostPosted: Thu Mar 25, 2004 3:05 pm
by nor
If you move slowly, in small steps, closer to mob it will move backwards.

Running through mobs was always making problems. If i run through then /face, i get "mob not in view" message on first combat round even though it's in front of me. Then, after some time, it teleports somewhere and becomes clear why i was getting that message.

It is especially annoying with huge mobs. In all good dragon-killing guides you will find a line saying "don't /stick dragon, use /face instead!" and it looks real to me - you can't stand inside of objects.

There is a "Size" in Mob.xml which probably can be used for this but it fluctuates a bit even on same mobs so i'm not sure.

Also when i'm running from mob - it changes position every tick (no smooth moving but looks great between ticks).