PDA

View Full Version : mobs jumping in path and Z position


Rhodan
11-02-2006, 01:07 AM
Using the #grid and #wp commands to create a path results in the mobs jumping up and down a lot as they follow their route. I noticed that if I lower the Z of a waypoint, the mob stays on the ground.

My question is, should I just set every Z coord to a point I know is below the lowest point in the zone and be done with it (say -1000) or will that cause problems?

Angelox
11-02-2006, 01:49 AM
Using the #grid and #wp commands to create a path results in the mobs jumping up and down a lot as they follow their route. I noticed that if I lower the Z of a waypoint, the mob stays on the ground.

My question is, should I just set every Z coord to a point I know is below the lowest point in the zone and be done with it (say -1000) or will that cause problems?

I just make sure i set a point every time the mob goes up or down, if he goes up a hill, then i make many points , all the way up. this seems to work. But swimming is still a problem ; when they swim , they still "bounce", no matter.
Also, I've noticed sometimes lag can do this.

Angelox
11-02-2006, 01:56 AM
Heres' two docs I made for my self, with data i found and help users gave me in this forum;

type
0.Circular they go 1,2,3,4,1,2,3,4,1,2,3,4..ect..
2.Random is kind of obvious.. 1,3,1,2,4,3,1,2,4,2,3,4,1,2,3,4,2..ect..
3.Patrol they go 1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4..ect..
(1.random 10 doesnt seem to work for me)
as for pause types..

Pausetype
0: Random half. NPC pauses for half of it's pause time + random of half it's pause time.
1: Full. NPC pauses for full pause time.
2: Random. NPC pauses for random of it's pause time.

heres what i do...
#grid max <--to check highest grid id (not sure if it checks whole server or just in that zone) ill say 49 shows..
#grid add 50 3 2
select npc..
#gassign 50
#wp add 50 20 1
#wp add 50 20 2
#wp add 50 20 3
ect..

then just do a #repop and he should start movin. note it takes the server a few seconds to load all the waypoints

so #wpinfo should display all the coo


#wpinfo 0-49 - Target an NPC and use this to retrieve WP information assigned to it for waypoints 0-49.
#gassign grid_num - Target an NPC and use this to assign it's spawn2 point to grid grid_num.
#grid add/delete grid_num wandertype pausetype - Adds grid grid_num with the wandertype/pausetype as follows:

Wandertype
0: Circular. NPC will cycle waypoints in order, then head back to the first waypoint.
1: Random 10. NPC will pick a random of the nearest 10 waypoints and go to it.
2: Random. NPCwill pick a random waypoint in the grid and go to it.
3: Patrol. NPC will walk the waypoints to the end, then turn and backtrack.

Pausetype
0: Random half. NPC pauses for half of it's pause time + random of half it's pause time.
1: Full. NPC pauses for full pause time.
2: Random. NPC pauses for random of it's pause time.

or deletes grid number grid_num.

#wp add/delete grid_num pause wp_num - Adds waypoint number wp_num to grid grid_num with a pause of
pause on the location you're standing at, or deletes waypoint number wp_num in grid number grid_num
(just leave pause at 0).

To setup an NPC to a grid, simply #gassign an NPC spawned by a certain spawn2 point,
and all NPC's spawned by that point will adhere to the selected grid. An NPC assigned
to a grid will simply start wandering it after spawning.



They have served me well, hope you find use in them too

eq4me
11-02-2006, 03:04 AM
I found this in zone/features.h


//THESE ARE BROKEN RIGHT NOW:
//enable these to prevent mob hopping when they are pathing
//#define FIX_PATHING_WHEN_MOVING // expensive but accurate
//fix Z on sendto as well, if you still have hopping problems.
//#define FIX_SENDTO_Z


The actual code is in zone/waypoints.cpp in the functions Mob::CalculateNewPosition and Mob::SendTo

Maybe someone with more time and programming skill than me can have a look at this? :)

Edit: Someone can enlighten us what is broken right now? On first glance I cant find anything in the forums or wiki.

Rhodan
11-02-2006, 06:50 AM
Heres' two docs I made for my self, with data i found and help users gave me in this forum;

They have served me well, hope you find use in them too

Yep, read those and made the paths. Its the Z axis and the popping up and down of mobs that I'm asking about.

Angelox
11-02-2006, 12:00 PM
Yep, read those and made the paths. Its the Z axis and the popping up and down of mobs that I'm asking about.

Well, Like I said, I don't have that problem, at least anymore

Rhodan
11-08-2006, 03:06 AM
Now I get what you mean.

When making a path and there is an elevation change, place a waypoint at the start, another at the top, and another at the end. The mob tries to go directly between two waypoints and if the straight line between them is above the ground, the mob will "hop" with every step.

I briefly wondered why we even include a Z when the code could just find the Z of the ground itself and place the mob there; then I thought about swimming and flying...