Commit Graph

110 Commits

Author SHA1 Message Date
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
28c9474337 Core/vmaps: Improved WMO detection for group models that don't have floor 2024-03-25 12:18:37 +01:00
Shauren
18200e1b88 Core/vmaps: Reset BIH::bounds on tree rebuilds 2024-03-13 18:19:22 +01:00
Shauren
45ee989c70 Core/vmaps: Removed vmap lookup functions duplicating functionality of each other 2024-03-07 00:23:52 +01:00
Shauren
0697cf8c94 Core/vmaps: Increment vmap format version number 2024-03-06 00:04:19 +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
Shauren
1aa04cabe1 Tools/mmaps_generator: Added const on some functions interfacing with vmaps 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
86725ed926 Core/MMaps: Fixed pathing for objects that have terrain swaps active 2023-08-08 00:08:10 +02: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
a2ec80b14c Core/vmaps: Stop worldserver startup when gameobject models cannot be loaded 2022-12-20 16:01:28 +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
Shauren
c13d26e1fa Core/GameObjects: Use all axis rotations for gameobject model collision, not just orientation 2022-05-22 14:53:05 +02:00
Gosha
428d8dc3b7 Core/Vmaps: Use provided invDirection from G3D::Ray instead of calculating it ourselves (#27883)
Do not calculate inv direction, Ray has one
2022-04-18 21:41:31 +02: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
Giacomo Pozzoni
99ee958e0a Core/Misc: Fix issues reported by static analysis (#25351)
* Core/Misc: Fix issues reported by static analysis

* Core/Vmaps: Code cleanup after e777161888

(cherry picked from commit cfc8f7b442)
2022-02-04 12:18:15 +01:00
Carbenium
8809d54ca2 Core/Common: Merge TimeTrackerSmall with TimeTracker
(cherry picked from commit 228696bf80)
2022-01-24 21:34:36 +01:00
Peter Keresztes Schmidt
770fbcca0c Core/Misc: Replace boost::optional with std::optional (#25047)
C++17 is already mandatory, so it's a safe thing to do

(cherry picked from commit 202fd41389)
2022-01-23 18:05:59 +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
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
Ujp8LfXBJ6wCPR
6229a6ddc1 Remove dependency on undefined behaviour (#24159)
See https://stackoverflow.com/a/4328396
Previous method works but is technically illegal.

(cherry picked from commit b089ed3b75)
2021-12-21 16:36:07 +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
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
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
20aeb63026 Core/Vmaps: Extract more doodad sets 2021-04-25 00:11:42 +02:00
Shauren
e821693c16 Core/Vmaps: Reduce memory used by vmaps, part 2 2021-04-25 00:11:42 +02:00
Shauren
bb8f22ed20 Core/Vmaps: Reduce memory used by vmaps (and their size, slightly) 2021-04-25 00:11:36 +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
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
sirikfoll
7586daad62 Core/Misc: Remove Whitespaces
(cherry picked from commit e2565c2597)
2020-08-23 00:48:19 +02:00
jackpoz
77e6355fba Core/Misc: Fix static analysis issues
(cherry picked from commit 9cf4dd7345)
2020-08-19 00:14:06 +02:00
Golrag
c46aa9d5b5 Core/VMaps: Fix no collision triangles
(cherry picked from commit 89d641f1e6)
2020-08-18 18:53:13 +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
6040f8eb31 Core/Collision: Port new parts for retrieving area/liquid data from gameobjects added when porting 42f9deb21e to 3.3.5 2020-06-28 12:26:39 +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
4fb6ad5225 Fix dynamic build 2020-05-10 19:29:17 +02:00