I’m currently writing a lot of sql updates to add pathing to many of the mobs in the DB that should have waypoint data but do not and I’ve noticed something peculiar.
When I set up a mob on a waypoint_path, it does not start moving until the player gets within a certain range of it. I understand completely that this is some sort of CPU optimization to prevent the server from unnecessarily moving around a lot of mobs for no reason.
However, does anyone know what this distance is and where it is set? I would like to increase it for my testing purposes.
I searched the forums and found nothing on this particular topic. Thanks.
A mob won’t path if the grid isn’t loaded. However, if you can see the mob, then the grid is loaded and it should be moving. You can also turn grid unload off in the conf file, walk up to the mob to get get the grid loaded, and then walk away. When you come back it should still be moving since that grid will still be loaded.
Thanks! That should be enough to get me in the right direction in the code. Turning off the unload is not as important to me as altering the distance at which the load/unload occurs.
Beware the GRID monster /emoticons/default_smile.png
It has been a long time since I looked at the grid code, but IMHO the core should load all grids surrounding the current grid. We have plenty beefy boxes now that the performance hit wouldn’t matter anymore. Maybe even a conf option as to the “grid depth” from the current active grid that you want loaded.
ok, I have made code changes that will, as a test, load grids up to 4 grids away from the player when he loads into the game. So the first test is successful. Now I’ll ensure that this buffer is maintained as a player moves through a zone, and that the grids do not unload so quickly.
Sorry to necro this thread, but, I have been unable to post for a bit, so, this is my first chance to chime in…
I seem to remember some code being added long ago that allows you to specify an NPC as able to load grids with no player present, and, therefore, walk the path at all times… If I remember correctly, of course.
You should be able to set them as active worldobjects for such purposes - that would probably be better than to actually LOAD the grid and everything in it.
(As a note, transport NPCs are active worldobjects, and they’re always active, for instance)
Thanks for the necro! I am been beating my head against the wall, trying to make this work. There are a lot of nooks and crannies in this code, so it’s really helpful when someone familiar with a different nook posts a hint /emoticons/default_smile.png
So, if I make an NPC a world object and set him to active, he will continue on his path if no one is around? Is there a way to do this with a DB update (I saw nothing on the creature or template tables), or will I need to add this as an option?