PDA

View Full Version : npc movement


beric
05-16-2002, 06:57 PM
I've been playing around with the code for npc movement and position updates. Trying to get it as close to EQ live as possible so the mobs don't jump around while chasing me. Here's what I have done:

In NPC::Process(), I changed the line

"#define NPC_MOVEMENT_PER_TIC 400"
to
"int NPC_MOVEMENT_PER_TIC = GetRunSpeed();"

and changed the line
"appearance = 5;"
to
"appearance = NPC_MOVEMENT_PER_TIC+1;"

Then I inserted into mob.h
"float GetRunSpeed() { return runspeed; }"
just under "float GetSize()..."

and finally I set all mobs' runspeed to 12(seemed like a good number). In mysql typed:
use eq
update npc_types set runspeed=12;


Doing this seemed to make the mobs jump around a lot less.

In the SpawnPositionUpdate_Struct, anim_type seems to control the velocity of the mob on the client. Delta_x and delta_y don't appear to do anything. And I couldn't figure out exactly how to make the mobs do the run animation instead of the walk. The only way I could get them to look like they are running is to set their runspeed up to at least 61 which makes them way too fast.
If anyone knows what I'm doing wrong, please post.

Not sure if anybody knows or cares about any of this but figured I'd post it anyway. Just a newbie tryin to help out, or maybe get some help.:D