Jump to content

MMaps Redux


Guest auntieMangos

Recommended Posts

How is it different from what happens now?

before my changes:

start attack

start movement

check that target is reachable

if not reachable then evade

after my changes:

check that target is reachable

if reachable, then

start attack

start movement

I'm sorry, I was wrong. There is no difference from now, if SelectVictim called when creature is attacked. This affects only MoveInLineOfSight cases and some SD2 script cases.

and I think we need this check for SPELL_EFFECT_CHARGE

Link to comment
Share on other sites

  • Replies 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Here's an updated version of that patch with implementation of SPELL_EFFECT_CHARGE path checking (will return "No path available" if target is unreachable): http://pastie.org/1388943

Thanks

But, well, ..

You are generating additional path in order to check reachability, this is very expensive.

So, if everything is OK (the common case), you generated twice as many paths.

That's one of the main reasons why this approach was abandoned in favor of lazy target evaluation. But you already know about it, since you read the posts, just like it was suggested.

What happens now, is that if you can cast charge effect, it is guaranteed, that the last point on path will be the destination. This is due to simple logic : if you can cast charge despite LoS check, you can find a path. If path generation still fails, we allow it to use shortcut.

Link to comment
Share on other sites

ok, now I understand about lazy target evaluation.

but... in case target is in unaccessible place, it is necessary to disallow players to cheat (with pets too), even if LoS check was successful

I think, double path generation only for players and pets is defensible

I'm sorry if I was wrong

UPD: http://www.youtube.com/watch?v=4XLw9bLbZnw

Link to comment
Share on other sites

DO NOT BE SORRY!

Errors, mistakes, and failures are how we all learn. None of us are better than the other. We all started learning at some time, just as lost and looking for answers.

You just keep right on working, iforgotmypassword!

You never know, maybe your mind will find an answer in a way that others cannot see. Do not become discouraged.

Listen to qsa and faramir. They both have a great deal more experience dealing with the movemaps and you should value their advice.

Let that advice guide you as you work to learn more and create better program code.

So long as someone is at least trying to learn, cut them some slack, guys. Bashing or flaming them simply because they know less than you do, or lack those "L33t |-|@x0R" skills, is a good way to lose future developers. We must all be more tolerant of each other. Sometimes, language is a barrier. Other times, it can be attributed to the fact that we're all a bit odd, in our own ways.

You've got to be a little crazy to do this, after all. :lol:

Link to comment
Share on other sites

feature request: mmap disabling by ZoneID\\AreaID

Will never happen.

We cannot deal with the consequences of disabling some tiles on map. The logic of pathfinding between tile with and one without is ill defined. As for areas : same thing, but even harder, since area detection in mangos isn't too solid.

You can always just do what caeruleaus suggested : delete tiles you don't want. You will have problems in the borders, but its upto you.

There is always the possibility of disabling it in code. ie. check if areaid is in blocked list (setting) and then don't even try to generate path, but tbh. not sure why this would be helpfull

Link to comment
Share on other sites

I didn't read the whole topic so I'm not sure if this was already written here, but...

I think I found a bug connected to this patch, more precisely in MoveChase().

If a player is being attacked by a creature and moves (backwards) very slowly (push and release S or back arrow quickly), step by step, he/she can move away from creature's attack radius and the creature won't come closer if the player won't move with longer "path" (I mean if You simply run and don't stop then it will chase You, but when move step by step then it will not do so).

If tanks has a lot of aggro, then he/she can move away from boss and stand still, not being hit by boss' autoattack.

The problem doesn't appear on clean core so I'm guessing that it's the "pathfinding" issue.

Link to comment
Share on other sites

I didn't read the whole topic so I'm not sure if this was already written here, but...

I think I found a bug connected to this patch, more precisely in MoveChase().

If a player is being attacked by a creature and moves (backwards) very slowly (push and release S or back arrow quickly), step by step, he/she can move away from creature's attack radius and the creature won't come closer if the player won't move with longer "path" (I mean if You simply run and don't stop then it will chase You, but when move step by step then it will not do so).

If tanks has a lot of aggro, then he/she can move away from boss and stand still, not being hit by boss' autoattack.

The problem doesn't appear on clean core so I'm guessing that it's the "pathfinding" issue.

Try this one :

diff --git a/src/game/PathFinder.cpp b/src/game/PathFinder.cpp
index f1bb944..edfca15 100644
--- a/src/game/PathFinder.cpp
+++ b/src/game/PathFinder.cpp
@@ -93,7 +93,11 @@ bool PathInfo::Update(const float destX, const float destY, const float destZ, b

    // this can happen only if caller did a bad job calculating the need for path update
    if (oldDestInRange && inRange(newStart, oldStart, dist, dist))
+    {
+        setEndPosition(oldDest);
+        setStartPosition(oldStart);
        return false;
+    }

    // check if destination moved - if not we can optimize something here
    // we are following old, precalculated path?

Should solve this issue. Thanks for report.

There is always the possibility of disabling it in code. ie. check if areaid is in blocked list (setting) and then don't even try to generate path, but tbh. not sure why this would be helpfull

Sure its doable, but the problem is with movement from area with mmaps enabled to one without. Path generating logic there is ill defined. We can cook something ugly, but same way you can just delete the tiles and get same results.

ok, now I understand about lazy target evaluation.

but... in case target is in unaccessible place, it is necessary to disallow players to cheat (with pets too), even if LoS check was successful

I think, double path generation only for players and pets is defensible

I'm sorry if I was wrong

UPD: http://www.youtube.com/watch?v=4XLw9bLbZnw

The reason you charge to the base of the pillar is due to GetClosePoint() returning that point. So (in this particular case) pathfinding doing the right thing, as far as it concerned.

If you'd charge a target that stands further from the edge, you'd fail LoS.

That's the reason I don't think we have to check anything. Problematic cases do exist, but they are really hard to reproduce.

On a sidenote : I appreciate you willing to learn.

Link to comment
Share on other sites

I'm testing now this on my live server with +-50 testers. The system works great, it's an excelent work, I love it :)

About stability, the patch doesn't seems to touch this, I have same uptime with/without the patch, and about resources, it also great, but with that limited number of testers, I can't give real feedback in this matter.

Only two things, first, about some bosses like Blood Queen Lana'thel, that has a phase in combat where she starts flying. In this encounters the boss get's buggued when ihe must returns to ground he enters in evade mode, because he can't found a valid path (from air to ground). May be change the InhabitType could solve this?

Other little problem appears at zones like Dalaran arena, where players start in tubes. They summon their pets in the tube and when the battle starts, owners leave the tube but pets can't find a valid path, tubes are isolated from ground.

Anyway this project is awesome. I will continue to test this and report and give feedback. If you need coords or such things just tell me. Keep up the good work.

EDIT: Testing in Ubuntu 8.04 x64, in windows compiles fine but on Linux I must add:

#include "../framework/Utilities/UnorderedMapSet.h"

in MoveMap.h

Link to comment
Share on other sites

implementation of timed evade and immediately evade if target was not in threat list

http://pastie.org/1400923

Thanks, I will check it when I have the time.

But in general, I think you don't really need all that code in ThreatContainer. You don't really care if you had path to specific target.

In addition, target (on retail) will use evade timer only if there no alternative targets. What happens in your code ( from what I can see), is if there's no path to main target, creature will wait 3 sec, then try to get to next target.

EDIT: I was not accurate : check post #469 - Toinan67 explains the exact behavior.

The only change that has to be added from what we have right now, is 26 sec timer if you attack while being unreachable.

Only two things, first, about some bosses like Blood Queen Lana'thel, that has a phase in combat where she starts flying. In this encounters the boss get's buggued when ihe must returns to ground he enters in evade mode, because he can't found a valid path (from air to ground). May be change the InhabitType could solve this?

This was already discussed - you have to have script support for kind of encounters.

You can try playing with InhabitType - maybe it help, maybe not - but it is not proper solution.

Other little problem appears at zones like Dalaran arena, where players start in tubes. They summon their pets in the tube and when the battle starts, owners leave the tube but pets can't find a valid path, tubes are isolated from ground.

Same thing, scripts. When arena starts you and your pet should be thrown by water outside of the tube. No pathfinding is involved there.

You better find some script for that arena that does just that.

EDIT: Testing in Ubuntu 8.04 x64, in windows compiles fine but on Linux I must add:

#include "../framework/Utilities/UnorderedMapSet.h"

in MoveMap.h

Thanks, I'll add it. Strangely it goes fine on FC12. Oh, well, cant hurt too much.

Link to comment
Share on other sites

Same thing, scripts. When arena starts you and your pet should be thrown by water outside of the tube. No pathfinding is involved there.

That's exactly the answer I was expecting. I'm developing that kind of scripts right now ^^, that's the reason I don't call that problems "bugs". Thanks for your answer.

Link to comment
Share on other sites

about 1 month ago I updated my branch with this patch and since then with ~200 testers RAM is getting overloaded really fast (8GB in 15minutes). When compiled w/o the branch there are no such problems.

Such problem didn't appear a few months ago with pretty old revision of the patch.

just update to newest changeset and reextract mmaps

Link to comment
Share on other sites

In addition, target (on retail) will use evade timer only if there no alternative targets.

EDIT: I was not accurate : check post #469 - Toinan67 explains the exact behavior.

The only change that has to be added from what we have right now, is 26 sec timer if you attack while being unreachable.

OK, here is an updated version of my patch: http://pastie.org/1402691

now creatures have 26 sec timer and they are not attackable if target was unreachable and while target is unreachable

Need help with stopping creature movement if evade timer enabled. StopMoving() looks kinda ugly...

EDIT: fixed timer logic, now timer starts only if getThreatList().size() < 2

Link to comment
Share on other sites

OK, here is an updated version of my patch: http://pastie.org/1402691

now creatures have 26 sec timer and they are not attackable if target was unreachable and while target is unreachable

Need help with stopping creature movement if evade timer enabled. StopMoving() looks kinda ugly...

EDIT: fixed timer logic, now timer starts only if getThreatList().size() < 2

I haven't had time to test it yet, but i have a question:

Why do you need all that code inside ThreatContainer/ThreatManager code? Why do you need to check if path was generated for every possible target?

Why using single boolean inside Creature class won't do it? All you care about, is whenever creature had valid target which then became invalid (immediately evade), or he was attacked from unreachable location - use the evade timer.

Best regards.

Link to comment
Share on other sites

Why do you need all that code inside ThreatContainer/ThreatManager code? Why do you need to check if path was generated for every possible target?

Why using single boolean inside Creature class won't do it? All you care about, is whenever creature had valid target which then became invalid (immediately evade), or he was attacked from unreachable location - use the evade timer.

It's difficult for me to explain it because of my bad English, sorry

I need that code into ThreatManager because I didn't find a better way to store information about an aggro event: that target is already in threat list or it is first time aggro (I know that it was ugly phrase)

Single boolean in Creature class can't provide this information for each target for more than one attacker at one time

Link to comment
Share on other sites

(...)they are not attackable if target was unreachable and while target is unreachable

Need help with stopping creature movement if evade timer enabled.(...)

tested this behaviour on retail last night on my trial account (also saw a couple of vids)

if the creature gets attacked when out of range and has ranged spells it will attack until it cannot attack anymore, if target gets out of range of its spells or gets out of mana/ammo, it enters evade mode inmmediately.

also if main target (say.. tank) is unreachable it will evade (at least this is boss behaviour in instances)

Link to comment
Share on other sites

I need that code into ThreatManager because I didn't find a better way to store information about an aggro event: that target is already in threat list or it is first time aggro (I know that it was ugly phrase)

Single boolean in Creature class can't provide this information for each target for more than one attacker at one time

From what I understand, you do not need this info for every target in thread list.

All you need to know, if you had ANY valid target. If you did and now you don't - just evade. If you never had valid targets (fight just started) - wait 26 sec, etc ...

So, I think single boolean in Creature will do just fine.

I may be wrong, since I haven't had time to test it yet, but it sounds logical enough.

I will "play" with those things to see the effects as soon as I have time (soon enough, hopefully).

You also don't need things like resetting variables in class destructor. Stack objects are automatically deleted anyway.

Link to comment
Share on other sites

patch rewrited

Removed changes in ThreatManager, added single boolean to Creature class

http://pastie.org/1410172

Tested, seems like no problems with single boolean. Need help with stopping creature movement (In my repo I've made this stuff with MoveIdle() and my function IsTargetReachable(), here is a demo: http://www.youtube.com/watch?v=wGeN49UPOcE ).

Link to comment
Share on other sites

patch rewrited

Removed changes in ThreatManager, added single boolean to Creature class

http://pastie.org/1410172

Tested, seems like no problems with single boolean. Need help with stopping creature movement (In my repo I've made this stuff with MoveIdle() and my function IsTargetReachable(), here is a demo: http://www.youtube.com/watch?v=wGeN49UPOcE ).

Finally got time to test it.

There's problem with this code.Pretty easy to reproduce.

Attack from unreachable place, go to reachable place - creature is still stuck, then just evades.

Another issue, is that StopMoving call - creature moves forward by jumping from time to time.

Cheers.

Link to comment
Share on other sites

There's problem with this code.Pretty easy to reproduce.

Attack from unreachable place, go to reachable place - creature is still stuck, then just evades.

Another issue, is that StopMoving call - creature moves forward by jumping from time to time.

Cheers.

I have no such problem in my core. I will check it later on MaNGOS.

And,

Need help with stopping creature movement if evade timer enabled. StopMoving() looks kinda ugly...

Current solution (with MoveIdle() and IsTargetReachable()) needs double path generation if target become reachable. I can show it, if you want.

Link to comment
Share on other sites

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