* Core/Metric: Log detailed metrics about each opcode handler
* Add new panel to Performance profiling dashboard and use fill(0) instead of fill(none)
* Add new settings Metric.Threshold.* to be able to specify the minimum threshold for the specified metrics
* Update dashboard
* Change thresholds to be required to send the metrics. A TC_METRIC_DETAILED_TIMER metric with an expected threshold not configured will be ignored
* Use typedef Milliseconds
* Refresh realms on load
(cherry picked from commit 8a2c79c850199a73fd431d04f83d6aa89733060d)
* Core/Metric: Add new cmake option WITH_DETAILED_METRICS to enable more metrics
Add more detailed metrics in World::UpdateSessions().
* Attempt using C++17 features
* Fix cmake typo
Co-authored-by: NoName <[email protected]>
* Fix build with WITHOUT_METRICS
* Update Performance profiling dashboard with Update sessions panel
* Add panel to show sessions with update time above 100 ms
* Move legends on the right and add max update time diff in the legend of sessions
Co-authored-by: NoName <[email protected]>
(cherry picked from commit 36ef487a90d0d14c4da8ce7e19b5916b8b15056c)
* Core/Metric: Add more metrics about World::Update() loop
* Add new Performance profiling grafana dashboard
* Add new cmake setting WITHOUT_METRICS that disables all metrics
As new metrics are added, someone might want to disable them if unused.
* Add more metrics about World::Update() loop
* Remove old performance profiling features
Remove "server set difftime" command, "-RecordUpdateTimeDiffInterval" and "MinRecordUpdateTimeDiff" worldserver config settings and their related code.
The whole UpdateTime class could be removed too.
* Update and rename 2020_07_99_99_world.sql to 2020_07_24_00_world.sql
(cherry picked from commit 3c0ac7302f902d1811d2c215217a3d701f8b5b19)
* Core/Combat: Disable triggers entering combat
* Move check to database flags_extra flag in creature_template with value 0x00002000
* Fix Rotface puddle stalker too
* Rename 9999_99_99_99_world.sql to 2020_07_22_00_world.sql
(cherry picked from commit 6440c3bcac85a40de5c34aef1d8a8856966cc140)
* Core/Threads: Replace Boost TLS with C++11 one
Replace boost::thread_specific_ptr<T> thread-local storage with C++11 thread_local to remove libboost_thread dependency from common project
* Fix no-pch build
(cherry picked from commit 00b16992f1ae3bf14ab5fe6366028a2b8648bfa0)
* Core/Metric: Log Map::Update() times
* Add more performant version to reduce allocations when metrics are disabled
* Linux build fix
* Add metric stopwatch version that doesnt let users forget to _END it
* Fix linux build
* Code cleanup
* Add Map updates panel to General dashboard
* Add "Recent events" panel to General dashboard
* Apply latest codestyle changes
Co-authored-by: Shauren <[email protected]>
(cherry picked from commit 5eb742ee6a892b684b0c4cbde9f02f838b8300e5)
* Core/Pools: Attempt to workaround pools being broken since 2015
Attempt n°2
* Fix warning
(cherry picked from commit 8c0a315734840f99455026ef443a21ae73d7bc3b)
* Core/Spells: implement corpse target type support and properly fix resurrections
(cherry picked from commit df193945d9aff8596985a20e2c654105354b0af7)
* Core/Spells: implement TARGET_CORPSE_SRC_AREA_RAID and updated remaining resurrection effect handlers for updated corpse targeting
(cherry picked from commit 98b075cb4b0da126d409ab42daa63a1f531a70ea)
* Fix no-pch
Co-authored-by: Ovahlord <[email protected]>
(cherry picked from commit cc71da35b5dc74abf71f8691161525a23d870bb5)
* Shared/Metric: Allow to specify tags in metrics
* Core/Metric: Log number of Creatures and GameObject per map
* Apply feedback
* Codestyle changes
* Codestyle changes
* Remove whitespace
* Update Grafana dashboards to v7.0.3
* Fix missing filter on realm
* Include Creatures and Gameobjects in Maps dashboard
* Show instances with a different color
(cherry picked from commit 4e1dbd1cf808c9cf1f310b6d498f7e304dfb4147)
Add .debug objectcount <optional map id> chat command to show the number of Creatures and GameObjects
(cherry picked from commit cd37a17103b88a56ec1fde2156c4325b74989e08)
* Tools/MMAPs: Show an error when running mmaps_generator built in Debug mode
* Fix GCC build
(cherry picked from commit 8c80f28581646af110c4d2b316209ef291a95587)
Reduce chances of breaking tile connections caused by floating point rounding issues.
(cherry picked from commit e615e2ddefd2c18b6dec8e08fb3d17580b64ea99)
* Build/Misc: Add a few *San CMake flags
Add the following flags for the related tools:
- MSAN for Memory Sanitizer
- UBSAN for Undefined Behavior Sanitizer
- TSAN for Thread Sanitizer
* Remove unused parameter
* Fix UBSan reported issue
* Disable G3D buffer pools when using Thread Sanitizer as it has its custom locking mechanisms
* Code cleanup
* Move threads from maps to tiles
* Move tile building logic to TileBuilder class
* Fix memory leak in TileBuilder
* Fix build
* Store TileBuilder as raw pointer for now, it will be changed later on to use modern C++ constructs
* Fix crash on shutdown
* Revert pvs-studio change
* Fix generating 1 single tile not closing the program
(cherry picked from commit a4e93d779c9638bc0a61cb4405ef28cb935d1065)
Re-generating MMAPs IS required.
Partially reverts 995a443da219ec773febd7dd29d18f3cefaa1f3b .
Having 2 different slope angles of 55° and 85° created too many polygons to fit in the current mmtile structure. This caused some polygons to become disconnected from each other, creating the old "invisible walls" effect. Because of this and because of the performance hit when loading a mmtile caused by the increase of polygon numbers, this commit reverts the recent changes and sets by default the slope angle to 55°.
Feel free to restore the previous behaviour by running .\mmaps_generator --maxAngle 85 --maxAngleNotSteep 55 , specifying the map id as number if a single map should have different slope values.
This is the last commit that will change MMAPs version to force re-generating them. Any future change that will affect only the generation settings will be optional (but recommended).
(cherry picked from commit 3947e4cb57d4c6adb78cd3cb52718bb88add91fc)
* Some research about mmaps load performances
* Tools/MMapsGenerator: Add some more input parameters
Add some more input parameters which affect the resulting mmaps:
- --smallOutputSize: sets both walkableSlopeAngle and walkableSlopeAngleNotSteep to 55°, reducing by a lot the .mmtile size and the number of polys. A rcFilterLedgeSpans() call is included too to filter out some polys. Default to false.
- --maxAngle: Restore this parameter removed some commits ago. Specifies the max walkable angle of a Creature when in combat. Default to 85
- --maxAngleNotSteep: Max walkable angle of a Player and of a Creature out of combat. Must be less or equal than --maxAngle. Default to 55.
A performance profiling comparison highlighted that .mmtile load grows exponential with the number of polys. A small server with GridUnload enabled and without preloading all grids on startup will be more affected than a big server with GridUnload disabled and preloading grids on startup.
(cherry picked from commit b6e205f7ef32f7b82644043d82a808e67cc9acb2)
* Tools/MMAPs: Remove input argument --maxAngle
Remove input argument --maxAngle . This should be just hardcoded in MapBuilder::GetMapSpecificConfig() so all settings are easily found in the same place instead of being spread around.
* Tools/MMAPs: Add new area type NAV_AREA_GROUND_STEEP
Add new area type NAV_AREA_GROUND_STEEP for ground with slope in the range (55, 70] .
NAV_AREA_GROUND is used for ground with range [0, 55] .
NAV_AREA_GROUND_STEEP takes priority over NAV_AREA_GROUND.
* Tools/MMAPs: Fix NAV_GROUND_STEEP flag not being saved in the mmtile
* Core/PathFinding: Implement NAV_GROUND_STEEP flag
Implement NAV_GROUND_STEEP flag, used only by Creatures that are in combat or evading.
* Distinguish between RC_WALKABLE_AREA and NAV_AREA_GROUND.
* Allow mobs in combat to walk on steeps up to 80°
* Allow mobs in combat to walk on steeps up to 85°.
Disable rcFilterLedgeSpans() filter as it removed long steep spans.
* Increase cost of steep spans to try making creatures walk around obstacles instead of walking on them
* Revert last commit
(cherry picked from commit 995a443da219ec773febd7dd29d18f3cefaa1f3b)
* Core/Auras: Attempt to fix infinite loop with aura 18950 on map unload
* Core/Auras: Log a detailed error and assert when failing to remove all auras after a few tries
* Code cleanup
* Fix build warnings
* Fix more build warnings
(cherry picked from commit bd2d60c2676a1d7e843a2a5673b8216bad0768c7)
* Core/MMAPs: Adjust walkable climb
Adjust walkable climb as recast using walkableClimb also to find the poly from a position, giving priority to polys that are below the position but closer than walkableClimb.
* Temporarily disable static collision (the whole check should be removed)
* Core/Spells: removed deprecated mmap path check for TARGET_DEST_CASTER_FRONT_LEAP
* Core/Objects: allow flying units to use the helper as well (flying units casting radius based spells)
* Code refactor
* Handle raycasts that end in a point with no height in the mmap mesh as PATHFIND_NOPATH
* Walk back a bit from raycast hitpoints as sometime the 2D result point is outside of the polygons due to floating point errors.
* Remove whitespace
* Revert 4a197ba22a as a raycast point path should have the Z retrieved with getPolyHeight(). Raycast will only return a 2-point path with Start and Hitpoint/End
* Cleanup PathGenerator raycast case
* Fix PathGenerator raycast broken if start and end are on same poly.
Fix PathGenerator raycast broken if no wall is hit.
Remove unused case of using raycast with an existing previous path (can be added back properly if needed).
Remove forcing poly length to 2 when we actually have already the right number.
* Use closestPointOnPolyBoundary on the second try of finding a point on poly for raycast.
Note that in this case the mesh height is not used which might cause issues. The poly boundary height will be used instead.
* Handle cases where getPolyHeight() fails because the point is on polygon border (and caused by floating point imprecision)
* Add far from poly flags
* Set PATHFIND_INCOMPLETE in raycast case if startFarFromPoly or endFarFromPoly
* Fix blink close to walls with no valid polygon behind the wall
* Require to re-extract mmaps
Co-authored-by: Ovah <[email protected]>
(cherry picked from commit c0b75bf40da8b447a2f3533dabbfad9eba7c6ea1)
* Core/Pooling: Remove respawn times from the database when despawning a pool
Remove respawn times from the database when despawning a pool. This is needed when a Game Event ends but there are still some respawn times saved in the database.
* Remove respawn time of active pool objects even if they are not spawned
(cherry picked from commit 4f33fd3932d362466ee017111895bf14fcc79c88)
* Core/SAI: Allow SMART_TARGET_ACTION_INVOKER to target GameObjects
* Include new Coalesce(..) template by @Shauren
(cherry picked from commit 90b00288c24dfefccb338bd33b025cf85e82076d)
ObjectGuid::GetCounter() should not be called in logs, use ObjectGuid::ToString().c_str() instead
(cherry picked from commit af1260c40e333e0d2d506128099f8263f5f2304f)
Don't start a spline with just 1 point in FlightPathMovementGenerator. This happens when teleporting to a BG while on a taxi after second last node but closer to last node.
In this case the Player will be teleported to the last node.
(cherry picked from commit ec495764918506193a51f00247adb432b1ba6646)
Improve log when starting a spline with invalid arguments, for example when starting a spline with just 1 point.
(cherry picked from commit 296f6aab402407a2798f3a300b256cc75d59fec4)
* Core/AI: Make critters flee as soon as engaged in combat and make them evade after they stop running in fear
* Warning and no-pch build fix
(cherry picked from commit 6fde051e4e52d98d1a6cf31b8ad3fcf95e0e83fd)
Add a new ABORT_MSG macro that allows to show a formatted message before stopping the executable
(cherry picked from commit 0ddee8a4a03fb5c7ee8d18144ca21cd2baad6f01)
Stop combat when a Player moves to a Sanctuary area only if there is any PvP combat (it would be nice to keep PvE combat but that's still an issue)
(cherry picked from commit c7974bdf909ceb34821fa3953ef4cb090282fcdf)
* Core/Objects: MovePositonToFirstCollision will now use detour raycasts to determine terrain obstacles
* Added missing includes
* Update Object.cpp
Co-authored-by: Giacomo Pozzoni <[email protected]>
(cherry picked from commit d1080af8db63c78986a7fcc94fcfb2fdfe817734)
Update Z coordinate of end position when casting a mmap raycast that doesn't hit the target
(cherry picked from commit 16ccc17621313e5c954f26ad23b15392fe06e763)
Make creatures evade when a charming expires and they cannot attack the charmer (i.e. charmer with .gm on)
(cherry picked from commit 69809d12031d055d8d0cffb5a187d9af09dd0efe)
* Core/AI: Allow creatures to evade
Revert changes that didn't allow creatures to evade anymore no matter how hard a script would try
* PArtially revert 163f44c1b08cc043b114585922bd08664434bf92
(cherry picked from commit 817ae5bca6db14c9b3db7d5268511525e0cb4105)
* Core/AI: Make charmed creatures follow their owner
* Follow the charmer only when applying the charm
* Make SmartAI follow the charmer
(cherry picked from commit ddf2f60c1317f0ce728d5894064f51251cf71c72)
Increase the agent height by x2 to reduce the chance of having underground mmap layers wrongly picked by recast.
(cherry picked from commit 3b0a89a2ea76157156c03262bc86f024a1d4ca57)
GenericMovementGenerator sets the _duration to the return value of spline.Launch(). For cyclic splines, this is the duration of 1 single cycle, while the spline itself never ends.
To support this edge case in GenericMovementGenerator we just never update the _duration timer for cyclic splines.
(cherry picked from commit 7a57029d8fd46c0966eb32b17019291785e61f37)
* Build: Enable and require c++17
* Build: Raise Visual Studio version from 2017 15.2 to 2017 15.9
* Build: Raise GCC version from 6.3.0 to 7.1.0
* Reduce branch differences
* Fix build after latest merge
* Cleanup after latest merge
(cherry picked from commit 726d5e91b55d4742dcbd6b0a82d84788dbb117b7)
Fix WaypointMovementGenerator ignoring EscortAI::SetEscortPaused() when talking to a NPC, scheduling a 3 minutes pause on the WaypointMovementGenerator even if it was already disabled with no timer, waiting for the player to select a gossip entry to resume the movement.
(cherry picked from commit a9e534762f2517a37d595cdfef527ab55b6339ba)
* Core/PathGenerator: Fix path generator returning shortcuts when start and end are on the same polygon
Second try of handling paths on same poly in a better way than just building a shortcut
* Fix movement generators using paths with start/end positions far from mmap polygons
* Include flag PATHFIND_FARFROMPOLY even with a normal path if start or end were far away from mmap poly
(cherry picked from commit 67d9d04d63cc74196059646b2e57f50a4a4fd2ca)
Temporarily revert 29bf280e3496cf13c24ccb20e37da29d3bfa74d9 since our recast implementation always expects a path to have different polygons.
A proper fix will be implemented later on, splitting a path with 1 single polygons in smaller steps in a similar way of how FindSmoothPath() works
(cherry picked from commit 9f8477cd112bf0f52e23afc9cdee4adfcf540de5)
Fix Ominous Clouds being only clockwise, now they move both clock and counter-clock wise.
Add a workaround for GenericMovementGenerator not handling correctly cyclic splines started by MoveCirclePath(), stopping the movement after a single round. The workaround code can be removed once the bug in GenericMovementGenerator is fixed.
(cherry picked from commit c1df161e1ddf95584030480d3dcb15149aacd7a6)