aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2020-10-10 23:03:09 +0200
committerShauren <shauren.trinity@gmail.com>2022-01-04 20:44:02 +0100
commit3820aabcd8874e51e42ac305ef9de551e8b22175 (patch)
treee944f2d6f1391dc4fb8e11952174869cf22ffc55 /src
parentddcbc01a65a3c8aff1248354f5c900faf719cc4a (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). (cherry picked from commit 3947e4cb57d4c6adb78cd3cb52718bb88add91fc)
Diffstat (limited to 'src')
-rw-r--r--src/common/Collision/Maps/MMapDefines.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/MMapDefines.h b/src/common/Collision/Maps/MMapDefines.h
index f681beb4bff..a88a3100107 100644
--- a/src/common/Collision/Maps/MMapDefines.h
+++ b/src/common/Collision/Maps/MMapDefines.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 b21461c3481..8a33fd61210 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
@@ -998,7 +995,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 8b6a18ef769..c67f660c37e 100644
--- a/src/tools/mmaps_generator/MapBuilder.h
+++ b/src/tools/mmaps_generator/MapBuilder.h
@@ -105,7 +105,6 @@ namespace MMAP
bool skipBattlegrounds = false,
bool debugOutput = false,
bool bigBaseUnit = false,
- bool smallOutputSize = false,
int mapid = -1,
char const* offMeshFilePath = nullptr);
@@ -170,7 +169,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 36df4e8f88b..b927cf067f5 100644
--- a/src/tools/mmaps_generator/PathGenerator.cpp
+++ b/src/tools/mmaps_generator/PathGenerator.cpp
@@ -108,7 +108,6 @@ bool handleArgs(int argc, char** argv,
bool &debugOutput,
bool &silent,
bool &bigBaseUnit,
- bool &smallOutputSize,
char* &offMeshInputPath,
char* &file,
unsigned int& threads)
@@ -266,10 +265,6 @@ bool handleArgs(int argc, char** argv,
offMeshInputPath = param;
}
- else if (strcmp(argv[i], "--smallOutputSize") == 0)
- {
- smallOutputSize = true;
- }
else if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-?"))
{
printf("%s\n", Readme);
@@ -379,15 +374,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);
@@ -420,7 +414,7 @@ int main(int argc, char** argv)
};
MapBuilder builder(maxAngle, maxAngleNotSteep, skipLiquid, skipContinents, skipJunkMaps,
- skipBattlegrounds, debugOutput, bigBaseUnit, smallOutputSize, mapnum, offMeshInputPath);
+ skipBattlegrounds, debugOutput, bigBaseUnit, mapnum, offMeshInputPath);
uint32 start = getMSTime();
if (file)