Reserve poly group ID 1 (defined as DT_STRAY_POLY_GROUP) for unlinked poly's. The game skips all poly's that are marked 1. Previously, before this optimization, the AI would become stuck when they walk over an island who's poly's are marked 1 as we didn't take this engine feature into account in Recast.
- Recast will now render all poly's marked 'DT_STRAY_POLY_GROUP' as red.
- This patch also reduces the number of poly group id's and therefore reduces the overall size of the NavMesh.
Reachability table buffers were way larger than they should be due to an incorrect calculation of the buffer size. This bug fix reduced NavMesh sizes significantly (worlds edge '_small' was 200mb, and is now 20mb after this patch).
Tile width and height is determined by m_tileSize*m_cellSize. Also removed an extraneous clamp on tileBits; value is calculated with an rcMin value of 16.
DT_NODE_PARENT_BITS has been changed to 19 in r2 and r5. All bit masks align 1:1 after this change. DT_NODE_STATE_BITS is confirmed to be 2 by r2's implementation of dtNavMeshQuery::isInClosedList. dtNode::flags is 3 bits as the bitmask constants compiled in after changing DT_NODE_PARENT_BITS, are identical for all enumerants of dtNodeFlags.
In the game engine, dtNavMeshQuery::m_queryFilter doesn't exist (the class is exactly 0x60 in size, and all members are confirmed and used. In CAI_Pathfinder, the next member next to m_navQuery is a static m_navFilter, which aligned perfectly against dtNavMeshQuery). Passing the filter in manually is also a better approach anyways.
Edge verts were checked to the incorrect ones in findEdge and overlapEdges, edge verts have been flipped. Also added note for tri flipping in rcMergePolyMeshDetails (this function is currently unused, but if it ever gets used, the note's should be confirmed).
Properly flip edge vertices during the build. This also reduces the final mesh size, and significantly reduced the reachability table size (static pathing).
Allow the user to reconnect to a server by running 'reconnect', this also allows for reparsing all client side scripts while debugging the game on a dedicated server.
The code assumed an extension of 3 characters, but .gset is 4 and is also supported, causing a trailing '.' as it only truncates the training 4 characters (including the null char). The code now searches for the extension delimiter and gets the actual model name regardless of the length of presence of an extension.
Used by the engine for AI wall running, but also other AI logic like move direction. This probably is some cached ref pos + yaw to save on computation in the runtime, and probably used to lerp the AI to the correct direction before jumping. Current implementation seems very close to original navs now, though, the original navs appear to have some yaw angles being rotated a bit, probably manual adjustments to make the AI face a wall that isn't perpendicular.
Also implemented debug drawing for the new ref positions, and made the start circle of the off-mesh connection red, and the end position green to make it easy what is what in bidirectional connections.
The sizes were correct, but some of the field offsets weren't. CBaseCombatCharacter also contained fields specific to CPlayer, these have been moved to CPlayer. CBaseCombatCharacter now aligns on all classes deriving from it (CAI_BaseNPC, etc..). Classes now align properly in the disassembler. Also added more static assertions to prevent mistakes.
A mistake was made thinking this was part of the struct, but the real change is that m_queryFilter is static in r5 rather than a pointer. Changing this in Recast is a big change however; reverted changes made in 1255629fcf5a0b0ca2140309ca891c79e2f24738 and 9049e61d34cb3f52627b8ca10f1b7da21e147ad9.
pointers were also nulled during the memset after the move to the dtQueryStruct in commit 9049e61d34cb3f52627b8ca10f1b7da21e147ad9. Created dedicated 'Reset' method.
Make it more obvious what we are loading and what not (instead of checking if its client only, check if the server should load it since the client needs everything). This will also make sure that we never load other lumps even if they are present in the VPK or disk (they aren't for dedi builds).
The 2 fields are actually a CBitVec of 64 bits, which under the hood is split into 2 32bit unsigned integers. Type reversed from abstracted script functions 'NavMeshNode_GetBooleanData' and 'NavMeshNode_GetBooleanData'.