Jump to content

[fix] Creature Movement Speed


Recommended Posts

Hey guys :-)


In Unit::UpdateSpeed currently the creatures base movement speed (stored in the creature template) is not added as a speed modifier.

Example: Cast Wing Clip (2974) on a quite fast mob (let's say 2.0 speed). The new speed the mob will have is not 50% of the 2.0 speed but 50% of 1.0 speed. Additionally the mob won't get back its originally speed after respawn...

Sollution: Add the creature base speed to Unit::UpdateSpeed.

Additionally I added a fixed speed of 1.15 to summoned and hunterpets (off-like), so that they will have their own owner-independent speed (so in the current revisions the pet also slows down if the owner is slowed down...)

General speed fix: http://github.com/pasdVn/mangos/commit/3167d7d451fdc8ef9a2a68cb9244b66ae8693fb1

Only problem is now, that the pet stops sometimes when following (because off the 15% higher speed of the owner). Therefore I created another patch that implements a dynamic speed adaption for the targeted movement generator.

Dyn. speed adaption: http://github.com/pasdVn/mangos/commit/89104e9fa01fae88924a1ec673d91dad1d09d5d3

One more small additional patch, that in fact has nothing to to with the creature speed. It just makes the TMG recalculate the target koordinates instead using StopMoving(). This will make a speed change will look more smoother in the client. Problem ist that with StopMoving() we send a monstermove to the current location that is shown as a short stop in the client. Recalculating will send a monstermove to the correct target location so that there are no gaps anymore in the movement. I suggest to apply this patch, too when trying the speed adaption, because it just looks better when your pet comes close and reduces speed ;-)

speed change patch: http://github.com/pasdVn/mangos/commit/6e8e375788c612f888d2ca279ae607825430d883

Complete branch: "git fetch git://github.com/pasdVn/mangos.git move_speed"



OffTopic, Just a git related Question:

How can I avoid lines like this:

*          bool canFly()  const { return GetCreatureInfo()->InhabitType & INHABIT_AIR; }
* -        ///// TODO RENAME THIS!!!!!
* +               ///// TODO RENAME THIS!!!!!
*          bool isCanTrainingOf(Player* player, bool msg) const;

I added a new line there but removed it again. Git still notices a change there. But I didn't left there any whitspace, tabulators or anything else so it should be as before :-(

Link to comment
Share on other sites

sorry for offtopic and a bit complicated looking resolution for your git problem

if your change is already commited, make it possible that you can add your changes to the staging area again (git rebase -i <edit commit> git reset HEAD^ or if its the last commit, just do a git reset HEAD^)

then you can git add every change you want

if your mistake is alone in this file, without any other changes, you just can ignore this file and dont add it (git checkout -f file can revert every change in this file)

or do a git add -i file

p(atching) file

1 (to select file)


and then it shows every hunk and you can tell what hunks to add and what hunk shouldnt be added

a nice overview about what y,a,n,d,s means is in git help add

so you just add everything without this change

another faster solution is maybe just remove your wrong whitespaces, it seems that you indented this line a bit more..

btw: learning how to use rebase -i and add -i is also usefull if you like to play with git, it's a nice feature to split bigger patches (and i actually doing this, thats why i can tell something about it (: )

but please be aware, that rebase is a dangerous tool and you easily can break something with it..

Link to comment
Share on other sites

rebase is a dangerous tool and you easily can break something with it..
Offtopic: So what if you break something ? That's one of the great things about git, once you've committed something you're free to experiment with all sorts commands because even if you break something, you can always get it back with either reflog or branches. Only git gc and related plumbing commands can actually delete commits.
Link to comment
Share on other sites

Ahh, I already new about rebase, but the patch option in the interactive menu of git add was what I was looking for :-)

Anyway I found out what was wrong: In the code all indentations are done by normal whitespaces (or at least they are saved as normal whitespaces). I normally use tab to indent a line... Git interpreted those to methods different and therefore added those line to the diff.

Updated first post with a good looking diff. And now back to topic^^


not sure, but as far as i remember on off its like ur pet turns to walk while it's close enough to owner (like 10 yards)

That's what I mean ;-)

Link to comment
Share on other sites

  • 4 weeks later...

does this path fix problem with creatures with waypoints?

I mean - on mango that look's like creature stops in every wp and start moving again to reach next one ... i know that is like ~0.2sec...but on offi u can't see the same gaps betwen those wp's(creature walk's/run all the time).

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 2 months later...
  • 2 months later...

Yes, I also noticed that this system is not 100% offi like, when I had the possibility to check that.

But I did not really get a logic out of that. The pet is definitive faster than it's owner whe it's out of combat and to far away. Seemed to me, that this speed could be even faster than the max possible pet movement speed and that this is also the case, when the pet is in combat (maybe maxspeed does not matter if the pet follows it's master!?). Don't know. I have too less information about that :-/

Link to comment
Share on other sites

  • 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