aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2020-10-10 23:03:09 +0200
committerjackpoz <giacomopoz@gmail.com>2020-10-10 23:03:09 +0200
commit3947e4cb57d4c6adb78cd3cb52718bb88add91fc (patch)
treea9234b648287d5fdf750287489815f3b2ca79b7b
parentc13ccaab5c70361d3a51005a1ce374291835b39c (diff)
Core/MMAPs: Restore single slope angle of 55°
Re-generating MMAPs IS required. Partially reverts 995a443da219ec773febd7dd29d18f3cefaa1f3b . 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).
-rw-r--r--src/common/Collision/Maps/MapDefines.h2
-rw-r--r--src/tools/mmaps_generator/MapBuilder.cpp9
-rw-r--r--src/tools/mmaps_generator/MapBuilder.h2
-rw-r--r--src/tools/mmaps_generator/PathGenerator.cpp12
4 files changed, 7 insertions, 18 deletions
diff --git a/src/common/Collision/Maps/MapDefines.h b/src/common/Collision/Maps/MapDefines.h
index 877ab964f2f..8b093086a7f 100644
--- a/src/common/Collision/Maps/MapDefines.h
+++ b/src/common/Collision/Maps/MapDefines.h
@@ -22,7 +22,7 @@
#include "DetourNavMesh.h"
const uint32 MMAP_MAGIC = 0x4d4d4150; // 'MMAP'
-#define MMAP_VERSION 12
+#define MMAP_VERSION 13
struct MmapTileHeader
{
diff --git a/src/tools/mmaps_generator/MapBuilder.cpp b/src/tools/mmaps_generator/MapBuilder.cpp
index 6a947b905bc..83eec5eb222 100644
--- a/src/tools/mmaps_generator/MapBuilder.cpp
+++ b/src/tools/mmaps_generator/MapBuilder.cpp
@@ -33,7 +33,7 @@ namespace MMAP
{
MapBuilder::MapBuilder(Optional<float> maxWalkableAngle, Optional<float> maxWalkableAngleNotSteep, bool skipLiquid,
bool skipContinents, bool skipJunkMaps, bool skipBattlegrounds,
- bool debugOutput, bool bigBaseUnit, bool smallOutputSize, int mapid, char const* offMeshFilePath) :
+ bool debugOutput, bool bigBaseUnit, int mapid, char const* offMeshFilePath) :
m_terrainBuilder (nullptr),
m_debugOutput (debugOutput),
m_offMeshFilePath (offMeshFilePath),
@@ -43,7 +43,6 @@ namespace MMAP
m_maxWalkableAngle (maxWalkableAngle),
m_maxWalkableAngleNotSteep (maxWalkableAngleNotSteep),
m_bigBaseUnit (bigBaseUnit),
- m_smallOutputSize (smallOutputSize),
m_mapid (mapid),
m_totalTiles (0u),
m_totalTilesProcessed(0u),
@@ -605,9 +604,7 @@ namespace MMAP
delete[] triFlags;
rcFilterLowHangingWalkableObstacles(m_rcContext, config.walkableClimb, *tile.solid);
- // disabled by default as it ignores walkableSlopeAngle settings
- if (m_smallOutputSize)
- rcFilterLedgeSpans(m_rcContext, tileCfg.walkableHeight, tileCfg.walkableClimb, *tile.solid);
+ rcFilterLedgeSpans(m_rcContext, tileCfg.walkableHeight, tileCfg.walkableClimb, *tile.solid);
rcFilterWalkableLowHeightSpans(m_rcContext, tileCfg.walkableHeight, *tile.solid);
// add liquid triangles
@@ -1027,7 +1024,7 @@ namespace MMAP
config.ch = tileConfig.BASE_UNIT_DIM;
// Keeping these 2 slope angles the same reduces a lot the number of polys.
// 55 should be the minimum, maybe 70 is ok (keep in mind blink uses mmaps), 85 is too much for players
- config.walkableSlopeAngle = m_maxWalkableAngle ? *m_maxWalkableAngle : m_smallOutputSize ? 55 : 85;
+ config.walkableSlopeAngle = m_maxWalkableAngle ? *m_maxWalkableAngle : 55;
config.walkableSlopeAngleNotSteep = m_maxWalkableAngleNotSteep ? *m_maxWalkableAngleNotSteep : 55;
config.tileSize = tileConfig.VERTEX_PER_TILE;
config.walkableRadius = m_bigBaseUnit ? 1 : 2;
diff --git a/src/tools/mmaps_generator/MapBuilder.h b/src/tools/mmaps_generator/MapBuilder.h
index 09b942e63cb..f2c20cd1d43 100644
--- a/src/tools/mmaps_generator/MapBuilder.h
+++ b/src/tools/mmaps_generator/MapBuilder.h
@@ -103,7 +103,6 @@ namespace MMAP
bool skipBattlegrounds = false,
bool debugOutput = false,
bool bigBaseUnit = false,
- bool smallOutputSize = false,
int mapid = -1,
char const* offMeshFilePath = nullptr);
@@ -166,7 +165,6 @@ namespace MMAP
Optional<float> m_maxWalkableAngle;
Optional<float> m_maxWalkableAngleNotSteep;
bool m_bigBaseUnit;
- bool m_smallOutputSize;
int32 m_mapid;
diff --git a/src/tools/mmaps_generator/PathGenerator.cpp b/src/tools/mmaps_generator/PathGenerator.cpp
index 9967f5bf256..685542cc802 100644
--- a/src/tools/mmaps_generator/PathGenerator.cpp
+++ b/src/tools/mmaps_generator/PathGenerator.cpp
@@ -84,7 +84,6 @@ bool handleArgs(int argc, char** argv,
bool &debugOutput,
bool &silent,
bool &bigBaseUnit,
- bool &smallOutputSize,
char* &offMeshInputPath,
char* &file,
unsigned int& threads)
@@ -242,10 +241,6 @@ bool handleArgs(int argc, char** argv,
offMeshInputPath = param;
}
- else if (strcmp(argv[i], "--smallOutputSize") == 0)
- {
- smallOutputSize = true;
- }
else
{
int map = atoi(argv[i]);
@@ -300,15 +295,14 @@ int main(int argc, char** argv)
skipBattlegrounds = false,
debugOutput = false,
silent = false,
- bigBaseUnit = false,
- smallOutputSize = false;
+ bigBaseUnit = false;
char* offMeshInputPath = nullptr;
char* file = nullptr;
bool validParam = handleArgs(argc, argv, mapnum,
tileX, tileY, maxAngle, maxAngleNotSteep,
skipLiquid, skipContinents, skipJunkMaps, skipBattlegrounds,
- debugOutput, silent, bigBaseUnit, smallOutputSize, offMeshInputPath, file, threads);
+ debugOutput, silent, bigBaseUnit, offMeshInputPath, file, threads);
if (!validParam)
return silent ? -1 : finish("You have specified invalid parameters", -1);
@@ -333,7 +327,7 @@ int main(int argc, char** argv)
return silent ? -5 : finish("Failed to load LiquidType.dbc", -5);
MapBuilder builder(maxAngle, maxAngleNotSteep, skipLiquid, skipContinents, skipJunkMaps,
- skipBattlegrounds, debugOutput, bigBaseUnit, smallOutputSize, mapnum, offMeshInputPath);
+ skipBattlegrounds, debugOutput, bigBaseUnit, mapnum, offMeshInputPath);
uint32 start = getMSTime();
if (file)