From d58d0e895c6e22bcf40be5c38ff828c98a7600e6 Mon Sep 17 00:00:00 2001 From: Giacomo Pozzoni Date: Wed, 17 Jun 2020 20:20:26 +0000 Subject: Handle different slopes in mmaps (#24765) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 995a443da219ec773febd7dd29d18f3cefaa1f3b) --- src/common/Collision/Maps/MMapDefines.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/common/Collision') diff --git a/src/common/Collision/Maps/MMapDefines.h b/src/common/Collision/Maps/MMapDefines.h index e12c8cac49e..6298775ba6f 100644 --- a/src/common/Collision/Maps/MMapDefines.h +++ b/src/common/Collision/Maps/MMapDefines.h @@ -51,17 +51,22 @@ enum NavArea NAV_AREA_EMPTY = 0, // areas 1-60 will be used for destructible areas (currently skipped in vmaps, WMO with flag 1) // ground is the highest value to make recast choose ground over water when merging surfaces very close to each other (shallow water would be walkable) - NAV_AREA_GROUND = 63, - NAV_AREA_WATER = 62, - NAV_AREA_MAGMA_SLIME = 61 // don't need to differentiate between them + NAV_AREA_GROUND_STEEP = 11, + NAV_AREA_GROUND = 10, + NAV_AREA_WATER = 9, + NAV_AREA_MAGMA_SLIME = 8, // don't need to differentiate between them + NAV_AREA_MAX_VALUE = NAV_AREA_GROUND_STEEP, + NAV_AREA_MIN_VALUE = NAV_AREA_MAGMA_SLIME, + NAV_AREA_ALL_MASK = 0x3F // max allowed value }; enum NavTerrainFlag { - NAV_EMPTY = 0x00, - NAV_GROUND = 1 << (63 - NAV_AREA_GROUND), - NAV_WATER = 1 << (63 - NAV_AREA_WATER), - NAV_MAGMA_SLIME = 1 << (63 - NAV_AREA_MAGMA_SLIME) + NAV_EMPTY = 0x00, + NAV_GROUND_STEEP = 1 << (NAV_AREA_MAX_VALUE - NAV_AREA_GROUND_STEEP), + NAV_GROUND = 1 << (NAV_AREA_MAX_VALUE - NAV_AREA_GROUND), + NAV_WATER = 1 << (NAV_AREA_MAX_VALUE - NAV_AREA_WATER), + NAV_MAGMA_SLIME = 1 << (NAV_AREA_MAX_VALUE - NAV_AREA_MAGMA_SLIME) }; #endif // MMapDefines_h__ -- cgit v1.2.3