Jump to content

[patch] Randommovementgenerator Rewritten


Recommended Posts

  • 38 years later...

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.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • 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