Jump to content

Recommended Posts

  • 38 years later...
Posted

I got bit pummelized on trying to fix the buggy RandomMovementGenerator by doing the database changes, so instead I just sat on the code of this class, and wrote it more or less from scratch.

What is broken: RandomMovementGenerator. Come on.

What was fixed: For each creature, the new generator builds a list of possible walk points, taking into account the map, vmap and objects (so creatures can walk on objects). Later, the waypoints are choosen randomly, and limited by LOS.

As you can see, each creature needs quite few of calculations, which can make your server crawl, especially when loading large instances. And yes it does work in instances.

Here is the patch:

http://pastebin.ca/1013607

Stil to do: Make additional table for mangos, to cache up the generated walk points, including a gm command to cleanup them for each creature ect.

Bugs:

* Currently, some objects that shouldn't be treated as non-passable, are returned from getObjectHitPos function of IVMapManager. That makes creature be able to walk on trees sometimes, when the tree leaves touches the ground. Common example: Coldridge valley.

* Sometimes, the creatures still walk through the standing objects, common example: rats in Karazhan

update: Fixed the wallwalking in few cases in instances, still not perfect but much better now.

update 2: Made creatures do not attempt wallwalking on pathes that have more than 45 degree up/down, it should fix some cases too.

Posted

It is ready to play with, but not yet to be put on server that have more than few players (speed reason).

For me it looks good enough now, I will finalize it with the cache table.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use