Jump to content

[11917] Movemaps


Auntie Mangos

Recommended Posts

Hi everybody !

I have some problems with some mmaps, or maybe with some holes in them !

In deatholme and An'owyn, I can't go where I want, some places are blocked by invisible walls... but some of my friends don't have this problem on my server 8(

Concrete example : Apothecary Enith, I can't go in the underground...

D'you have an idea about that ?

Thanks.

Link to comment
Share on other sites

Amazing, last time I had tried mmaps it wouldn't compile for me, but all is working well.

Only thing I noticed is that it does not appear to log when the mmaps folder is not found when starting the server, not a big issue but did cause me some headache since i don't actually store my data files in the same location as mangos and i use symlinks so i don't need duplicate copies of data files for mangos backups/alternate versions (felt pretty silly once i remembered i forgot to symlink the mmaps folder)

Link to comment
Share on other sites

@Faramir or Qsa, or anyone else can help.

Hi

Thank you Faramir for your link http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.13 Iam trying to understaind it.

There is some other point iam trying to understaind. Ex: why we can't use GetMotionMaster()->operator->()->IsReachable() in CreatureEventAI class? Or add method like bool IsReacheable() { return top() ? top()->IsReachable() : false; } to MotionMaster is not possible?

Olso what do you think about caching system of path? In TargetedMovementGeneratorMedium::_setTargetLocation() add table of i_path for all generated target and check if one exist before calculate it. All path generated will have like 500 ms of life and automitacaly be deleted after.

Link to comment
Share on other sites

About IsReachable: Need to check it.

The thing with IsReachable() is bit different, it will work only after path is calculated, that's why it ain't exported via public API.

Thanks for your answear.

Is this mean i cannot check if there is path juste after something like

m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
if (!m_creature->GetMotionMaster()->IsReacheable())
{ // Do something }

Because MoveChase is threaded?

Link to comment
Share on other sites

...

Thanks for your answear.

Is this mean i cannot check if there is path juste after something like

m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
if (!m_creature->GetMotionMaster()->IsReacheable())
{ // Do something }

Because MoveChase is threaded?

Actually it will work since MoveChase will call Mutate() on MotionMaster, which in tern will Initialize() new generator;

If this generator calculates pathfinding inside Initialize; its safe to use, otherwise, you will get default value; true.

Actually, when I think about it, only TargetedMovementGenerator (and all its derivatives) return the actual value.

Of course you have to also add wrapper inside GetMotionMaster for IsReacheable().

Just to clear things out about threading: all pathfinding calculation reside in same thread as the map instance they run over.

Link to comment
Share on other sites

During development, only MovementGenerators needed access to the path. Now things are different, with MoveSplineInit using path also and other development trying to take advantage of pathfinding (and also trying to reduce performance impact with caching or reuse of existing path).

Maybe it makes more sense now to have the path as a member of Unit, and let all of these other things access it?

Link to comment
Share on other sites

It make sense Faramir. For caching purpose, here is my point of view.

ThreatManager of one creature need to know every update what Unit is reacheable or not. By spell or melee.

It's not acceptable to make PathFinding every update. This will take too much cpu.

What choice we have?

- Verify if Unit (victim) have moved enought from the last PathFinding before calculate new one.

- Keep any result of PathFinding from creature to any victim in a tab for determined time. Creature can not be realy to far from their last point after 500ms.

- Combine two above point?

Important for pathfinding is to know if path is created completly to access victim for Spell or Melee.

Kind of test like actual unit method CanReachWithMeleeAttack() and add CanReachWithSpellAttack().

Link to comment
Share on other sites

During development, only MovementGenerators needed access to the path. Now things are different, with MoveSplineInit using path also and other development trying to take advantage of pathfinding (and also trying to reduce performance impact with caching or reuse of existing path).

Maybe it makes more sense now to have the path as a member of Unit, and let all of these other things access it?

I think we need to distinguish between two different things:

1) Having indication if current target is accessible from Unit class.

2) Checking reachability to any point on demand.

First: can be easily done, by adding wrapper to IsReachable(), if we have target, the path calculated/updated every cycle anyway; just need to make sure we check after it is done.

Second: Code other than movement do not need the actual path, all it needs is reachability indication, calculating it is much, much cheaper. We can add function just for that; but need to make sure it is really needed.

@cyberium : this should also answer your question. About incremental updates, etc: already done by PathFinder

Link to comment
Share on other sites

Yes i talk for the second point.

This point is important for the choice of new target.

Must be done as fast as possible.

Here is my plan, current victim reachability will be tested by GetMotionMaster()->IsReacheable(spell/melee).

If not reacheable second way will be used to find new target without create his path (this will be done in other part of the code (StartAttack))

Link to comment
Share on other sites

Movemaps finally made it into the core? :o

Thank you for this, MaNGOS team! And a big congratulations to faramir, qsa, and all the others who have contributed to the development! You guys have given MaNGOS one of the most useful additions since vmaps. All that hard work will be rewarded by the thousands of hours of game play made even more fun by the addition of Movemaps.

Though you can never be thanked enough, and many will neglect to do so, the added joy of having an ever better server will stand as a monument to your efforts. This emphasizes the point, once more, as to why MaNGOS is the gold standard everyone else imitates. I wish we had ten more devs like you.

Thank you, again, most sincerely. :)

Link to comment
Share on other sites

Movemaps finally made it into the core? :o

Thank you for this, MaNGOS team! And a big congratulations to faramir, qsa, and all the others who have contributed to the development! You guys have given MaNGOS one of the most useful additions since vmaps. All that hard work will be rewarded by the thousands of hours of game play made even more fun by the addition of Movemaps.

Though you can never be thanked enough, and many will neglect to do so, the added joy of having an ever better server will stand as a monument to your efforts. This emphasizes the point, once more, as to why MaNGOS is the gold standard everyone else imitates. I wish we had ten more devs like you.

Thank you, again, most sincerely. :)

It's nice to see a post like this once in awhile :D

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