aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2014-04-19 15:35:13 +0200
committerjackpoz <giacomopoz@gmail.com>2014-04-19 15:35:13 +0200
commit93a68a66c3009ea86569076ea05a39ce87dfb78d (patch)
treed3b5a13a6890856323398a23dc022a164a89276a /src
parent574fa30ea6924902af1d845e667f38c043b32e94 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/tools/mmaps_generator/MapBuilder.cpp4
-rw-r--r--src/tools/mmaps_generator/MapBuilder.h2
-rw-r--r--src/tools/mmaps_generator/PathGenerator.cpp2
3 files changed, 5 insertions, 3 deletions
diff --git a/src/tools/mmaps_generator/MapBuilder.cpp b/src/tools/mmaps_generator/MapBuilder.cpp
index d60924a83f9..cc24035b05e 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 33f45a86549..86a6db2077c 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 1df24cfa332..d88ab8ca16d 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,