elsid
39c0ce9ddf
Build limited path for far destinations
...
When distance between start and end point is greater than max radius of area
possibly covered by navmesh there is no way to find path via navmesh. Also if
distance is greater than cell size navmesh might not exists withing mentioned
area because cell is not loaded therefore navmesh is not generated. So minumum
of these values is used to limit max path distance. Assuming that path
actually exists it's possible to build path to the edge of a circle. When
actor reaches initial edge path is built further. However it will not be
optimal.
4 years ago
Evil Eye
eb07818f13
Ignore agents without bounding boxes
4 years ago
psi29a
937549c99e
Merge branch 'fix_still_actors' into 'master'
...
Make actor flee from a combat when cannot reach a target (#5851 )
See merge request OpenMW/openmw!601
4 years ago
elsid
bc67669a97
Comment unused argument
4 years ago
elsid
4983684fda
Fix implicit int to float conversion warning
4 years ago
elsid
bb0c478954
Add missing include and use std malloc and free
4 years ago
elsid
3a9b1ce63a
Use camel case for local constant
4 years ago
elsid
a7fe6c7ba1
Move duplicated usage patter of dtNavMeshQuery::findNearestPoly into a separate function
4 years ago
elsid
d3ab6c972f
Avoid set unused position from dtNavMeshQuery::findNearestPoly result
4 years ago
elsid
8dba61f7ae
Use navmesh raycast to find reachable position around target
4 years ago
elsid
68fe6b9114
Use only item size to check whether item fits cache
...
Item size has to be counted anyway and there is no reason to check only navmesh
data first.
4 years ago
elsid
3a2cea5271
Use raw recast mesh data and off mesh connections for navmesh key
...
Serialization into a vector of chars produces inconsistent results that leads
to reduced cache hit rate. Using a structured object is a more clear solution
and allows to remove serialization and nontrivial key compare logic with more
straigt forward structured object comparison.
4 years ago
elsid
ad1f8c1e84
Sort water and off mesh connections for recast mesh
...
Inconsisten order of these objects in navmesh cache key leads to cache misses
due to key inequality.
4 years ago
elsid
489107c5ee
Count navmesh cache key once in item size
...
Key is stored only in NavMeshTilesCache::Item, TileMap uses KeyView with
a pointer to a vector.
4 years ago
elsid
88ca4a1db6
Count navmesh cache hit rate
4 years ago
elsid
d2d8a7a940
Fix passing null to memcpy
...
/home/elsid/dev/openmw/components/detournavigator/navmeshtilescache.cpp:36:24: runtime error: null pointer passed as argument 2, which is declared to never be null
#0 0x55e37ba4cda5 in makeNavMeshKey /home/elsid/dev/openmw/components/detournavigator/navmeshtilescache.cpp:36
#1 0x55e37ba4cda5 in DetourNavigator::NavMeshTilesCache::set(osg::Vec3f const&, osg::Vec2i const&, DetourNavigator::RecastMesh const&, std::vector<DetourNavigator::OffMeshConnection, std::allocator<DetourNavigator::OffMeshConnection> > const&, DetourNavigator::NavMeshData&&) /home/elsid/dev/openmw/components/detournavigator/navmeshtilescache.cpp:81
#2 0x55e37fe3c861 in DetourNavigator::updateNavMesh(osg::Vec3f const&, DetourNavigator::RecastMesh const*, osg::Vec2i const&, osg::Vec2i const&, std::vector<DetourNavigator::OffMeshConnection, std::allocator<DetourNavigator::OffMeshConnection> > const&, DetourNavigator::Settings const&, std::shared_ptr<Misc::ScopeGuarded<DetourNavigator::NavMeshCacheItem> > const&, DetourNavigator::NavMeshTilesCache&) /home/elsid/dev/openmw/components/detournavigator/makenavmesh.cpp:582
#3 0x55e37fb796ce in DetourNavigator::AsyncNavMeshUpdater::processJob(DetourNavigator::AsyncNavMeshUpdater::Job const&) /home/elsid/dev/openmw/components/detournavigator/asyncnavmeshupdater.cpp:178
#4 0x55e37fb9a125 in DetourNavigator::AsyncNavMeshUpdater::process() /home/elsid/dev/openmw/components/detournavigator/asyncnavmeshupdater.cpp:144
#5 0x7f013f585c23 in execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:80
#6 0x7f013f8c63e8 in start_thread (/usr/lib/libpthread.so.0+0x93e8)
#7 0x7f013e91d292 in __GI___clone (/usr/lib/libc.so.6+0x100292)
4 years ago
Andrei Kortunov
8084a336b5
Replace zeroes and nulls by nullptrs
4 years ago
elsid
9b11b8a27b
Fix boundary check
4 years ago
Bret Curtis
0e0c091e15
add more optionals and casserts for windows
4 years ago
Bret Curtis
4a54d375cc
add cassert for windows
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
Bret Curtis
5a824d0333
components/compiler cleanup; also cleaned up related cascading warnings; fixed up final/override issues
4 years ago
Assumeru
72549651e0
Rework container resolution ( #3006 )
...
* Rework container resolution
* add optional argument to getCount
* remove now-redundant changes
* undo worldimp changes
* move save-fixing code to InventoryState
* replace Rng instances with Seeds
4 years ago
psi29a
9a912486f9
Merge branch 'deprecated-exception' into 'master'
...
Use C++11 exception specification
See merge request OpenMW/openmw!343
4 years ago
fredzio
460e69e92a
Get rid of warning: dynamic exception specifications are deprecated
4 years ago
elsid
7591d45008
Use memcpy to create navmesh key
...
Implementation with memcpy is ~13 times faster.
4 years ago
elsid
f637dc38bd
Add cached flag to update navmesh status
4 years ago
elsid
eb140ed15f
Write unknown status numeric value
4 years ago
elsid
7d73e73cad
Consider tile as not removed when it is not found
4 years ago
psi29a
0dc7715c35
Merge branch 'object_paging_retry' into 'master'
...
Object Paging
See merge request OpenMW/openmw!209
5 years ago
elsid
00197e1cd9
Optimize recast mesh size by vertex deduplication
5 years ago
elsid
b095ca6c86
Use actor speed to define area cost for pathfinding
5 years ago
elsid
439588d10e
Remove unused mOffMeshConnectionIds
5 years ago
bzzt lost a hitlab login
c1ebd9474b
stop navmesh updates when ai off
...
Signed-off-by: Bret Curtis <psi29a@gmail.com>
5 years ago
elsid
c4cd3b2c4f
Add pathgrid to navmesh as off mesh connection
5 years ago
elsid
14d0ca4cd3
Cast float to btScalar
5 years ago
elsid
b150d681a9
Update same navmesh tile with limited frequency
5 years ago
elsid
10daadefbe
Add missing include
5 years ago
Bret Curtis
b7f7aabd8b
Merge pull request #2806 from elsid/detournavigator_tests
...
Add detournavigator test for multiple worker threads
5 years ago
elsid
899a6b5aa3
Workaround for GCC 5 bug
...
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61636
5 years ago
elsid
bd1ef4dd6d
Add detournavigator test for multiple worker threads
5 years ago
Alexei Dobrohotov
d42cb4f16d
Merge pull request #2805 from elsid/detournavigator_update_callback
...
Use callback to handle changed tiles
5 years ago
elsid
df6e85b619
Use callback to handle changed tiles
...
Instead of collecting changed tiles into a temporary vector.
5 years ago
elsid
7502db1570
Add number of thread jobs to update jobs stats
5 years ago
elsid
208a50340d
Specialize DetourNavigator::ObjectId ctor for pointers
...
To fix msvc error:
components\detournavigator\objectid.hpp(14,13): error C2440: 'reinterpret_cast': cannot convert from 'const T' to 'size_t'
with
[
T=unsigned long
]
5 years ago
Andrei Kortunov
2e7712a390
Fix C5204 warnings by adding default virtual destructors
5 years ago
elsid
5168f2059f
Compare revisions by equality to support overflow
5 years ago
elsid
7ae7cb181d
Support recast mesh rendering
5 years ago
elsid
349040ffb2
Use status codes to handle navigator errors instead of exceptions
...
For find path use case.
5 years ago
elsid
f7caeefddb
Fallback to straight path when navmesh and pathgrind are not available
5 years ago
elsid
1e106013a0
Use navmesh to find wander destination outside pathgrid for ground based actors
...
Use dtNavMeshQuery::findRandomPointAroundCircle from recastnavigation
5 years ago
Andrei Kortunov
3704acf857
Unify streams usage to support non-ASCII paths (bug #5239 )
5 years ago
Andrei Kortunov
cd81f81fb6
Initialize variables to avoid GCC warnings
5 years ago
elsid
7ec5a20c64
Filter recast mesh triangles by global bounding box
...
Except heightfields to reduce slow down.
5 years ago
elsid
7729e396b2
Fix exceptions logging
5 years ago
Andrei Kortunov
6832a2fa9a
Remove BOM from CPP files (allows to build OpenMW with LCC on Elbrus)
6 years ago
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.
6 years ago
Andrei Kortunov
14b756a692
Use a generic logging system for RecastNavigation
6 years ago
Bret Curtis
45221418bd
Merge pull request #2260 from elsid/fix_clean_unused_navmeshes
...
Fix clean unused navmeshes
6 years ago
elsid
4624f31788
Report navigator stats
6 years ago
elsid
8adc83f6e2
Fix clean unused navmeshes
...
weak_ptr doesn't have constructor for shared_ptr&& type, so ptr wasn't
moved, just copied.
6 years ago
elsid
dd0b45ede6
Do not pass nullptr to std::memcmp
6 years ago
Bret Curtis
cb1a5f3679
Merge pull request #2245 from elsid/navigator_refactor
...
Refactor navigator related code
6 years ago
Bret Curtis
7b793b8809
Merge pull request #2244 from elsid/navmesh_cache_item_refactor
...
Make NavMeshCacheItem consistent
6 years ago
elsid
68948bc847
Avoid key allocation to find tile in cache
6 years ago
elsid
849f2078c1
Swap outside critical section
6 years ago
elsid
8d2af94b75
Use default objects for NavigatorStub methods result
6 years ago
elsid
ece111d05a
Check for jobs using predicate
6 years ago
elsid
c05fc9e054
Add missing cleanup
6 years ago
elsid
ce9aebcba1
Clear all changed tiles after post
6 years ago
elsid
9d61c49478
Store key by reference in tiles map
6 years ago
elsid
614d5243c3
Make NavMeshCacheItem consistent
...
Move all logic related to this type into its methods.
6 years ago
elsid
f6a1d3cecf
Store weak pointers to navmesh in jobs queue
...
To avoid useless processing for removed navmeshes.
6 years ago
elsid
ccc709a316
Store guarded navmesh cache item in shared_ptr
...
Remove useless SharedGuarded type.
6 years ago
elsid
0479ebf5ae
Remove unused actors and navmeshes on update
...
When there is only one actor (player) on a scene and it moving to other
cell first it will be removed from navigator then added. Remove cause
navmesh removing for its half extents. After it is added navmesh for
same half extents is created and added. While this all happens there are
still jobs for old navmesh are processing. Old navmesh still exists
because it is stored by shared pointer. So jobs take tiles from cache
and place them into old navmesh. After that other jobs take same tiles
from cache (half extents and coordinates are equal) and place them into
other navmesh. dtNavMesh changes tile data on add and remove. Adding tile
to two dtNavMesh corrupts tile in both nameshes.
6 years ago
Bret Curtis
c20e69ef24
Merge pull request #2227 from elsid/fix_twitchy_massive_creatures
...
Fix twitchy movement for massive creatures (bug #4907 )
6 years ago
elsid
b9f21ec81a
Use custom steps size to make smooth path depending on half extents
6 years ago
elsid
f2e47d640d
Add option to limit max number of navmesh tiles
6 years ago
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.
6 years ago
elsid
82e2739bae
Notify workers when only at least one job is posted
6 years ago
elsid
b9b8ed177c
Store priority values as named fields
6 years ago
elsid
0c16fef285
Add navmesh update status builder
6 years ago
elsid
14c9190f49
Move tile replacement into separate function
6 years ago
elsid
b6243e7d1f
Fix name styleguide
6 years ago
elsid
27d7452267
Update scaled objects in navigator
6 years ago
Bret Curtis
14c93b3df0
Revert "Merge pull request #2204 from elsid/fix_navigator_update"
...
This reverts commit 26fb0e7a0f
, reversing
changes made to 42b2391303
.
6 years ago
elsid
133d7447f3
Update scaled objects in navigator
6 years ago
Grigory Latyshev
3872d7476b
Move makeOsgVec3f() to settingsutils.hpp
...
Remove all other makeOsgVec3f() implementations
6 years ago
Andrei Kortunov
3032b177a1
Remove redundant includes
6 years ago
elsid
73734fc04d
Fix update navmesh for not changed objects
...
When update method is called for not changed object befor this change
all object tiles were considered as not object tiles and were removed.
Also this marked those tiles as changed. This lead to alternation
between remove and add each tile update method was called. Problem was
detected by using Animated Containers mod.
6 years ago
Bret Curtis
09262e0336
Merge pull request #2170 from elsid/disable_navigator_option
...
Add option to disable DetourNavigator component (feature #4833 )
6 years ago
elsid
da6df818ff
Fix update navmesh
...
Every updated object should produce a set of changed tiles where it is
placed. Before this change only current object tiles were updated. If
object was moved to another set of tiles then navmesh were not changed
in new tiles.
TileCachedRecastMeshManager::updateObject should add all new tiles if object
was moved and remove all no more used tiles. Both new and old tiles should be
marked as changed.
Also add tests to show desired result for add, update, remove.
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
16675fd254
Return empty path when navmesh is not found for agent
6 years ago
elsid
1d3668cd22
Add Navigator interface
6 years ago
elsid
d63881e054
Make Navigator::findPath independent from class fields
6 years ago
elsid
a0ed981a7c
Fix operator ++ for OutputTransformIterator
6 years ago
elsid
c68e64a2a7
Make navigator from settings manager setting in separate function
6 years ago