1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 12:19:55 +00:00
Commit graph

52 commits

Author SHA1 Message Date
elsid
a73ffc25c3
Add missing synchronization for present tiles modification
insert/erase can be done from multiple threads simultaneously. mMutex is
already used to synchronize reads so use it for writes too.
2021-05-17 17:44:31 +02:00
elsid
59f89d22f8
Apply min distance only for not present tiles
To avoid waiting when navmesh update is triggered by transformed object for
already present tiles.
2021-05-14 22:41:11 +02:00
elsid
d0ea9c482a
Reorder async navmesh updater jobs when player tile changes
When player tile changes distance to player that is part of jobs priority is
invalidated. So jobs are no longer in the right order. This can lead to
processing of farests tiles first.

Sort queue each time player tile is changed.
2021-05-14 22:41:05 +02:00
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.
2021-05-05 19:44:16 +02:00
elsid
f169f8e6f0
Wait until navmesh is generated for interior cells
Add special loading progress bar.

It should be fast enough to not keep loading screen for noticably long but
will provide better pathfinding for actors inside interior cells.
2021-05-05 19:27:49 +02:00
jvoisin
d4d111a709 Don't use std::move on const 2021-05-02 15:50:44 +02:00
elsid
3e67f5ffa5
Detect and ignore updates for oscillating objects
To avoid triggering NavMesh update when RecastMesh change should not change
NavMesh.

Based on the following assumption:
Given a set of transformations and a bounding shape for all these
tranformations, a new object transformation that does not change this
bounding shape also should not change navmesh if for all of this object
transformations resulting navmesh tiles are equivalent

The idea is to report back to RecastMeshManager all changes of NavMesh if there
are any assiciated with RecastMesh version. So we know the last time when
RecastMesh change resulted into the NavMesh change. When later report shows
that there was no NavMesh change for a new RecastMesh version we can assume
that any object transformation within the same bounding box should not change
NavMesh.
2021-04-18 23:00:13 +02:00
elsid
ab8d1c02d4
Set idle priority for navmesh generation thread
Support Linux, Windows, FreeBSD.
2021-04-14 21:39:06 +02:00
Bret Curtis
62b0781f7d use std::optional instead of boost::optional 2020-10-25 00:33:41 +02:00
psi29a
9a912486f9 Merge branch 'deprecated-exception' into 'master'
Use C++11 exception specification

See merge request OpenMW/openmw!343
2020-10-13 13:31:48 +00:00
fredzio
460e69e92a Get rid of warning: dynamic exception specifications are deprecated 2020-10-10 12:12:55 +02:00
elsid
f637dc38bd
Add cached flag to update navmesh status 2020-10-08 19:55:55 +02:00
elsid
eb140ed15f
Write unknown status numeric value 2020-10-08 19:55:55 +02:00
elsid
b150d681a9
Update same navmesh tile with limited frequency 2020-05-01 18:05:58 +02:00
elsid
bd1ef4dd6d
Add detournavigator test for multiple worker threads 2020-04-26 22:00:55 +02:00
elsid
7502db1570
Add number of thread jobs to update jobs stats 2020-04-25 17:51:50 +02:00
elsid
7729e396b2
Fix exceptions logging 2019-11-30 10:33:14 +01:00
Andrei Kortunov
6832a2fa9a Remove BOM from CPP files (allows to build OpenMW with LCC on Elbrus) 2019-05-21 19:22:34 +04:00
elsid
c683dc8565
Lock navmesh tile by thread while processing
To avoid duplicated work on a same tile by different threads.
If tile is locked by another thread, then post job into this thread queue.
2019-04-10 22:01:50 +02:00
Andrei Kortunov
14b756a692 Use a generic logging system for RecastNavigation 2019-04-08 20:31:21 +04:00
elsid
4624f31788
Report navigator stats 2019-03-17 22:15:18 +03:00
Bret Curtis
cb1a5f3679
Merge pull request #2245 from elsid/navigator_refactor
Refactor navigator related code
2019-03-11 07:51:43 +01:00
elsid
ece111d05a
Check for jobs using predicate 2019-03-10 23:58:49 +03:00
elsid
614d5243c3
Make NavMeshCacheItem consistent
Move all logic related to this type into its methods.
2019-03-10 23:07:36 +03:00
elsid
f6a1d3cecf
Store weak pointers to navmesh in jobs queue
To avoid useless processing for removed navmeshes.
2019-03-10 17:06:19 +03:00
elsid
ccc709a316
Store guarded navmesh cache item in shared_ptr
Remove useless SharedGuarded type.
2019-03-10 17:06:19 +03:00
elsid
ff47df4f2c
Repost navmesh update jobs when failed because of out of memory
DT_OUT_OF_MEMORY error is returned when limit of tiles is reached.
2019-03-08 17:39:04 +03:00
elsid
82e2739bae
Notify workers when only at least one job is posted 2019-03-08 15:27:16 +03:00
elsid
b9b8ed177c
Store priority values as named fields 2019-03-08 15:23:36 +03:00
elsid
0c16fef285
Add navmesh update status builder 2019-03-08 15:07:07 +03:00
Andrei Kortunov
3032b177a1 Remove redundant includes 2019-02-23 08:02:12 +04:00
elsid
dc2eb2e16b
Do not write to global log async navmesh updater exceptions 2018-10-15 22:47:07 +03:00
elsid
e57504ae7c
Lower log level 2018-10-13 22:22:15 +03:00
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.
2018-10-13 22:22:12 +03:00
elsid
ae7285e960
Use ScopeGuarded instead of raw mutex 2018-10-13 22:16:35 +03:00
elsid
7c80bb9411
Support multiple threads for async nav mesh updater 2018-10-13 22:16:34 +03:00
elsid
346e9e3141
Add off mesh connections for doors without teleport 2018-10-13 22:16:33 +03:00
elsid
c771986c56
Prioritise NavMesh jobs first to remove and last to add
When player move fast enough, tiles update for specific area square
couldn't catch player move. Tiles to be removed are left in the queue
with lower priority then tiles to be added which are nearest to player.
This can lead to overflow for amount of tiles. So we try to do remove
first. But we detect change type approximately using mixed change type,
because even if we do it precise, change type could change while job
is in queue.
2018-10-13 22:16:31 +03:00
elsid
144e1a063b
Support animated objects 2018-10-13 22:16:30 +03:00
elsid
4aba0fa85f
Limit number of NavMesh tiles to add by distance from player tile 2018-10-13 22:16:30 +03:00
elsid
d2fd9abd51
Split RecastMesh into tiles 2018-10-13 22:16:30 +03:00
elsid
dbb1d99bff
Add NavMeshItem generation to fix update NavMesh for render 2018-10-13 22:16:30 +03:00
elsid
f268ec5d34
Measure total time for NavMesh build from first pop 2018-10-13 22:16:29 +03:00
elsid
c26773bd29
Log update NavMesh status 2018-10-13 22:16:29 +03:00
elsid
dd5f4498f6
Increment NavMesh revision on remove or add tile 2018-10-13 22:16:29 +03:00
elsid
70a369f70e
Add command to enable NavMesh render
togglenavmesh or tnm
2018-10-13 22:16:28 +03:00
elsid
1caa18bb4f
Use one recast mesh for all jobs 2018-10-13 22:16:27 +03:00
elsid
373adc6ec4
Option to enable/disable file names revisions 2018-10-13 22:16:27 +03:00
elsid
d1d034a1ec
Update NavMesh one by one tile in order from nearest to player 2018-10-13 22:16:26 +03:00
elsid
41caca24ee
Options to enable/disable write recast mesh and nav mesh into file 2018-10-13 22:16:26 +03:00