From 93a68a66c3009ea86569076ea05a39ce87dfb78d Mon Sep 17 00:00:00 2001 From: jackpoz Date: Sat, 19 Apr 2014 15:35:13 +0200 Subject: [PATCH] Core/MMAPs: Improve NPC behavior with fences and high climbs Increase the max walkable angle and max walkable climb in MMAPs generator to allow NPCs to jump on fences and climb steps. This requires MMAPs to be extracted again with mmaps_generator, old extracted MMAPs are still compatible but will not provide the benefits of this commit. Fixes #9965 --- src/tools/mmaps_generator/MapBuilder.cpp | 4 +++- src/tools/mmaps_generator/MapBuilder.h | 2 +- src/tools/mmaps_generator/PathGenerator.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tools/mmaps_generator/MapBuilder.cpp b/src/tools/mmaps_generator/MapBuilder.cpp index d60924a83f..cc24035b05 100644 --- a/src/tools/mmaps_generator/MapBuilder.cpp +++ b/src/tools/mmaps_generator/MapBuilder.cpp @@ -553,7 +553,9 @@ namespace MMAP config.borderSize = config.walkableRadius + 3; config.maxEdgeLen = VERTEX_PER_TILE + 1; // anything bigger than tileSize config.walkableHeight = m_bigBaseUnit ? 3 : 6; - config.walkableClimb = m_bigBaseUnit ? 2 : 4; // keep less than walkableHeight + // a value >= 3|6 allows npcs to walk over some fences + // a value >= 4|8 allows npcs to walk over all fences + config.walkableClimb = m_bigBaseUnit ? 4 : 8; config.minRegionArea = rcSqr(60); config.mergeRegionArea = rcSqr(50); config.maxSimplificationError = 1.8f; // eliminates most jagged edges (tiny polygons) diff --git a/src/tools/mmaps_generator/MapBuilder.h b/src/tools/mmaps_generator/MapBuilder.h index 33f45a8654..86a6db2077 100644 --- a/src/tools/mmaps_generator/MapBuilder.h +++ b/src/tools/mmaps_generator/MapBuilder.h @@ -61,7 +61,7 @@ namespace MMAP class MapBuilder { public: - MapBuilder(float maxWalkableAngle = 55.f, + MapBuilder(float maxWalkableAngle = 70.f, bool skipLiquid = false, bool skipContinents = false, bool skipJunkMaps = true, diff --git a/src/tools/mmaps_generator/PathGenerator.cpp b/src/tools/mmaps_generator/PathGenerator.cpp index 1df24cfa33..d88ab8ca16 100644 --- a/src/tools/mmaps_generator/PathGenerator.cpp +++ b/src/tools/mmaps_generator/PathGenerator.cpp @@ -242,7 +242,7 @@ int finish(const char* message, int returnValue) int main(int argc, char** argv) { int threads = 3, mapnum = -1; - float maxAngle = 55.0f; + float maxAngle = 70.0f; int tileX = -1, tileY = -1; bool skipLiquid = false, skipContinents = false,