65 Commits

Author SHA1 Message Date
Shauren
f439120b1f Tools/mmaps_generator: Move TerrainBuilder to a shared project 2025-11-06 18:34:58 +01:00
Shauren
145bbde231 Tools/mmaps_generator: Save offmesh connections input together with navmesh params for each map 2025-11-05 18:55:45 +01:00
Shauren
157a16d790 Tools/vmap_extractor: Preserve destructible models to use them in mmaps_generator 2025-11-01 14:26:48 +01:00
Shauren
03e2aa6737 Core/Vmaps: Rename VMapManager2 to VMapManager 2025-10-25 00:55:34 +02:00
Shauren
96b567995a Core/Vmaps: Remove VMapManager2 virtual interface 2025-10-25 00:52:55 +02:00
Shauren
f22321ede4 Tools/Extractors: Skip extracting visual only liquids (determined by LiquidMaterial flags) 2025-06-07 12:49:34 +02:00
Shauren
fe788a5eeb Core/Misc: Silence some statis analysis false positive warnings 2025-05-19 14:41:23 +02:00
Shauren
b13b5142f1 Core/Utilities: Extend make_unique_ptr_with_deleter functionality to allow it to create deleters with compile time constant functions (reduces its size to just sizeof(void*)) 2024-10-01 21:03:44 +02:00
Shauren
d05dbaaecb Core/Vmaps: Fixed use after free and deadlocks when loading a model file fails 2024-07-06 22:52:11 +02:00
Shauren
518fe1fd1e Tools/vmap_assembler: Organize vmap files into directory-per-map 2024-07-06 14:29:54 +02:00
Shauren
35a2d49971 Core/Vmaps: Optimize loading vmaps
* Changed spawn id to BIH tree index mapping from generated on load to baked in tile files
* Remove map holding model load counts and moved that to ModelInstance instead
2024-07-05 21:20:25 +02:00
Shauren
5dbb6b043f Core/Vmaps: Minor cleanup in MapTree - use unique_ptr to manage file handles 2024-07-05 17:48:08 +02:00
Shauren
ff4fc1ad4e Core/Vmaps: Replace manual reference counting with shared_ptr and slightly reduce memory use by deduplicating model name strings 2024-07-04 22:56:00 +02:00
Shauren
45ee989c70 Core/vmaps: Removed vmap lookup functions duplicating functionality of each other 2024-03-07 00:23:52 +01:00
Shauren
a70e758ba5 Tools/vmap_extractor: Move information about model type from spawns in vmap tiles to model file itself 2024-03-06 00:04:19 +01:00
Ovahlord
97af0c31af Core/Maps: implement LIQUID_MAP_OCEAN_FLOOR to identify units that are on the bottom of a liquid (#29545) 2024-01-02 19:46:44 +01:00
Shauren
d791afae1d Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api) 2023-01-08 21:16:53 +01:00
ModoX
6ce6665992 Core/Vmaps: Fix inconsistency of hitInstance and hitModel to cause wrong area ids (#28632)
Closes #28326

Co-authored-by: Gosha <284210+Lordron@users.noreply.github.com>
2022-12-30 00:02:40 +01: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
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
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
jackpoz
ddcbc01a65 Core/MMAPs: Fix small steps being considered as NAV_AREA_GROUND_STEEP
(cherry picked from commit 3ac1992afb)
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
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
cb8b637061 Dep/Recast: Update recastnavigation to 14b2631527
Rebuilding mmaps IS required

(cherry picked from commit 5ff88ea04a)
2021-11-22 00:17:11 +01:00
Shauren
b29cc8f31a Fix build 2021-05-29 22:04:49 +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
622cec8a8f Core/Vmaps: Fixed crash in unloading vmaps
Closes #26536
2021-05-21 12:31:21 +02:00
Shauren
bb8f22ed20 Core/Vmaps: Reduce memory used by vmaps (and their size, slightly) 2021-04-25 00:11:36 +02:00
jackpoz
159aa97d72 Dep/Recast: Update recastnavigation to 2c85309280
(cherry picked from commit 7ef22e4305)
2021-02-15 19:13:25 +01:00
Shauren
7a406db506 Core/Collision: Fixed false positive errors in console about vmap loading 2020-12-08 18:16:47 +01: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
jackpoz
77e6355fba Core/Misc: Fix static analysis issues
(cherry picked from commit 9cf4dd7345)
2020-08-19 00:14:06 +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
Shauren
eba31dea27 Core/Maps: Improvements to terrain swap handling
* Fixed memory leak when unloading grids
* Handle child maps being entered
* Allow chaining more child maps (Draenor -> Tanaan Jungle -> Tanaan Jungle - No Hubs Phase)
2020-05-24 22:34:25 +02:00
Shauren
16761e1d7c Tools/vmap assembler: Move TileAssembler from common to vmap4_assembler where it belongs 2020-05-10 15:24:43 +02:00
jackpoz
49f25f6e33 Core/Misc: Fix static analysis issues
(cherry picked from commit 486b032343)
2020-04-28 13:47:58 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
Shauren
25594c5a8e Core/Misc: Fix static analysis issues
Fix static analysis issues reported by Coverity
2019-02-16 17:37:16 +01:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
Shauren
217a9bb34d Core/Vmaps: Changed error message when loading outdated vmaps
Closes #18431
Closes #18857

(cherry-picked from c90882ed6e)
2018-12-09 14:18:42 +01:00
HelloKitty
46c69df3a7 Core/Vmaps: Stop M2s from occluding for spellcast LoS
Closes #18528

(cherry-picked from 01d715eaef)
2018-12-09 14:18:42 +01:00
Shauren
45b2492aa0 Nopch/warning fixes 2018-04-27 20:29:01 +02:00
Shauren
24d30dab84 Core/VMAPS: Fixed vmaps in single WMO instances like ragefire chasm
* Fixed some models not always being spawned because they only appear in one tile file but are large enough to cross tile boundaries (lava in Firelands at Ragnaros place)

Closes #21879
2018-04-27 20:23:52 +02:00
Shauren
87278b69f0 Warning fix 2018-04-22 01:15:48 +02:00
Shauren
edb2b16f54 Tools/mmaps_generator: Give land priority during area merges over liquids
Closes #21700
2018-04-22 01:01:48 +02:00