Commit Graph

325 Commits

Author SHA1 Message Date
Kargatum
a32b6b8ac4 Core: whitespace cleanup, reduce double blank line to single (#25795)
* Core/Misc: fix double empty line

* worldserver.conf
2021-01-03 11:47:07 +01:00
Giacomo Pozzoni
a4e93d779c Improve multithreading of mmaps_generator (#25625)
* 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
2020-12-06 17:52:13 +01:00
jackpoz
3947e4cb57 Core/MMAPs: Restore single slope angle of 55°
Re-generating MMAPs IS required.
Partially reverts 995a443da2 .

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).
2020-10-10 23:03:09 +02:00
Giacomo Pozzoni
b6e205f7ef Tools/MMapsGenerator: Add some more input parameters to improve mmaps load performances (#25520)
* 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.
2020-10-04 21:08:54 +02:00
Treeston
8ab9a29af3 Tools/VMapExtractor: Make Shauren happy, fmt::sprintf -> Trinity::StringFormat 2020-08-20 23:21:45 +02:00
Treeston
8ebcc0b086 Tools/VMapExtractor: Clean-up some patches of horrendously creaky code to make them slightly less creaky (and get rid of gcc warnings) 2020-08-20 23:02:02 +02:00
Shauren
39c5e03b74 Core/CrashHandler: #ifdef cleanup to make VS not choke when parsing, fixed file being all red in editor 2020-08-07 17:19:18 +02:00
Giacomo Pozzoni
07fd84b679 Core/Misc: Fix static analysis issues (#25194) 2020-08-04 11:36:47 +02:00
Peter Keresztes Schmidt
ddf16ae4d9 Misc: Remove some unneeded/duplicated includes (#25051) 2020-07-16 14:14:01 +02:00
ipriver
a46d047f94 fixed indentation for cmake files 2020-06-24 14:42:02 +02:00
Giacomo Pozzoni
995a443da2 Handle different slopes in mmaps (#24765)
* 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
2020-06-17 22:20:26 +02:00
jackpoz
6e34e07c48 Tools/MMAPs: Output the time spent in a human readable format 2020-06-05 19:58:02 +02:00
Giacomo Pozzoni
8c09b6e58b Cherry-pick some cmake commits (#24720)
* Build system: Support  new in cmake 3.17 Ninja Multi-Config generator

(cherry picked from commit 369b618d4f)

* Build system: Fixed PCH with MSVC & Ninja generator

(cherry picked from commit d669f46b6d)

* Core: Fix clang 10 warnings

(cherry picked from commit 7272508cb4)

# Conflicts:
#	src/common/Utilities/Util.h
#	src/server/bnetserver/REST/LoginRESTService.cpp
#	src/server/game/Entities/Object/Position.h
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Guilds/GuildFinderMgr.h
#	src/server/game/Movement/Spline/MoveSplineFlag.h
#	src/server/shared/Dynamic/LinkedList.h

* Build system: Set -Wno-deprecated-copy only for clang 10

(cherry picked from commit 7fdeb259ba)

* Core/Misc: GCC build and warning fixes

(cherry picked from commit 4d69cc1c56)

# Conflicts:
#	src/common/Utilities/Util.cpp
#	src/server/database/Database/MySQLConnection.cpp
#	src/server/game/Battlefield/Zones/BattlefieldTB.cpp
#	src/server/game/DataStores/M2Stores.cpp
#	src/server/game/DungeonFinding/LFGMgr.cpp
#	src/server/game/DungeonFinding/LFGPlayerData.cpp
#	src/server/game/Entities/GameObject/GameObject.cpp
#	src/server/game/Entities/Item/Item.cpp
#	src/server/game/Entities/Object/Updates/UpdateFields.h
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Entities/Player/RestMgr.cpp
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Handlers/PetHandler.cpp
#	src/server/game/Server/Packets/GuildPackets.h
#	src/server/game/Spells/Auras/SpellAuraEffects.cpp
#	src/server/game/Spells/Auras/SpellAuras.cpp
#	src/server/game/Spells/Spell.cpp
#	src/server/game/Spells/SpellInfo.cpp
#	src/server/game/Spells/SpellMgr.cpp
#	src/server/scripts/Argus/AntorusTheBurningThrone/boss_garothi_worldbreaker.cpp
#	src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp
#	src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
#	src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
#	src/server/scripts/Northrend/zone_sholazar_basin.cpp
#	src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
#	src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
#	src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
#	src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp
#	src/tools/vmap4_extractor/gameobject_extract.cpp
#	src/tools/vmap4_extractor/model.cpp
#	src/tools/vmap4_extractor/vec3d.h

* Build system: Print found git version when warning about it being too old

(cherry picked from commit 1ae72db201)

* Build system: Removed hard requirement on BOOST_ROOT being set as environment variable, it can now be also passed as command line argument to cmake and fix compile warning with boost 1.73

(cherry picked from commit 161944b764)

# Conflicts:
#	dep/boost/CMakeLists.txt

* Remove some code that was already removed from 335 and then cherry-picked into master

Co-authored-by: Shauren <shauren.trinity@gmail.com>
2020-05-31 14:17:26 +02:00
Giacomo Pozzoni
c0b75bf40d Core/MMAPs: Adjust walkable climb and fix a lot of mmap raycast issues (#24539)
* 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 <dreadkiller@gmx.de>
2020-05-15 20:43:12 +02:00
Shauren
6259763469 Core/Misc: Fix invalid utf-8 comments 2020-03-20 21:53:20 +01:00
jackpoz
3b0a89a2ea Tools/MMaps: Fix strange paths in Blackfathom Deeps
Increase the agent height by x2 to reduce the chance of having underground mmap layers wrongly picked by recast.
2020-02-26 21:06:39 +01:00
Ujp8LfXBJ6wCPR
9264e5b6f0 Core/Misc: Remove redundant null pointer checks before delete (#24140)
* Identified by clang-tidy readability-delete-null-pointer
2020-02-14 12:45:34 +01:00
Giacomo Pozzoni
29bf280e34 Core/PathGenerator: Fix path generator returning shortcuts when start and end are on the same polygon (#24036)
* Core/PathGenerator: Fix path generator returning shortcuts when start and end are on the same polygon

Fix path generator returning shortcuts when start and end are on the same polygon by handling this case as if start and end were on 2 different polygons. This will ensure BuildPointPath() gets called which calls FindSmoothPath(), making sure each step is not longer than SMOOTH_PATH_STEP_SIZE (4 yards)

* Change ingame cast error message to SPELL_FAILED_NOPATH from SPELL_FAILED_OUT_OF_RANGE if the generated path is too long
2020-01-09 19:38:45 +01:00
Aokromes
ed93932537 New year
Say bye bye to every year changing dates
2020-01-02 06:25:50 +01:00
Shauren
aa0d468e04 Tools/Misc: Document strange array access indexing
Closes #23723
2019-08-18 12:40:38 +02:00
Shauren
f912963b4b Tools build fix
(cherry picked from commit 3c8210a1f3)
2019-02-23 22:00:05 +01:00
jackpoz
7ddbc18aaf Core/MMaps: Add rcMedianFilterWalkableArea() to mmaps generation process
Add rcMedianFilterWalkableArea() to mmaps generation process to simplify some ground/water areas
2019-02-23 22:00:05 +01:00
Shauren
7b561373a8 Tools/mmaps_generator: Give land priority during area merges over liquids
Closes #21700

(cherry picked from commit edb2b16f54)
2019-02-23 22:00:05 +01:00
Shauren
8d19fcbc46 Tools/vmapextractor: Improved vmap detail level by extracting wmo doodads (tables, chairs etc)
(cherry picked from commit fb0a1de5c1)
2019-02-23 22:00:05 +01:00
Shauren
0e083a0356 Tools/MMapsGenerator: Cleanup duplicated definitions
* rebuilding is not needed

(cherry picked from commit 60c4c29da5)
2019-02-23 22:00:05 +01:00
Shauren
ecab7db7b0 Warning fix
(cherry picked from commit cfa948193c)
2019-02-23 22:00:05 +01:00
Shauren
8d1bb258fc Tools:
* mapextractor - fixed compressing liquid data
* vmapextractor - fixed extracting liquids inside WMOs
* vmapextractor - implemented new WMO flags
* vmapextractor - store model type for gameobject models
* mmap_generator - fixed processing liquids broken in e5d23103f3

(cherry picked from commit 2c64bb97e6)
2019-02-23 22:00:05 +01:00
Shauren
fd30618f12 Tools/Mapextractor: Fixed determining deep water
(cherry picked from commit 2e648f9eb9)
2019-02-23 22:00:05 +01:00
Shauren
e6bfa71e4d Tools/Mapextractor: Implemented liquid object detection
(cherry picked from commit 82bf263f92)
2019-02-23 22:00:04 +01:00
Shauren
fee666f02f Tools/Misc: Partial cherry-pick of 7b235ce6e4 2019-02-23 22:00:04 +01:00
Shauren
98949b75ed Tools/Misc: Partial cherry-pick of 457c93bc4b 2019-02-23 22:00:04 +01:00
Shauren
2924283f07 Tools/Misc: Partial cherry-pick of fe4d11c65a 2019-02-23 22:00:04 +01:00
jackpoz
e4658a1307 Tools/MMaps: Allow to specify different Recast settings for different maps
Allow to specify different Recast settings for different maps, currently handled in GetMapSpecificConfig() as a switch statement.
Set walkableRadius to 0 in Blade's Edge Arena (Map ID 562) so the pets can walk on the thin rope between the bridge and the pillar.
2019-01-27 15:20:38 +01:00
jackpoz
5ff88ea04a Dep/Recast: Update recastnavigation to 14b2631527
Rebuilding mmaps IS required
2019-01-26 20:44:27 +01:00
Treeston
fcfcb0eb6f Happy New Year, folks. It's 2019! 2019-01-01 15:45:25 +01:00
tkrokli
f6b6f57a6d Update copyright note for 2018
Best wishes for the new year.
2018-01-01 01:55:29 +01:00
Naios
85e460802d Build: Inherit the features and warning flags privately
(cherry picked from commit 1285347518)
2017-12-21 23:31:11 +01:00
Aokromes
59e94fd9bb Misc: More cleanup 2017-11-25 02:39:27 +01:00
Warpten
9614f9d8cf Merge pull request #20024 from Golrag/fix_collision
Core/VMaps: Fix no collision triangles
2017-11-22 15:16:36 +01:00
jackpoz
f8fd0b7a2c Tools/MMaps: Improve MMaps quality
Lower Detail Sample Distance and Detail Sample Max Error to get more accurate MMap data, in particular mmap height.
More info about Detail Mesh at http://digestingduck.blogspot.it/2009_07_01_archive.html and http://digestingduck.blogspot.it/2009_08_01_archive.html
2017-11-18 20:31:22 +01:00
jackpoz
7ef22e4305 Dep/Recast: Update recastnavigation to 2c85309280 2017-11-18 20:29:25 +01:00
jackpoz
64ca471734 Tools/VMaps: Fix build issue on VS2017 2017-11-18 20:28:02 +01:00
Rochet2
0a3e2339ef Tools/MMapsGenerator: Use system supported threads instead of hardcoded amount (#19255)
- Use unsigned int for thread count
- Use std::thread::hardware_concurrency() to try estimate available threads instead of hardcoded 3 threads by default
- Print thread count always regardless of using --threads switch or not
2017-08-08 22:52:55 +02:00
ariel-
f0357a861d Core/Tools: fix whitespace 2017-07-19 12:40:01 -03:00
keke222
15f6a02b72 Tools: Automatically create directories for tools (#17971) 2017-07-17 10:18:35 +02:00
Golrag
89d641f1e6 Core/VMaps: Fix no collision triangles 2017-07-14 18:00:51 +02:00
Rochet2
b9f276f0a0 Tools/MMapsGenerator: Get all tiles in beginning and calulate proper total tile count (#20013) 2017-07-13 17:31:24 +02:00
ariel-
85a7d5ce9a Core: ported headers cleanup from master branch 2017-06-19 23:20:06 -03:00
Golrag
c35793941b Core/VMaps: Fix LoS in Strand of the Ancients (#19847)
Core/Collision: Fixed MOPY chunk flags enum.

Also avoid loading destructible WMOs into vmaps.

VMap re-extraction is required.

Closes #15798.
2017-06-05 16:32:35 -05:00
jackpoz
8f2bcd79da Core/Misc: Fix static analysis issues 2017-02-25 17:07:22 +01:00