From 3947e4cb57d4c6adb78cd3cb52718bb88add91fc Mon Sep 17 00:00:00 2001 From: jackpoz Date: Sat, 10 Oct 2020 23:03:09 +0200 Subject: Core/MMAPs: Restore single slope angle of 55° MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- src/tools/mmaps_generator/MapBuilder.cpp | 9 +++------ src/tools/mmaps_generator/MapBuilder.h | 2 -- src/tools/mmaps_generator/PathGenerator.cpp | 12 +++--------- 3 files changed, 6 insertions(+), 17 deletions(-) (limited to 'src/tools') 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 maxWalkableAngle, Optional 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 m_maxWalkableAngle; Optional 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) -- cgit v1.2.3