Commit Graph

612 Commits

Author SHA1 Message Date
Shauren
13ab33f5b5 Tools/mapextractor: Updated gt file list 2022-12-17 12:54:57 +01:00
Shauren
e98e1283ea Core: Updated to 10.0.2 2022-12-04 15:13:20 +01:00
Shauren
f22be111ae Tools/vmap_extractor: Implemented new MPY2 wmo chunk 2022-12-03 23:30:53 +01:00
Lloyd Dilley
1c36441b7c Core/Misc: Fix *BSD compile errors (#28287)
(cherry picked from commit 2b8fc95fde)
2022-10-01 17:33:25 +02:00
Shauren
16a06346ae Core/Maps: Move terrain data handling out of Map class
Partial port of cmangos/mangos-wotlk@ff5232c648
2022-07-23 19:13:33 +02:00
Luzifix
b11574871e Tools/Extractors: Implement remote casc mode (#27993) 2022-06-09 17:58:35 +02:00
Shauren
6c8ef045a5 Core/DataStores: Updated structures to 9.2.5 2022-06-02 00:48:57 +02:00
robinsch
364796dc3b Tool/MMAP: Fixed invalid check causing certain tiles not to build (#27833)
example: mmaps_generator 230 will cause tile 33, 29 to not build because of the check. causing NPCs to not have mmap information in some parts of the map.

.go xyz 1380 -831 -88 230 has no mmap tile information because of above check.
https://i.imgur.com/Pypeu4f.png

(cherry picked from commit e898b6e794)
2022-03-26 15:28:07 +01:00
ModoX
09b36d8f75 Tools/Extractors: Use TACTKeys from wowdev TACTKeys repo instead of wow.tools
* wow.tools will kill /api.php?type=tactkeys soon
2022-03-13 19:24:14 +01:00
Kargatum
373ed8f46b Core: whitespace cleanup, reduce double blank line to single (#25795)
* Core/Misc: fix double empty line

* worldserver.conf

(cherry picked from commit a32b6b8ac4)
2022-03-05 20:07:57 +01:00
Shauren
439b027d48 Core/Misc: Cleanup unused includes 2022-02-13 15:07:00 +01:00
Shauren
cbcd149ce5 Core/Misc: Explicitly include required headers instead of relying on them to be included by other headers 2022-02-11 14:33:35 +01:00
Shauren
bb185a78fb Build: Put tests-extractor_common under correct folder when WITH_SOURCE_TREE is set to hierarchical-folders 2022-02-04 11:01:02 +01:00
Shauren
473f3db0ab Core/CrashHandler: #ifdef cleanup to make VS not choke when parsing, fixed file being all red in editor
(cherry picked from commit 39c5e03b74)
2022-01-26 18:46:43 +01:00
Giacomo Pozzoni
864d775280 Core/Misc: Fix static analysis issues (#25194)
(cherry picked from commit 07fd84b679)
2022-01-26 14:06:40 +01:00
jackpoz
68faf5bc4b Core/Common: Replace ASSERT(false, "...") with ABORT_MSG("...")
(cherry picked from commit 54c701cf0d)
2022-01-19 22:17:42 +01:00
ipriver
bde36062b7 fixed indentation for cmake files
(cherry picked from commit a46d047f94)
2022-01-06 23:40:39 +01:00
killerwife
c9b13f1897 MMAP: Build ADT floor just like WMO floor below liquid (#27503)
Fixes ocean floor pathfinding

(cherry picked from commit 8a779268b6)
2022-01-04 20:44:26 +01:00
Giacomo Pozzoni
feb36f3f7d Tools/MMAPs: Show an error when running mmaps_generator built in Debug mode (#27412)
* Tools/MMAPs: Show an error when running mmaps_generator built in Debug mode

* Fix GCC build

(cherry picked from commit 8c80f28581)
2022-01-04 20:44:26 +01:00
jackpoz
071a8b5b7d Core/Misc: Remove whitespace
(cherry picked from commit 869fb748cd)
2022-01-04 20:44:26 +01:00
jackpoz
be7acb2527 Core/MMAPs: Reduce chances of breaking tile connections
Reduce chances of breaking tile connections caused by floating point rounding issues.

(cherry picked from commit e615e2ddef)
2022-01-04 20:44:26 +01:00
killerwife
dbb7f65723 Vmap: Introduce skipping of antiportals and unreachable mogp (#26331)
* Vmap: Introduce skipping of antiportals and unreachable mogp

* Reduce differences with master branch

* Update VMAP and MMAP versions

* Update MMAPs version

Co-authored-by: jackpoz <giacomopoz@gmail.com>
(cherry picked from commit d5f1fefe7f)
2022-01-04 20:44:25 +01:00
killerwife
2467f799bb MapExtraction: Fix water height redundancy algorithm ignoring "no water" (#26324)
* MapExtraction: Fix water height redundancy algorithm ignoring "no water"

* Update MMAP_VERSION

* Change map version

Co-authored-by: jackpoz <giacomopoz@gmail.com>
(cherry picked from commit 00da074109)
2022-01-04 20:44:25 +01:00
Giacomo Pozzoni
1ba940b17a Core/Maps: Change .map file version from FourCC to uint32 (#26326)
(cherry picked from commit 42877e75e2)
2022-01-04 20:44:25 +01:00
Giacomo Pozzoni
89e183704c 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

(cherry picked from commit a4e93d779c)
2022-01-04 20:44:25 +01:00
Shauren
1d0ca1106f Tools/mmaps_generator: Made loading vmaps by mmaps_generator threadsafe 2022-01-04 20:44:22 +01:00
jackpoz
3820aabcd8 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).

(cherry picked from commit 3947e4cb57)
2022-01-04 20:44:02 +01:00
Giacomo Pozzoni
782a943b38 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.

(cherry picked from commit b6e205f7ef)
2022-01-04 20:44:02 +01:00
Giacomo Pozzoni
d58d0e895c 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

(cherry picked from commit 995a443da2)
2022-01-04 20:44:02 +01:00
jackpoz
bafd22104c Tools/MMAPs: Output the time spent in a human readable format
(cherry picked from commit 6e34e07c48)
2022-01-04 20:44:00 +01:00
Giacomo Pozzoni
89afeed41b 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>
(cherry picked from commit c0b75bf40d)
2022-01-04 15:33:04 +01:00
Ujp8LfXBJ6wCPR
43aa763d04 Part1: Modernize codebase with Clang-Tidy range based loops (#24164)
(cherry picked from commit fb75a958f0)
2021-12-22 15:48:01 +01:00
jackpoz
2f30a9986c 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.

(cherry picked from commit 3b0a89a2ea)
2021-12-22 13:03:21 +01:00
Shauren
bfde919694 Tools/mmaps_generator: Replace hardcoded map ids with db2 data checks 2021-12-20 20:50:28 +01:00
Giacomo Pozzoni
dd929665e5 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

(cherry picked from commit 29bf280e34)
2021-12-20 20:35:37 +01:00
Shauren
a995e5fda4 Tools/Misc: Document strange array access indexing
Closes #23723

(cherry picked from commit aa0d468e04)
2021-12-18 21:00:21 +01:00
jackpoz
2318013278 Core/MMaps: Add rcMedianFilterWalkableArea() to mmaps generation process
Add rcMedianFilterWalkableArea() to mmaps generation process to simplify some ground/water areas

(cherry picked from commit 7ddbc18aaf)
2021-11-23 23:43:55 +01:00
jackpoz
3f4bedd803 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.

(cherry picked from commit e4658a1307)
2021-11-22 23:54:43 +01:00
Shauren
5eb74cf5ed Tools: Update db2 metadata expected by extractors to 9.1.5
Closes #27251
2021-11-05 15:29:55 +01:00
Shauren
d52c00a8fe Core/DataStores: Updated db2 structures to 9.1.5 2021-11-01 22:17:12 +01: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
François B
f2ef8fa311 Tools/Vmaps: Fix models bounds (#26864) 2021-08-26 17:22:11 +02:00
Shauren
ce1046a8fd Core/DataStores: 9.1.0 db2 structures 2021-08-08 00:18:10 +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
Shauren
2de6e56d29 Core/Misc: Rename MapDefines.h to MMapDefines.h as it contains mmap defines exclusively 2021-05-29 14:48:18 +02:00
Shauren
fb6c1dc295 Dep/bzip2: Remove dependency 2021-05-15 02:14:37 +02:00
Shauren
e5ef649634 Tools/vmap_extractor: Unify version printed to console with shared vmap version definition 2021-04-25 12:33:33 +02:00
Shauren
db18228174 Tools/vmap_extractor: Fix MOVX implementation for "small" vmaps (-s or no command line argument) 2021-04-25 12:32:32 +02:00
Shauren
20aeb63026 Core/Vmaps: Extract more doodad sets 2021-04-25 00:11:42 +02:00
Shauren
d0ca535ab8 Core/Vmaps: Prepare vmaps for reading new WMO chunk - MOVX, replacement for MOVI using larger data type (currently unused in 9.0.5 client) 2021-04-25 00:11:42 +02:00