Jump to content

MMaps Redux


Guest auntieMangos

Recommended Posts

Anybody noticing creature's evading way too early? I pull some creature or mob, I go hug a wall or something or jump over some obstacle so the creature/mob cant reach me and then the mob/creature starts evading.

Now I dont know if this is intended behavior (is it?) but too me it looks like something is not right.

Dug into the pathfinding code and I found this.

In pathfinding "targetedmovementgenerator.h" there is a function called "isreachable" and it does this check.

return (i_path) ? (i_path->getPathType() & (PATHFIND_NORMAL)) : true;

shouldnt this be more elaborated with the other pathfind type like this?

return (i_path) ? (i_path->getPathType() & (PATHFIND_NORMAL|PATHFIND_INCOMPLETE)) : true;

I have tested this and the creature/mob is now following me more consistently - ie does not brake off chase so easily.

Just a thought....

Evade timeout for creatures is not yet implemented. At the moment creature will evade as soon as there's no full path to its target, instead of evading after timeout (while not taking damage meanwhile).

You can check where isReachable() used in code, it'll give you good point to start with.

You're 'solution' will just allow players to kill from ranged distance any creature by moving a little bit in unreachable place - creature will always generate partial path (aka : PATHFIND_INCOMPLETE).

Best regards.

Link to comment
Share on other sites

  • Replies 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Thanks for your motivating words regarding evade timeouts not being implemented. :D

Have a look at these videos showing the "issue".

NOTE: This footage is captured with the unmodified version of isReachable().

Yeah, that's exactly how it should work, only they should wait a certain time before evading.

Link to comment
Share on other sites

  • 2 weeks later...
Just a question (Since im not a Programming genious) Is mmaps running in a separate thread? I just "think so" because i got more load on core2 with mmaps, that would be great if that is so :)

- LilleCarl

No

How come noone starts developing MT? It would increase mangos performance drastically on high load right?

- LilleCarl

Link to comment
Share on other sites

Mmap code run in the contexts of its map.

While doing path calculation asynchronously may seem like a good idea at first glance, when you think about it, the result is actually blocking under current model.

If we could separate "tasks" in same update cycle of every given creature/event/whatever, that would be different story.

Ask to calculate path, do something else, get the result, send update ...

When you think about it, even this model is useless.

If you have low population server, cpu performance is never a problem.

On densely populated server, even properly splitting by higher granularity like tiles/maps will utilize all cores on full load.

I'm not even started to talk about the sync overhead.

Bottom line, I think making threading model for mmaps is useless. It is thread safe (under current granularity).

True multithreading for mangos is different story, but that's not directly related to this topic.

Link to comment
Share on other sites

Mmap code run in the contexts of its map.

While doing path calculation asynchronously may seem like a good idea at first glance, when you think about it, the result is actually blocking under current model.

If we could separate "tasks" in same update cycle of every given creature/event/whatever, that would be different story.

Ask to calculate path, do something else, get the result, send update ...

When you think about it, even this model is useless.

If you have low population server, cpu performance is never a problem.

On densely populated server, even properly splitting by higher granularity like tiles/maps will utilize all cores on full load.

I'm not even started to talk about the sync overhead.

Bottom line, I think making threading model for mmaps is useless. It is thread safe (under current granularity).

True multithreading for mangos is different story, but that's not directly related to this topic.

Yeah, it's unfortunate that people think more threads = more performance, regardless of what is actually being processed.

Link to comment
Share on other sites

Mmap code run in the contexts of its map.

While doing path calculation asynchronously may seem like a good idea at first glance, when you think about it, the result is actually blocking under current model.

If we could separate "tasks" in same update cycle of every given creature/event/whatever, that would be different story.

Ask to calculate path, do something else, get the result, send update ...

When you think about it, even this model is useless.

If you have low population server, cpu performance is never a problem.

On densely populated server, even properly splitting by higher granularity like tiles/maps will utilize all cores on full load.

I'm not even started to talk about the sync overhead.

Bottom line, I think making threading model for mmaps is useless. It is thread safe (under current granularity).

True multithreading for mangos is different story, but that's not directly related to this topic.

Yeah, it's unfortunate that people think more threads = more performance, regardless of what is actually being processed.

Well all thread safe parts could run separatley? I mean so all cores are use to full load? :S

- LilleCarl

Link to comment
Share on other sites

Ok, so let's say such multi-threading were done. How would you balance that against other processes using those cores? Many private servers use the same machine for mangosd, realmd, and database, usually with a CPU having just two cores. Besides, as qsa has said, there is the idea of diminishing returns where multi-threading a process has its own overhead which can create less efficiency in code execution and resources used.

Without MaNGOS itself being multi-threaded, you're placing an unneeded burden on the mmaps developers to create this code that should be handled by the mangos core instead.

Link to comment
Share on other sites

...

Well all thread safe parts could run separatley? I mean so all cores are use to full load? :S

- LilleCarl

Sure they can, but their results are interdependent.

You cannot eat your breakfast before you woke up (as silly example).

There's order in which (some) calculation has to be made.

Besides, as I said above, for full cpu load, even instance based granularity will do.

Link to comment
Share on other sites

...

Well all thread safe parts could run separatley? I mean so all cores are use to full load? :S

- LilleCarl

Sure they can, but their results are interdependent.

You cannot eat your breakfast before you woke up (as silly example).

There's order in which (some) calculation has to be made.

Besides, as I said above, for full cpu load, even instance based granularity will do.

Thank you for explaining very well:€ Now i "got" this:)

- LilleCarl

Link to comment
Share on other sites

Yes, if you perform mmaps calculations asynchroniously... well, what happens to the creature that is supposed to be walking on the mmaps path? Does it just stand around for a while until it's path finished generating? Not to mention its AI code depends on knowing if a path is possible before it knows how to react to players, and mmaps is such a small amount of calculations that it wouldn't be worth the context switches needed to run it separately. It makes more sense if you just wait until the calculation is done before proceeding.

There are instances where more threads would make more sense, like running map updates on separate threads, but this isn't one of them.

Link to comment
Share on other sites

Negativ Feedback:

Big Problem with fear: players are falling under map or go through walls (you can test it in tunnel in warsong)

Sometimes no movement if player is in fear.

Sometimes no movement of npc(often robots in near of xt002 ulduar)

BUT: I have more positiv effects, therefor I use mmap. I have no lags, but not much players too

Link to comment
Share on other sites

Negativ Feedback:

Big Problem with fear: players are falling under map or go through walls (you can test it in tunnel in warsong)

Sometimes no movement if player is in fear.

don't check on "clean core". mangos has at least 2 errors (one sience ~200 commits) with detect ground/water pozitions -> need some corrects.

Link to comment
Share on other sites

Negativ Feedback:

Big Problem with fear: players are falling under map or go through walls (you can test it in tunnel in warsong)

Sometimes no movement if player is in fear.

Are you sure you have mmaps extracted fro BG maps?

Tested in WSG tunnels - works like a charm - with small modification tho, on git now.

....

don't check on "clean core". mangos has at least 2 errors (one sience ~200 commits) with detect ground/water pozitions -> need some corrects.

What exactly are you talking about?

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