TITAN and GOLIATH had a small typo in their microluts, causing the lookup to be incorrect. Decimal 30 has bit 1 2 3 and 4 set, TITAN and GOLIATH could only use bit 4 and 5 which is what 30 in hex represents. This caused traverse types of type 1 2 and 3 to appear in TITAN and GOLIATH navmeshes.
The code originally did a 2D AABB, which has several negative effects. Its cheaper to calculate on load however the NavMesh results are less accurate as the boxes won't be subdivided on the Z axis during the build process. The second issue is that the raycast will query all overlapping triangles in a rectangle on a XY plane, for a detailed mesh, this could mean having to test over 1000 triangles for a simple ray cast accorss the geometry. A sample that collected 1000 triangles to test has been reduces to just 3 with this change. The build times have also been reduced by 50% (Kings Canyon NavMesh now builds in 32 minutes rather than 60+ minutes).
The NavMesh must be build with the actual radius and not its scaled extents. Titanfall 2 single-player NavMesh tile headers confirmed this. Also added a getter for the hull's radius.
The algorithm can create multiple portals of different traverse types between 2 specific polygons, this option allows the user to override this behavior by limiting this to 1.
16 was causing the clients to get kicked when they hover and moving their cursor over the characters in character select very fast. The scripts tell the server to update the view to other clients but unfortunately the system relies on string commands (ClientCommand) and is pending a rewrite to incorporate a proper RPC just like Server and UI has. For now we increase the limit to 32 as 32 is still outside the exploitable range when the game is ran without dev tools enabled.
Field name and field type were incorrectly set, GetServerByToken only returns 1 server and is always an object but it was always treated as an array of servers. Fixed field name and field type.
Out-of-band message ID 'N' is MatchInfo update (calls CHLClient::RemoteMatchInfoUpdated() which then calls UICodeCallback_RemoteMatchInfoUpdated. The RemoteMatchInfo data can be retrieved through script function GetRemoteMatchInfo()).
This code doesn't compile on VS2017 15.6 (does on 2019 and above). We also don't need to ABS; removed the ABS code as the code is currently only used for unsigned types and we probably do want to take the sign into account when getting mins/maxs from signed values too. If not then this could always be ABS'd by the caller to explicitly set the behavior.
CServer::GetClient() will never return NULL as it returns address of client in array. Removed extraneous checks as its misleading, and added const where possible.
The rebuild was wrong, the reported issue was that during auto-aim, the rotation speed is higher than original with a weaker magnet. Since the dissasembly and decompile of this function wasn't correct, along with not being able to reproduce the issue locally, it was hard to debug the problem (the difference between the rebuild and the original implementation was very small, where only experienced players noticed it). Since I have concluded that we don't need this function rebuilt as nothing else in the function needed adjustments, we can therefore just hook it and add the multiplication scalars on the computed joy angles. This now seems to yield correct behavior based on new tests that were performed with these changes.
The loader no longer loads from WinMain as this caused problems during shutdown. It was switched back to LauncherMain with several adjustments to make it work perfectly for both initialization and shutdown.
Optimization by only calulcating it when its used to avoid calculating it for nothing when we end up moving to the next edge. This is only used when the link is established.
The rebuild should be correct, but to rule out any problems we might have after releasing this build, we should have a simple option to force the old implementation.
The game can now be ran fully offline by providing '-offline' to the command line arguments. The engine will auto execute 'system/autoexec_offline.cfg' which overrides other autoexecs to ensure the game runs offline. The system/autoexec_offline.cfg file only overrides the variables it sets.
CustomPakData_t::numHandles was never decremented on unload, causing pakId == PAK_INVALID_HANDLE to be true and triggering the assert. Due to this, we either never unload resources properly on subsequent unloads and loads, or we would run out of pak slots as numHandles will reach MAX_CUSTOM_PAKS. Also added a comment explaining why this loop isn't ran in reverse.
The prune code will prune everything marked unlinked, but unlinked means that that polygon doesn't link to another, it doesn't mean its useless. Therefore, if we have an island that is unlinked, but still want to keep it, we should be to. The polygon should only be considered dead when its unlinked and disabled, which only happens through the prune tool. This allows for pruning and cleaning single polygon navmeshes.
dtHint::triangle should be triangles as it can contain more than one triangle, renamed it to 'tris' to keep consistency with the rest of the code base. Also fixed its comment explaining what its size is.
Add more comments to describe what they do, Hull_s::scale is now confirmed to be extentScale as the game uses this to query points on the NavMesh, its also being used to build navmeshes based on the tile headers in Titanfall 2 navmeshes and their hull constants.
There was a bug where some rays went through triangles, albeit rare. The issue was that overlapping chunk indices were truncated if the number exceedes the maximum of the stack buffer. The intersection code was originally also written to ignore back faces, but we need back faces, the intersection code has been rewritten with a known robust algorithm and the index buffer has been increased and made static. The rays no longer go through triangles.
These new values give better results after commit 247a99765ce669434513558e44bba632a55135d1 and b41141018e9be3c28cdbc74d1fc7e3b8ec876c6d. The new cell heights can be used after we fixed the culling of neighbor spans. For the larger tile size: since we can only reliably link to neighbor tiles we need to increase the tile size to ensure full traverse link coverage. Respawn by default uses 512x512 tiles, however, given that a link can be as large as 2550.0 in world units, a tile size of 1024x1024 in the x-y plane should give more than enough room to connect links to their fullest extends to neighboring tiles when we also take the Z into consideration. This change greatly benefits traverse types that perform "ACCROSS" activities, e.g. flat traverse links.
This causes many problems in titanfall and apex maps due to the large voxel sizes we have to use to generate navmeshes. A single unwalkable voxel makes a large difference. disabling these feature results in much better results. The problems this test filters away can be fixed with setting proper cell heights in our case.
Fixes https://github.com/recastnavigation/recastnavigation/issues/317. This can happen when we mave multiple spans in the X row. So far this crash only occured in Capitol City in Apex Legend's Worlds Edge map, where there are internal polygons in high rise buildings with 10 or more floors equally placed on top of another.