- rdCalcSubEdgeArea2D could return false when tmin > tmax, which prevents the link from being established, but tmin can be larger than tmax when the detail edge equals the main edge. The issue we wanted to prevent where the triangle had an inverted winding order has been fixed in commit 1e48d8abd9e604a384e65cf633b62f4e11737d35.
- In dtNavMesh::connectTraverseLinks, the extraneous dot product check has been removed; this is now handled by the user installed dtTraverseLinkConnectParams::getTraverseType and dtTraverseLinkConnectParams::getTraverseType.
- In dtNavMesh::connectTraverseLinks, when we ran out of links in the land tile, we would still continue the traversal of all its detail edges and polygons. We now break out of all loops to move on to the next tile as we can not establish any traverse link when there are no free ones available.
In commit a2d5d52dc4e571388b9b86f21e40a5110a69665e, the logic has been adjusted to build the polygon in the right order in the algorithm itself, but some indices are incorrect causing bad tesselation. The issue is somewhere in RecastMesh.cpp, writing polygon indices in the incorrect order '0, 3, 2, 1' instead of '3, 2, 1, 0'. Reverted to using "REVERSE_DIRECTION 0" for RecastMesh.cpp.
Additional notes, tesselation appears correct when building the mesh with the layered partitioner, monotone and watershed causes bad tesselation. The vertex order is however still incorrect.
Flood-fill assign instead to make sure all polygon islands are mapped to a contiguous range of group id's on the first pass. This is required as we will otherwise reach the DT_MAX_POLY_GROUP_COUNT limit on complex and large geometry before the prune pass while we don't have DT_MAX_POLY_GROUP_COUNT polygon islands inside the navmesh. Also implemented poly group overflow protection and simplified the API.
Defaults have been fine tuned and now generated much better results, especially in narrow area's such as small buildings and corridors. Previously, there usually were gaps in between door frames and tunnels.
Polyrefs may become invalid as we remove dead polygons and reindex the remainders. If the polyref is invalid, skip the link as it will be thrown out anyways. Issue was found using address sanitizer on level mp_rr_desertlands_64k_x_64k.
The algorithm goes over each polygon in the tile and only keeps polygons and associated data if they don't originate from an unlinked polygon island (DT_UNLINKED_POLY_GROUP). The algorithm also drops all data associated to the polygons such as the detail meshes, cells, links, verts and detail (if not used by other polygons), off-mesh links that are dead (not having the DT_POLYFLAGS_JUMP_LINKED flag), and rebuilds the BVTree.
This algorithm reduced the file size of a navmesh generated for the map mp_rr_desertlands_64k_x_64k by over 50% (209mb to 97mb) while keeping it functionally identical.
Some additional updates that were required to make this work:
* dtCalcTraverseTableSize now return NULL if there are 2 or less polygroups.
* unionTraverseLinkedPolyGroups will not run if parameters instruct it to collapse groups, it will also not run if the disjoint set doesn't contain any poly groups.
* dtCreateTraverseTableData will not allocate traverse tables if there are 2 or less polygroups, as dtCalcTraverseTableSize will now always return 0 in this case. This is an enforcement of an optimization from the engine itself as there is no point in allocating and doing lookups on a table with only 2 groups (unlinked and linked), and linked will always be reachable and unlinked can't be reached in the first place.
The reason why the BVTree's appeared under the polygon was because we were rendering and calculating them incorrectly. After fixing this, they now appeared above the polygons. This offset is not necessary as it causes BVTree's to build incorrectly.
Larger levels require watershed as some complex geometry (buildings with multiple floors) will exceed the maximum number of allowed sweep scans when building regions.
dtNavMesh::getTileCount returns the total number of added tiles, the issue with this is that if the navmesh gets pruned, that means disabling unlinked polygons and removing dead tiles, then some tile instances in the m_tiles array may become empty. Less tiles will be installed and since there are null tiles in between, we won't be traversing each tile.
Deduplicated mesh load function and implemented a simple type handler instead. Code can now load OBJ and PLY geometry from the user interface and project files.
dtNavMeshQuery::findNearestPoly can return an error flag, and the function cal also succeed while returning a NULL polyref. Both need to be checked before the algorithm is called. Also moved the memory allocation for flags inside this new check to avoid allocating for nothing.
These patches are no longer needed; the server and client already have the fatal error flag removed (process continues instead of hard erroring since script errors aren't fatal to the engine). The server also has its own routine within the function so client code never gets called.
The server needs these lumps in order to work. Any other lump not marked as SV should not be packaged into server VPK's as this will increase the install size (the server never parses them, as it doesn't need to render light maps for example).
Add "mp_rr_desertlands_holiday", remove "mp_rr_desertlands_64k_x_64k_tt". "mp_rr_desertlands_holiday" is the same as "mp_rr_desertlands_64k_x_64k_tt", but the BSP originates from a later version of the game, and the map has been fully ported over to R5Reloaded rendering "mp_rr_desertlands_64k_x_64k_tt" redundant.
Changing the load/unload system to FILO caused a crash when loading 3 level paks, either through request load or level settings, and then unloading them in reverse order. This is a regression caused when the pak loading and unloading system was reworked. Changing the system back to FIFO fixes the issue.
IsEULAUpToDate will always fail on dedicated servers as there is no user interface to display and accept the EULA (dedi's can also be ran without a terminal). The dedicated server users agree with the EULA upon launching the dedicated server.
Typically for dedicated servers you don't want any message boxes as they hang the process. The '-nomessagebox' helps solve this problem. Also removed extraneous check on MessageBoxA in EngineLoggerSink, we should always terminate regardless if MessageBoxA fails or not. The error will always be logged anyways.
Always terminate the process, MessageBoxA hangs the process anyways. If for some reason MessageBoxA fails then it will still terminate rather than continue and crash.
If the crash occurs during the initialization of systems, and Tier1 wasn't initialized yet, the system will display a prompt asking the user whether or not to send the reports. If the crash occurs after Tier1 was initialized, the system will check if the user has crash reporting enabled, and if the user has accepted the EULA before submitting it automatically.
The engine executable has been patched to no longer install this, therefore this function will never be called as we install a vectored exception filter anyways. This solves the issue where the crash message application gets called more than once when a crash occurs before the SDK detours are initialized.
Increase nesting limit to 128, this should make sure it will always be enough while also making sure no infinite recursions occur. Also improved error print formatting.