Commit Graph

83 Commits

Author SHA1 Message Date
jackpoz bea0e48531 Core/MMaps: Fix mobs evading when target is out of MMap meshes
Fix mobs evading when target is out of MMap meshes causes by an overzealous check added in c602220e02 when trying to fix an infinite loop in Recast.
If the target is outside of the MMap mesh (for example very close to a wall which is an un-walkable area with current TrinityCore settings and that might be changed in the future) Detour will not be able to find the height of the poly and getPolyHeight() will return DT_FAILURE | DT_INVALID_PARAM . Most of the time this is ok and can be ignored and it's still better than having the Unit evade.
Fix #23613

(cherry picked from commit 5a98022649)
2021-12-18 20:57:57 +01:00
jackpoz b4cff8159e Core/MMaps: Simplify d182e5f7e7 and handle PATHFIND_INCOMPLETE in ChaseMovementGenerator as "cannot reach the target"
(cherry picked from commit 386b5a6fd9)
2021-11-27 01:38:24 +01:00
jackpoz bf1bf510fb Core/MMaps: Fallback to shortcut for flying units if Detour returned an incomplete path.
Fallback to shortcut for flying units if Detour returned an incomplete path. This is needed when a flying unit should fly to the floor below to reach the target, but since Recastnavigation doesn't support "jumping down" the unit would not find a path to the target.

(cherry picked from commit d182e5f7e7)
2021-11-27 01:38:11 +01:00
Jeremy 4fcc4a3300 Core/Movement: Fix some undermap issues with random movement/fear/blink (#22937)
* Core/Movement:
- Only move to point if there is a path that is not a shortcut (which will make the unit move through terrain)
- Added new function to check if there is a vmap floor without search distance
- Units that can fly, are underground but far above the vmap floor will stay underground (bronze drakes in tanaris)
- Don't remove PATHFIND_SHORTCUT from path type in some cases

* Core/Object: Ignore UpdateAllowedPositionZ for flying units.

- This will make flying units go through mountains instead of going to the top and back to the bottom to reach you.

* Core/Object: Revert some changes and let MovePositionToFirstCollision deal with a position without ground

* Missing groundZ change for objects on transport

* use CanFly instead of IsFlying

(cherry picked from commit 9fcbd8f15d)
2021-11-26 22:43:48 +01:00
jackpoz c312b926b4 Core/MMaps: MMaps logs cleanup
Move MMaps related logs from "maps" category to "maps.mmaps".
Remove newlines in logs, the log system already takes care of newlines.

(cherry picked from commit 696039cfed)
2021-11-24 20:34:56 +01:00
jackpoz bd0e9e7aa8 Core/MMaps: Fix infinite loop in Detour
Fix another infinite loop in Detour caused by degenerated triangles.
Check the result of some previously ignored Detour calls.
Update recastnavigation to 3a619d773deb7e3a15ee215217c825995fe71312 and apply some more custom changes

(cherry picked from commit c602220e02)
2021-11-24 20:34:56 +01:00
jackpoz 23489568db Core/MMaps: Fix infinite loop in Detour
Fix an infinite loop in Detour happening in Dalaran Sewers.
This is more of an emergency patch until we figure out why dtNodes have a circular reference (A -> B -> C -> A) happening quite often in this place

(cherry picked from commit c8ec2dd95d)
2021-11-23 22:28:28 +01:00
Shauren 58043c8d90 Core/Movement: Removed unneccessary z position adjustment
Closes #21872

(cherry picked from commit d9a2177e9c)
2021-09-26 16:12:52 +02:00
Shauren 453b59de57 Core/Maps: Adjusted logic in GetFullTerrainStatusForPosition to closer match what the client does regarding being inside WMOs
Closes #21625
Closes #21624
Closes #21516

(cherry picked from commit b9c6bbb51d)
2021-09-25 01:04:21 +02:00
Treeston 1493920495 Core/Movement: Replace old TargetedMovementGenerator into ChaseMovementGenerator and FollowMovementGenerator, full rewrite for both.
- Chase to angle is now functional. Pets use this to chase behind the target. Closes #19925.
- Chase to arbitrary range interval works. Not used anywhere, but you can technically make hunter-like mobs.
- Pets now follow the hunter cleanly and without stutter stepping. Also fix some other things. Closes #8924.

(cherry picked from commit 2a84562dc8)
2021-09-24 23:37:43 +02:00
Shauren 6ecfe58cae Core/Maps & Extractors: Move copypasted map file headers into a single shared file and replace #defines with enums 2021-05-29 21:21:37 +02:00
Jeremy 446fc391f0 Core/Entities: Fix some weird movement due to los issues (#21125)
* Core/Entities: Fix some weird movement due to los issues
- Made LoS check use collisionHeight instead of midsection. Value was too low.
- Gnomes will now have a breath bar more quickly than for example a tauren.
- Changes have been made to checking for ground z as well, some tweeking might be needed but removed most of the scattered +2.0f/+0.5f/we
* Add 0.05f to isInAir check in Creature::UpdateMovementFlags

(cherry picked from commit e42903ec16)
2021-04-15 05:53:27 +02:00
Shauren b231903932 Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port 2020-09-04 13:38:24 +02:00
Shauren 1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00
Treeston 51ce3b1c1d [3.3.5] Get zone/area IDs from vmap data in the liquid update (#19840)
* Add new method Map::getFullVMapDataForPosition to get area info and liquid info in a single vmap lookup
* Use this lookup in Map:: relocation methods to update m_areaId and m_zoneId fields on WorldObject
* Adjust GetZoneId/GetAreaId on WorldObject to always return these cached fields
* Clean up liquid state handling on Unit and Player
* Hand floor's Z coord up through GetFullTerrainStatusForPosition, use it to update a new field in WorldObject, and use that to feed a new GetFloorZ call on WorldObject.

Closes #16489

(cherry picked from commit f6c849729b)
2020-07-16 22:00:24 +02:00
Aokromes b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
vincent-michael 5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
Shauren edb2b16f54 Tools/mmaps_generator: Give land priority during area merges over liquids
Closes #21700
2018-04-22 01:01:48 +02:00
Shauren 979d7b4f35 Core/Movement: Fixed PathGenerator::GetNavTerrain returning ground instead of water in fatigue area 2018-04-15 22:14:54 +02:00
Shauren 42f9deb21e Core/Maps: Implemented getting area id from gameobject spawns
Yes, you can now spawn LK platform anywhere and it will treat you as inside Icecrown Citadel
2018-03-28 22:01:22 +02:00
Shauren 8f53ba3854 Core/Phasing: Rewrite GetTerrainMapId 2018-03-25 19:28:36 +03:00
Shauren 3743d04201 Core/MMaps: Implemented loading phased tiles
Closes #16909
2018-03-25 19:28:36 +03:00
Shauren bea7faa8f9 Core/Entities: Take terrain swaps into account when calculating LoS/height/area 2018-03-25 19:28:36 +03:00
Shauren 8467503b90 Core/MMaps: Remove phased tile support
* Extremely slow
* Needs to be implemented partially in tools
* Conflicts with upcoming phasing rewrite
2018-02-20 22:33:38 +01:00
vincent-michael 7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Aokromes 6d9a0ade7b Core/Mmaps: Charge ignoring z position of target (#17516)
* Core/Mmaps: Charge ignoring z position of target

By cemak closes #15011
(cherry picked from commit fda9f1a136)

Typo fix
(cherry picked from commit fcffdc38a7)

And another typo fix
(cherry picked from commit e0cc650ea9)
2017-02-04 23:59:27 +01:00
vincent-michael 86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
DDuarte 8b26aea95a Implement real time statistic visualization (#16956)
Docs at https://trinitycore.atlassian.net/wiki/display/tc/Monitoring+a+TrinityCore+server

* Common/Graphs: Initial proof of concept

* Move influx db code to its own class

* Reuse the same socket

* Allow to log values of different categories

* Allow to log events

* Pass the timestamp to influxdb

* Send events in batches

* Send data async

* Log server shutdown.
Fix memory leak.

* Allow to enable/disable Stats in the settings and at runtime

* Read interval between each batch send from config

* Add InfluxDB connection info to configs

* Move each event category to its own table

* Log pathfinding queries

* Move categories table initialization to constructor using enum as key to avoid assigning the table name to the wrong enum value

* Log player login/logout events.
Pass the hostname correctly in the HTTP request.

* Fix linux build

* Handle "Connection: close" HTTP header, reconnecting on next scheduled send.
Disable StatsLogger if connection fails, logging the error.

* Add an enum for categories of logged values, it's still possible to pass a string instead of the enum.

* Don't log the whole batchedData when InfluxDB returns an error, it's too long and unreadable on console.

* Allow to call a function at a specified interval in thread-safe World::Update() context to log data like player count.

* Log map tile load/unload

* Core/StatsLogger: Allow logging more value types other than ints

https://docs.influxdata.com/influxdb/v0.10/write_protocols/write_syntax/

* Fix a typo in string escape of StatsLogger

* Yet more fixes to the escaping in FormatInfluxDBValue

* DB/Gameobject: Fix respawn time of few Quest GameObjects

By Tauriella, closes #16701

* DB/Misc: Fix some engrish

By tkrokli closes #16648

* Tools/MMaps: Add format library linking to mmaps_generator

(Very) partial cherry pick of ed75b0649a

* Core/StatsLogger: Simplify code

Convert values and categories arrays to maps initialized in-place
Remove constructor and destructor

* Core/StatsLogger: Add realm name to the event and value tags

* Log amount of processed packet of each session

* Apply recent singleton changes to sStatsLogger too

* Fix influxdb data format if no realm name is present

* Remove unneeded newlines from request body, fixes response 400 from InfluxDB 0.10

* Rename Reporting folder to Metric

* Rename StatsLogger to Metric

* Rename InfluxDB configs to Metric

* Add Grafana dashboards

* Add a random annoying macro

* Move string formatting to Metric::SendBatch(), reducing performance footprint of Metric::LogEvent() and Metric::LogValue()

* Update grafana graphs refresing tags on load and showing now-15m data, refreshing every minute. These settings can be modified in grafana.

* Rename MetricData fields

* Contrib/Grafana: Rename dashboard files

* Contrib/Grafana: Replace hardcoded Windows/Ubuntu realm names by the default, Trinity

* Config/Worldserver: Add missing section to the index

* Contrib/Grafana: Add singlestat panels with current online players, update diff averages (1 min, 5 mins and 15 mins)

http://i.imgur.com/Zi8lfvS.png

* Core/Metric: Replace the enums MetricEventCategory and MetricValueCategory by strings

For the sake of simplicity and less recompile time when adding new metrics, similar to how TC_LOG_* works

* Contrib/Grafana: Display the current number of online players and not its average

Closes #15075
(cherry picked from commit 3ae1016082)

# Conflicts:
#	src/server/game/Server/WorldSession.cpp
#	src/server/game/World/World.cpp
#	src/server/worldserver/Main.cpp
2016-06-04 11:26:57 +01:00
Vincent-Michael 478cc756eb Update copyright note for 2016
Happy new year (Again new year with idiots ...)
2016-01-01 00:34:25 +01:00
Shauren a22e4e121a Core/Misc: Fixing warnings detected by Visual Studio 2015 compiler 2015-07-21 00:33:36 +02:00
jackpoz 0c09d6311a Core/Spells: Normalize Z for last point in a charge path
Normalize the new point that 124398feef adds to a charge path.

(cherry picked from commit e5258f92c8)
2015-07-12 12:45:36 +01:00
jackpoz a48f8f4de9 Core/Dependencies: Update recast
Update recast to https://github.com/memononen/recastnavigation/commit/1dd5cf1883d61e723fef3d4957cf758c50e7a52b
Fix 2 warnings.

These changes have no effect on MMAPs and it's not needed to re-extact them.

(cherry picked from commit dfa556aaa2)

Conflicts:
	dep/PackageList.txt
2015-06-29 15:52:57 +01:00
Rat a68f19af56 Core/Phases: Mmaps now use the swapped terrain's mmtiles for all units if available. 2015-03-16 16:54:47 +01:00
Vincent-Michael ab90f74486 Update copyright note for 2015
Happy new year
2015-01-01 00:28:09 +01:00
Shauren cffbcea877 Core/Entities: Sixth part of removing GetGUIDLow() uses 2014-10-22 23:31:10 +02:00
Vincent-Michael 63d7b348bb Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4 2014-10-10 05:29:06 +02:00
Shauren 67f9d916cb Build: Fixed game & collision depending on each other for linking 2014-10-09 23:01:31 +02:00
Vincent-Michael 48297860f1 Merge commit 'a2ba49afa428ed9297f98bf8a5e00f6f7a6f4c3a' into 4.3.4 2014-09-09 19:22:41 +02:00
Shauren 909acdbac3 Merge remote-tracking branch 'origin/master' into 4.3.4
Conflicts:
	src/server/authserver/Main.cpp
	src/server/authserver/Realms/RealmList.cpp
	src/server/authserver/Realms/RealmList.h
	src/server/authserver/Server/AuthSession.cpp
	src/server/authserver/Server/AuthSocket.h
	src/server/authserver/Server/RealmAcceptor.h
	src/server/game/Accounts/AccountMgr.h
	src/server/game/Achievements/AchievementMgr.cpp
	src/server/game/Achievements/AchievementMgr.h
	src/server/game/Battlegrounds/ArenaTeamMgr.cpp
	src/server/game/Conditions/ConditionMgr.cpp
	src/server/game/DungeonFinding/LFGMgr.h
	src/server/game/Entities/Object/Object.h
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Player/Player.h
	src/server/game/Entities/Unit/Unit.cpp
	src/server/game/Handlers/BattleGroundHandler.cpp
	src/server/game/Movement/Spline/MoveSplineFlag.h
	src/server/game/Quests/QuestDef.cpp
	src/server/game/Quests/QuestDef.h
	src/server/game/Server/WorldSession.cpp
	src/server/game/Server/WorldSession.h
	src/server/game/Server/WorldSocket.cpp
	src/server/game/Server/WorldSocket.h
	src/server/game/Spells/Spell.cpp
	src/server/scripts/Commands/cs_debug.cpp
	src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
	src/server/scripts/Spells/spell_mage.cpp
	src/server/scripts/Spells/spell_rogue.cpp
	src/server/scripts/Spells/spell_shaman.cpp
	src/server/scripts/Spells/spell_warrior.cpp
	src/server/shared/Cryptography/BigNumber.h
	src/server/worldserver/RemoteAccess/RASocket.cpp
	src/server/worldserver/worldserver.conf.dist
2014-07-19 03:51:11 +02:00
Shauren 7532864264 Buildsystem/MSVC: Warning fixes
C4800 'type' : forcing value to bool 'true' or 'false' (performance warning)
C4127 conditional expression is constant
2014-07-17 15:42:57 +02:00
Subv dfdc19f3bc Merge branch master into boost
Conflicts:
               BattlegroundMgr.h
2014-07-13 16:52:38 -05:00
Vincent-Michael 0f5c481cd4 Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Player/Player.h
	src/server/game/Handlers/SkillHandler.cpp
2014-07-12 18:08:30 +02:00
Trisjdc 4a197ba22a Core/PathGenerator: Split raycast paths into more points for better path z normalization. Solves many of the 'falling underground with charge' issues 2014-07-12 13:13:38 +01:00
Vincent-Michael cbcfa73e65 Core/Creature: Implement CREATURE_FLAG_EXTRA_IGNORE_PATHFINDING 2014-07-11 03:08:20 +02:00
Vincent-Michael 7008ac98aa Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4 2014-07-05 14:29:12 +02:00
Trisjdc 124398feef Core/Spells: Improve charge path logic, get a point to the target and then reduce it by the necessary distance 2014-07-04 22:22:28 +01:00
Vincent-Michael e4b14b943d Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
	sql/old/3.3.5a/TDB52_to_TDB53_updates/world/2013_07_24_00_world_spell_script_names.sql
	sql/updates/world/2013_07_24_00_world_spell_script_names.sql
	sql/updates/world/2013_07_24_00_world_spell_script_names_335.sql
	src/server/game/Achievements/AchievementMgr.cpp
	src/server/game/Achievements/AchievementMgr.h
	src/server/game/Battlegrounds/ArenaTeamMgr.cpp
	src/server/game/Chat/ChatLink.cpp
	src/server/game/DataStores/DBCStores.cpp
	src/server/game/DataStores/DBCStructure.h
	src/server/game/DataStores/DBCfmt.h
	src/server/game/Entities/DynamicObject/DynamicObject.h
	src/server/game/Entities/Object/Object.cpp
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Unit/StatSystem.cpp
	src/server/game/Entities/Unit/Unit.cpp
	src/server/game/Entities/Unit/Unit.h
	src/server/game/Groups/Group.cpp
	src/server/game/Handlers/QuestHandler.cpp
	src/server/game/Miscellaneous/SharedDefines.h
	src/server/game/Spells/Auras/SpellAuraEffects.cpp
	src/server/game/Spells/Auras/SpellAuras.cpp
	src/server/game/World/World.h
	src/server/scripts/Commands/cs_character.cpp
	src/server/scripts/Commands/cs_lookup.cpp
	src/server/scripts/Commands/cs_titles.cpp
	src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp
	src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp
	src/server/scripts/Kalimdor/zone_darkshore.cpp
	src/server/scripts/Kalimdor/zone_mulgore.cpp
	src/server/scripts/Kalimdor/zone_tanaris.cpp
	src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
	src/server/scripts/Spells/spell_dk.cpp
	src/server/scripts/Spells/spell_mage.cpp
	src/server/scripts/Spells/spell_rogue.cpp
	src/server/shared/Database/Implementation/CharacterDatabase.cpp
	src/server/shared/Database/Implementation/CharacterDatabase.h
	src/tools/vmap4_extractor/mpq_libmpq04.h
2014-04-05 20:43:05 +02:00
jackpoz d5d2805771 Core/MMAPs: Replace an assert with error log
Replace an assert in PathGenerator::BuildPolyPath() about invalid poly reference with an error log.
Fixes #11493 .
2014-02-27 21:03:57 +01:00
jackpoz 272009ebee Core/MMAPs: Add support for raycast
Add an optional parameter "straightLine" to PathGenerator::CalculatePath() which will use raycast instead of path finding and will return only complete path from start to end position.
Implement this new type of path in SPELL_EFFECT_CHARGE , fixing strange behaviors when using Charge with mmaps enabled.
2014-02-24 21:01:50 +01:00
jackpoz f7bc86a17c Core/MMAPs: Update recast
Update recast from https://github.com/memononen/recastnavigation/commit/1be9de72d87dcfdecf6bea30f5461745f7d7afe6 to https://github.com/memononen/recastnavigation/commit/740a7ba51600a3c87ce5667ae276a38284a1ce75 .
This differs from https://github.com/TrinityCore/TrinityCore/commit/aa645683b8b25bfb35cb977678daf5c56c1531e6 because it includes a fix https://github.com/memononen/recastnavigation/commit/77ebf643531c90ea712b496e23c48f0b0671f43d which correctly extract tile connections when using rcMergePolyMeshes(), used by mmaps_generator.
MMAPs version is now set to 5.

Re-extract MMAPs using mmaps_generator , any old extracted MMAPs will not work.
2014-02-23 12:39:16 +01:00