mob/enemies/proc/FightingAI(mob/player/M as mob)
while(src.arm > 0)
for(M in view(8))
if(get_dist(M,src)==1)
src.NPCAttack(M)
else if(get_dist(M,src)<=8)
step_towards(src,M)
else
step_rand(src)
sleep(1)
sleep(1)
How do I stop that? The character is jumpy and doesn't move smoothly towards me. What could be the cause of this?
|
Jul 18 2012, 5:42 pm
|
|
Possibly the two sleeps remove one.
|
When using BYOND pixel movement mob movement always looks jittery because it auto disables gliding.
|
I honestly have no idea, I would suggest maybe switching to FA's pixel movement.
|
Smoothness comes from a smaller step size combined with a high frame rate. Forum_account's library runs games at 40FPS with a maximum speed of 5, I think, incorporating acceleration to smooth things out even more. Even though it takes more CPU to move a mob 16 times with a step_size of 2 to move a tile, it looks much better than moving a mob moving 8 pixels 4 times, from standing still. However, over a bad network connection, they look pretty similar anyway.
|