Commit Graph

27 Commits (master)

Author SHA1 Message Date
elsid a1438f65fe
Set proper max tiles on initializing navmesh settings 9 months ago
elsid 8544aa481c
Fix C4459 msvc warning
declaration of 'navMeshVersion' hides global declaration
3 years ago
elsid 1a12c453d6
Support different agent collision shape type for pathfinding
Actors may have different collision shapes. Currently there are axis-aligned
bounding boxes and rotating bounding boxes. With AABB it's required to use
bounding cylinder for navmesh agent to avoid providing paths where actor can't
pass. But for rotating bounding boxes cylinder with diameter equal to the front
face width should be used to not reduce of available paths. For example rats
have rotating bounding box as collision shape because of the difference between
front and side faces width.

* Add agent bounds to navmesh tile db cache key. This is required to distinguish
  tiles for agents with different bounds.
* Increase navmesh version because navmesh tile db cache key and data has changed.
* Move navmesh version to the code to avoid misconfiguration by users.
* Fix all places where wrong half extents were used for pathfinding.
3 years ago
elsid 5b9dd10cbe
Limit max navmeshdb file size
Use "pragma max_page_count" to define max allowed file size in combination with
"pragma page_size" based on a new setting "max navmeshdb file size".

* Stop navmeshtool on the first db error.
* Disable writes to db in the engine on first "database or disk is full"
  SQLite3 error. There is no special error code for this error.
* Change default "write to navmeshdb" to true.
* Use time intervals for transaction duration instead of number of changes.
3 years ago
elsid 96eb8d7be9
Write generated navmesh to navmeshdb
Perform all request to db in a single thread to avoid blocking navmesh
generator threads due to slow write operations.

Write to db navmesh for all changes except update as it done for memory cache.

Batch multiple db operations into a single transaction to speed up writing by
not executing fsync after each insert/update query. All reads are performed in
the same transaction so they see uncommited data.
3 years ago
elsid c9b8ba7b46
Read navmesh tile data from database
When tile is not found in memory cache try to find it in the database.
3 years ago
elsid 953a4c5550
Add a binary to generate navmesh from content files
Load content files based on the engine config files. Generate navmesh per cell
for all cells and store into SQLite database.
3 years ago
elsid 01c712d5f1
Split navigator settings into subtypes
Mostly to distinguish settings that affect properties of the generated navmesh.
3 years ago
elsid 9f808fbe3a
Move findPath-like navigator functions into a separate header 3 years ago
elsid 6986feb81b
Initialize navigator max climb and max slope settings in makeSettingsFromSettingsManager
To avoid having multiple places to initialize them when they will be required
by multiple binaries.
3 years ago
elsid 7a51d0db18
Wait until navmesh is generated within given distance around player
Add a setting to change this distance.

To prevent situations when there is not enough navmesh generated and actors
can't find path correctly.
4 years ago
elsid ec87b3f8f7
Remove redundant ChunkyTriMesh
This AABB tree required when need to filter out input mesh that has not
influence navmesh tile output. This filtering is already done before. Each
recast mesh corresponds to a single navmesh tile and has appropriate bounds.
4 years ago
Bret Curtis f6bead88a9 purge boost/optional.hpp headers 4 years ago
Bret Curtis 62b0781f7d use std::optional instead of boost::optional 4 years ago
elsid b150d681a9
Update same navmesh tile with limited frequency 5 years ago
elsid f2e47d640d
Add option to limit max number of navmesh tiles 6 years ago
elsid 9626b6ec42
Add option to disable DetourNavigator component to find paths 6 years ago
elsid 34c594f01e
Add default initializators for settings fields 6 years ago
elsid c68e64a2a7
Make navigator from settings manager setting in separate function 6 years ago
elsid abc51a8a17 Add settings option to set max number of polygons per navmesh tile 6 years ago
elsid ed73d130f9
Cache navmesh tiles
Use LRU modification to hold currently used items. Use RecastMesh binary
data for item key.

Store original pointer of btCollisionShape in user pointer to make available
it as an identifier within all duplicates. Use pointer to heights data array
for btHeightfieldTerrainShape.
6 years ago
elsid 7c80bb9411
Support multiple threads for async nav mesh updater 6 years ago
elsid c95cea414c
Support water for NavMesh 6 years ago
elsid ed3a255f65
Do not use NavMesh to find changed tiles 6 years ago
elsid 373adc6ec4
Option to enable/disable file names revisions 6 years ago
elsid 41caca24ee
Options to enable/disable write recast mesh and nav mesh into file 6 years ago
elsid fafba8ea0c
Use recastnavigation to find path 6 years ago