Commit Graph

578 Commits (22142668c7192b0c1bf90293edfd279411ada0b6)

Author SHA1 Message Date
elsid 6ae15f08e0
Avoid chained operator() calls to prevent formatting issues 2 years ago
Project579 5456ef1d50 Add new functions and overloads to support std::u8string and std::filesystem::path. 2 years ago
Project579 928b131564 Implement std::filesystem::path conversion tests. 2 years ago
Project579 a13709c510 Replace implicit convertions from std::filesystem::path to std::string with correctly converting functions. 2 years ago
Project579 864112b5db Fixed Windows build when using MSVC 14.26 and MacOS build. 2 years ago
Project579 e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2 years ago
Project579 cf0af87c80 Revert changes from "4c8e1ccf - Fixed windows build and updated tests to reflect changes of escape character from "&" to "\"" in "apps/openmw_test_suite/openmw/options.cpp" 2 years ago
Project579 cd229a965b Fixed windows build and updated tests to reflect changes of escape character from "&" to "\" 2 years ago
Project579 4bb07282c9 Replace all remaining occurrences of boost::filesystem with std::filesystem. 2 years ago
elsid 22ee592dd3
Lock TileCachedRecastMeshManager once per changing a cell
To save time on locking mutex and prevent AsyncNavMeshUpdater to use RecastMesh
for a tile in the middle of objects loading.
2 years ago
elsid d15e1dca84
Use R-tree for objects to be used for navmesh generation
Instead of storing a set of objects per tile.
2 years ago
psi29a fcd9b78cac Merge branch 'REFACTOR_STORE' into 'master'
Refactoring the ESM store to better support many new ESM4 types

See merge request OpenMW/openmw!2161
2 years ago
elsid 180d609e0d
Check "wait until min distance to player" only for requiredTilesPresent wait condition
allJobsDone should wait even if "wait until min distance to player" is 0.
2 years ago
elsid 204ab6fea3
Use version instead of generation and revision for recast mesh 2 years ago
florent.teppe 0dd529ab1d With the records include removed from store.hpp, need to include the relevant files accross the codebase.Lots of touched files, but very little done 2 years ago
elsid e2d566b89d
Store changed tiles in TileCachedRecastMeshManager 2 years ago
Evil Eye 02bbb0be45 Improve format workaround and add unit tests 2 years ago
elsid 948e2f5db9
Do not use collision shapes with visual only collision to generate navmesh
These collision shapes are not used for actors movement physics simulation.
2 years ago
Evil Eye 0df45a90b3 Use string_view in the remaining Class methods and push string_views closer to the MyGUI boundary 2 years ago
elsid 5dc612aa54
Replace ciCompareLen with ciStartsWith where possible
`ciCompareLen(a, b, b.size()) == 0` expression is an equivalent of checking for
equality of `a` prefix with size `b.size()` with `b`.

`ciCompareLen(a, b, a.size()) == 0` is also the same thing but `a` is a prefix
`b` should start with.
2 years ago
elsid e1bed86d7e
Do single navigator update per frame
Primarily for crossing cell border case. Each Navigator::update call has a cost.
Doing it multiple times per frame increased frame duration on cell loading.

Call Navigator::wait only when cell has changed but do not use
Scene::hasCellChanged because it doesn't always indicates it.
2 years ago
Evil Eye 51938f9ef7 Use string_view in Interpreter::Context 2 years ago
psi29a bb9884c024 Merge branch 'split_stringops' into 'master'
Split components/misc/stringops.hpp into multiple headers

See merge request OpenMW/openmw!2233
2 years ago
cody glassman ac4b29be08 cleanup default shaders and remove confusing main shader 2 years ago
psi29a 00f8c9760a Merge branch 'fixed_string_tests' into 'master'
Replace deprecated std::is_pod

See merge request OpenMW/openmw!2239
2 years ago
elsid 8e4f6fc4e4
Use FetchContent to get googletest 2 years ago
elsid f99ed6f1db
Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2 years ago
elsid da0a1ac9ba
Do compile time checks in compile time instead of tests 2 years ago
elsid c42c0dcbc9
Replace deprecated std::is_pod
apps/openmw_test_suite/esm/test_fixed_string.cpp:99:23: warning: ‘template<class _Tp> struct std::is_pod’ is deprecated: use is_standard_layout && is_trivial instead [-Wdeprecated-declarations]
   99 |      ASSERT_TRUE(std::is_pod<ESM::NAME>::value);
      |                       ^~~~~~
2 years ago
Andrei Kortunov 888f4d2ac1 Add a post processing API to work with fog 2 years ago
Andrei Kortunov c36c28e8f9 Move NIF implementation to cpp files 2 years ago
elsid 9398e97600
Avoid manual memory management for VFS archives 2 years ago
Petr Mikheev 8b8c304953 Treat empty `RootCollisionNode` in NIF as NCC flag and generate CameraOnly collision shape 3 years ago
elsid bef15edf0b
Remove redundant ostream, istream, iostream and sstream includes
* Replace by std::to_string and operator+ where possible.
* Move the code requiring to include <sstream> from .hpp to .cpp files.
3 years ago
elsid e074ebde96
Fix C4389 msvc warning
'==': signed/unsigned mismatch
3 years ago
elsid 2eae3227ba
Fix C4305 msvc warning
'argument': truncation from 'double' to 'float'
3 years ago
elsid 8544aa481c
Fix C4459 msvc warning
declaration of 'navMeshVersion' hides global declaration
3 years ago
elsid 7e6c13630a Use target_precompile_headers for the most expensive headers 3 years ago
elsid 10fbf170a2
Reduce number of includes for boost/program_options 3 years ago
Alexei Kotov e673f9fa76 Clean up NIF flags 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
Petr Mikheev 3bf18c601c Better fog 3 years ago
psi29a 9c1970dce4 Merge branch 'lua_esm' into 'master'
Advanced Lua scripts configuration in omwaddon

See merge request OpenMW/openmw!1947
3 years ago
psi29a c7449dc272 Merge branch 'bullet_includes' into 'master'
Clean up bullet includes

See merge request OpenMW/openmw!1974
3 years ago
Petr Mikheev a70d5831c5 Lua scripts configuration in omwaddon 3 years ago
jvoisin 72a6d1f69f Clean up bullet includes 3 years ago
elsid 3affe9913f
Limit the number of simultaneously open not actively used content files
Use LRU cache for ESMReaders. When cache capacity is reached close least
recently used ESMReader. Remember the file name if a reader was open. Once the
reader requested again open the file if there is stored name for it. Put
released ESMReader to the back of the free items list. Close ESMReader's from
the front of the free items list.

Cached item can be used only by one client at the same time. If the same item is
requested twice exception is thrown. This should never happen in practice. If
this happens need to fix the client logic.

It's allowed to go over the capacity limit when requesting different readers.
Ideally this should never happen but there will be system error anyway
signalizing about too many open files. Need to fix client logic in this case.

All places that were using a vector of ESMReaders now using the cache. Cache is
local for each use case and there is no need for a thread safety.
3 years ago
Petr Mikheev 709d186b8d Put tests output files to a separate dir 3 years ago
jvoisin cb226e00f9 Remove some more of boost:: 3 years ago
psi29a 499e688289 Merge branch 'fix_navigator_tests' into 'master'
Increase precision error for navigator tests (#6770)

Closes #6770

See merge request OpenMW/openmw!1909
3 years ago
psi29a a737b05d84 Merge branch 'faster_toLower' into 'master'
Improve the speed of toLower

See merge request OpenMW/openmw!1889
3 years ago
jvoisin 998f1c960e Improve the speed of toLower
This significantly improves the speed of my fuzzer,
by something like 15%.
3 years ago
elsid 87073e26f2
Increase precision error for navigator tests 3 years ago
cody glassman 6093cb5f2c postprocessing lua api extensions 3 years ago
psi29a f17d7fc00b Merge branch 'string_view' into 'master'
Make getStringLiteral return a string_view

See merge request OpenMW/openmw!1896
3 years ago
Evil Eye ac78b537d2 Address feedback 3 years ago
elsid 5269ba6f3c Fix warning: -Wunused-lambda-capture 3 years ago
Evil Eye c6ca0e78c9 Make getStringLiteral return a string_view 3 years ago
psi29a d3f331793e Merge branch 'sol' into 'master'
Update sol. Replace combined sol.hpp with loose files.

See merge request OpenMW/openmw!1851
3 years ago
ζeh Matt 18f16eac4c
Refactor DetourNavigator to pass prng along, use world prng for AiWander 3 years ago
psi29a f092d8da9a Merge branch 'post_malone' into 'master'
Post Processing

See merge request OpenMW/openmw!1124
3 years ago
Petr Mikheev d16fa553c8 Fix LuaUtil::Callback 3 years ago
cody glassman 04843fed6d moddable post-processing pipeline 3 years ago
elsid a75c7c49f0
Disable writes to navmeshdb on database is locked error
Simultaneously writing to sqlite3 database is not possible. Process exclusively
locks the database for this. Another process will fail to perform any request
when database is locked. Alternatively it can wait. Handling this situation
properly requires complexity that is not really needed. Users are not expected
to run multiple openmw processes simultaneously using the same navmeshdb.

Before this change running multiple openmw processes using the same navmeshdb
can lead to a crash when first transaction fails to start because there is
exception thrown and not catched.

Remove use of explicit transactions from DbWorker. Handling all possible
transaction states due to different errors brings unnecessary complexity.
Initially they were introduced to increase time between flushes to disk. This
makes sense for navmeshtool because of massive number of writes but for the
engine this is not an issue.
3 years ago
Petr Mikheev c7ab67c2c1 Allow relative paths in openmw.cfg; support --replace=config. 3 years ago
madsbuvi dc3045c970 mono-only version of the shader linking system introduced in the stereo MR 3 years ago
Petr Mikheev eae1e87081 [Lua] Update openmw.storage 3 years ago
psi29a f99f818c0c Merge branch 'esm4_cleanup' into 'master'
ESM4 cleanup

See merge request OpenMW/openmw!1792
3 years ago
elsid d71a1efa92
Rename components/esm4/acti.hpp -> components/esm4/loadacti.hpp 3 years ago
elsid 94c1d0cced
Use unique_ptr to store istream 3 years ago
psi29a c14796fc57 Merge branch 'ncc' into 'master'
#6496 Handle NCC flag in Nif files

See merge request OpenMW/openmw!1516
3 years ago
fredzio d05a2facf3 Handle NCC flag in Nif files. Objects with this flag will collide only with camera.
Expose objects with NC flag to be used by Lua mods.
3 years ago
Evil Eye 86d7f5a988 Fix tests 3 years ago
elsid fbc853804d
Fix recover from errors in Files::getHash 3 years ago
elsid b09570692e
Use ifstream for ESMReader
ESMReader reads the whole file, there is no need in the ConstrainedFileStream.
3 years ago
elsid 194c11f214
Fix loading order in EsmLoader
Need to load the last present record from a sequence of loaded records. That
means reverse should be called before unique or unique should be applied for
a reversed range. Since unique keeps only the first element from a sub
sequence of equal elements.

Use forEachUnique with reversed range to avoid redundant container
modifications.
3 years ago
elsid 4447ab0ed7
Remove ESM:: namespace qualifier in components/esm3/ and tests 3 years ago
elsid 5eb8c4aebe
Avoid redundant conversion to const char* and use make_shared 3 years ago
Benjamin Winger 21ffbcc4b4 Lua i18n updates 3 years ago
psi29a fc5605fc7f Merge branch 'navmeshtool_binary_log' into 'master'
Send status of navmeshtool to launcher using type binary messages

See merge request OpenMW/openmw!1630
3 years ago
Matt 49e21e121a Revert "Merge branch 'refactor/6677-2' into 'master'"
This reverts merge request !1733
3 years ago
psi29a ca77ae336f Merge branch 'refactor/6677-2' into 'master'
Introduce IndexedVector

See merge request OpenMW/openmw!1733
3 years ago
Matt 21e4c10fa9 Introduce IndexedVector 3 years ago
Eris Caffee 14b5bef64f Issue 6558 Move away from md5 in cmake
Updated CMakeLists.txt files to use sha512 instead of md5 to verify downloads
3 years ago
elsid 2d5ccc804b
Exchange binary messages between navmeshtool and launcher 3 years ago
psi29a 1f14f97d17 Merge branch 'navmeshdb_max_file_size' into 'master'
Limit max navmeshdb file size (#6649)

Closes #6649

See merge request OpenMW/openmw!1716
3 years ago
psi29a 6d55317d57 Merge branch 'refactor/prng-2' into 'master'
Save random state and refactor usage of generators

See merge request OpenMW/openmw!1715
3 years ago
ζeh Matt 769be88d43
Adjust DetourNavigatorNavigatorTest to the new prng values 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
Petr Mikheev fa115418eb [Lua] Remove queries 3 years ago
elsid 42d6032c8b
Support compilation with c++20 3 years ago
psi29a b03f9e430c Merge branch 'navmesh_disk_rm_unused_tiles' into 'master'
Add navmeshtool flag to remove unused tiles from navmesh disk cache

See merge request OpenMW/openmw!1671
3 years ago
psi29a 1c1581bdab Merge branch 'check_esm4_compilation' into 'master'
Check ESM4 compilation

See merge request OpenMW/openmw!1677
3 years ago
elsid 57c1f2e231
Make sure everything compiles in ESM4 3 years ago
elsid a7e76c6f3d
Remove redundant include 3 years ago
elsid ab1a6e034e
Add navmeshtool flag to remove unused tiles from navmesh disk cache
* Remove tiles outside processing range. Useful when new content profile map
  has different bounds.
* Remove ignored tiles. For a case when content profile maps have intersection
  but there is no more data for navmesh.
* Remove older tiles at the same worldspace position. If navmesh tile data has
  changed with new content, the old ones unlikely to be used.
* Vacuum the database when there are modifications. SQLite leaves empty pages
  in the file on database modification. Vacuum cleans up unused pages reducing
  the file size.
3 years ago
elsid 9584cb7ac2
Use fixed size types for serialization 3 years ago
elsid 875d9dcead
Fix buffer resizing by StatelessUtf8Encoder 3 years ago
elsid 3305b400dc
Use ESM::NAME instead of const char* and std::string as argument type 3 years ago
elsid 7884a01026
Add tests for Utf8Encoder 3 years ago
uramer ede9d27437 Element-wise multiplication and division of Lua vectors 3 years ago
Petr Mikheev a294adcdaf Proper support of `pairs` and `ipairs` in Lua; fix bug in `makeReadOnly`. 3 years ago
psi29a becffef142 Merge branch 'cull_navmesh_objects' into 'master'
Cull navmesh objects by scene bounds (#5858)

Closes #5858

See merge request OpenMW/openmw!1625
3 years ago
elsid 05b54cbfb8
Cull navmesh objects by scene bounds
If object is too big iteration over all tiles covering it can take too much
time. Limit bounds to a square around a player position to cover only tiles
that will be present in navmesh based on max tiles number option.

Each object is associated with a set of tiles its present in. Culling can
reduce this set but it has to be update when bounds change position. Do this
in TileCachedRecastMeshManager::setBounds updating the set and adding/removing
objects to the corresponding CachedRecastMeshManagers.
3 years ago
elsid 1b2954f2db
Remove unused z coordinate 3 years ago
elsid 542717394a
Remove objects, water and heightfields when no longer required 3 years ago
Petr Mikheev 5ca56a4f8a New option "config" for specifying additional config directories. 3 years ago
elsid 7ea5aa250b
Revert "Cull navmesh objects by scene bounds"
This reverts commit b0ef20c303.
3 years ago
elsid 45db56b382
Rework fixed string
* Avoid inheritance.
* Define equality operators out of the class definition.
* Replace toString with toStringView where it doesn't make sense to create a string.
3 years ago
elsid bf692a4bfa
Add more tests for fixed string 3 years ago
Bret Curtis 022fdc49a5 update tests to use esm3 rename 3 years ago
psi29a 84e209308d Merge branch 'refactor/interpreter' into 'master'
Cleanup interpreter code a bit

Closes #6553

See merge request OpenMW/openmw!1556
3 years ago
Matt 34723c8ea8 Cleanup interpreter code a bit 3 years ago
psi29a 6f7a067e0c Merge branch 'esmrename' into 'master'
esm refactor work

See merge request OpenMW/openmw!1575
3 years ago
psi29a 21ef9d4058 Merge branch 'nif_multi_parents' into 'master'
Support multiple parents for NIF nodes (#6552)

Closes #6552

See merge request OpenMW/openmw!1577
3 years ago
Evil Eye 903ef60f9d Merge branch 'navmesh_scene_bounds' into 'master'
Limit and filter navmesh input (#5858)

Closes #5858

See merge request OpenMW/openmw!1583
3 years ago
elsid ecc654a369 Limit and filter navmesh input (#5858) 3 years ago
psi29a fdc08cf01e Merge branch 'fix_storage' into 'master'
Fix heap use after free in components/lua/storage.cpp

See merge request OpenMW/openmw!1586
3 years ago
Petr Mikheev 067d71f7eb Fix heap use after free in components/lua/storage.cpp 3 years ago
Bret Curtis d1fb854521 move most of the files from esm to esm3, keep common code in esm; this is make space for a future with esm4
esm typo

esm typo
3 years ago
elsid 4b59ff2060
Include headers instead of source files 3 years ago
elsid 3f14011087
Support multiple parents for NIF nodes
Choose a parent base on which node is used to iterate over children nodes.
This leads to duplicate handing of child nodes. A node will be handled so many
times how many parents it has.

For example:
p1 p2
 \ /
  c

Will be handled as:
p1 p2
|  |
c  c

If c has children they will be handled X times c is handled.
3 years ago
uramer d1d8f058ac Lua bindings for Colours 3 years ago
uramer 886dee57ee Always use /bigobj, clean up scattered uses into one 3 years ago
uramer c07fb75bf7 Merge branch 'lua_settings' into 'master'
Permanent storage for Lua

See merge request OpenMW/openmw!1489
3 years ago
Petr Mikheev 97d56e198f Use double precision for vectors serialization in Lua 3 years ago
Petr Mikheev a182fdeea1 Permanent storage for Lua data 3 years ago
Petr Mikheev 2d1b100239 Change terminology of gameSecond/gameHour to simulationTime/gameTime 3 years ago
Josquin Frei d9672f7d46 Add serialization for TransformM and TransformQ 3 years ago
Petr Mikheev 0f246e7365 Use a separate instance of Lua i18n for every context 3 years ago
elsid aaf6c82e33
Do not write shapes to navmeshdb when writing is disabled 3 years ago
Petr Mikheev 7549496162 A few small fixes + expose makeReadOnly to Lua + an option to apply makeReadOnly during deserialize 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 5325495f46
Move serialization detournavigator/ -> components/ 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 33bb18850d
Move operator<< to debug.hpp 3 years ago
elsid 5a6b39f8e0
Store mesh source data in recast mesh 3 years ago
AnyOldName3 8fc09f8c51 Merge remote-tracking branch 'upstream/master' into detain-hash-selectively-reluctant
Merge conflicts included:
* One setting being removed (branch had changed its type).
* One setting's description being changed (branch had changed its type).
* List of files in components/files was changed both upstream and on the
  branch.
* Upstream had changed something in a file the branch deletes.
3 years ago
psi29a e04e139f37 Merge branch 'navmesh_raw' into 'master'
Add to navigator unmodified water and heightfield data

See merge request OpenMW/openmw!1373
3 years ago
Petr Mikheev d3df3efaf1 Precompile sol.hpp in order to reduce compilation time. 3 years ago
elsid 7dcb219ecf
Add raw heightfield data to navigator 3 years ago
elsid 8571c317d8
Add raw water data to navigator 3 years ago
elsid f4f4458d01
Calculate recast mesh bounds when building navmesh 3 years ago
elsid e10bbb9ad7
Shift heightfield and water in navigator tests 3 years ago
psi29a 7256654f29 Merge branch 'navmesh_render' into 'master'
Rework navmesh render (#6187)

See merge request OpenMW/openmw!1338
3 years ago
psi29a a332dec681 Merge branch 'fix_esm_loader' into 'master'
Load only supported content formats by EsmLoader

See merge request OpenMW/openmw!1427
3 years ago
psi29a a15cc0959f Merge branch 'murmur_hash' into 'master'
Use MurmurHash3_x64_128 for Files::getHash

See merge request OpenMW/openmw!1404
3 years ago
AnyOldName3 bc4b54157b Remove commented-out test conditions 3 years ago
elsid da0c5b54f0
Load only supported content formats by EsmLoader 3 years ago
AnyOldName3 84d6de3eba Parse paths with boost rules when it's quoted, but use the string verbatim when it's not 3 years ago
elsid 6b7363bd59
Replace generation and revision by version 3 years ago
elsid a665a38aca
Use MurmurHash3_x64_128 for file hash 3 years ago
Petr Mikheev f9136d4392 Support multiple arguments in Lua callbacks. 3 years ago
Petr Mikheev d5ca091d6e Make util.rotateX, util.rotateY, rotate.Z consistent with morrowind rotation 3 years ago
uramer 68963538ae Lua UI API 3 years ago
AnyOldName3 8fb0b5846e Allow paths with trailing data, emmitting a warning 3 years ago
Alexei Kotov 49544cf7de Merge branch 'no_one_likes_commas' into 'master'
Treat commas in scripts as whitespace

Closes #6380

See merge request OpenMW/openmw!1388
3 years ago
psi29a 41bd20e358 Merge branch 'bullet_shape_hash' into 'master'
Store BulletShape source file name and content hash

See merge request OpenMW/openmw!1379
3 years ago
Evil Eye bee94e2afc Treat commas in scripts as whitespace 3 years ago
elsid d7041613ef
Store BulletShape source file name and content hash 3 years ago
Cédric Mocquillon 512d64e514 Extract correctSoundPath method to avoid code duplication. Add unit test for the new method 3 years ago
elsid 9f808fbe3a
Move findPath-like navigator functions into a separate header 3 years ago
Bo Svensson 1960e976e2
refactors stringops.hpp (#3192)
With this PR we refactor `StringUtils::replaceAll` to accept `string_view` as suggested in a code comment. In addition, while we are touching this rebuild happy file, we slim it down a bit by moving a few sparingly used functions elsewhere.
3 years ago
Bo Svensson 4657c655b1 refactors parentFileIndices (#3211)
This PR aims to start addressing `ESM` design issues that have silenced errors we incorporated into groundcover `ESM` loading approaches.

- We move the resolution of `parentFileIndices` from `ESMStore` to `ESMReader` as suggested in a `TODO` comment.
- We improve a highly misleading comment which downplayed the significance of `parentFileIndices`.
- We document important preconditions.
- We move a user facing error message to the highest level and improve its context.
- We remove an inappropriate `setGlobalReaderList` method. We now pass this reader list into the method that requires it.
- We remove a thoroughly pointless optimisation of `Store<ESM::LandTexture>`'s construction that has unnecessarily depended on `getGlobalReaderList`.

There should be no functional changes for `master`, but this PR should remove an issue blocking PR #3208.
3 years ago
elsid 2b057f5c15
Expect nif node children to have parent 3 years ago
elsid 4e8e8304aa
Avoid mesh allocation when data is invalid 3 years ago
elsid 4631d95739
Add more tests for BulletNifLoader 3 years ago
psi29a 523289c531 Merge branch 'refactor_bullet_shape' into 'master'
Refactor bullet shape

See merge request OpenMW/openmw!1333
3 years ago
Evil Eye ae08f942d5 Test binary operators 3 years ago
Evil Eye 3c5a50cf90 Add issues from Redmine 3 years ago
Evil Eye 319d30fb85 Add AddTopic testing 3 years ago
Evil Eye b3208f4066 Add more issues and a forum thread 3 years ago
Evil Eye 8e0dfe3a8a Add tests for more issues 3 years ago
Evil Eye b2cdbe2e61 Add tests for certain issues 3 years ago
Evil Eye 3dada0796a Validate integer math 3 years ago
Evil Eye f027acf575 Move boilerplate to separate file 3 years ago
Evil Eye be759e576a Be sure to verify the opcode got executed 3 years ago
Evil Eye 6ad8549163 Allow validation of constant arguments 3 years ago
Evil Eye e1ac871672 Start adding compiler tests 3 years ago
elsid 8e71c246bf
Remove redundant BulletShape getters 3 years ago
elsid b905dd17c3
Use unique_ptr to store btCollisionShape in BulletShape 3 years ago
elsid 29a772c33f
Rename Resource::BulletShape::CollisionBox fields according to styleguide 3 years ago
Petr Mikheev 47c89567fb Load LuaScriptsCfg from both *.omwscripts and *.omwaddon files. 3 years ago
Petr Mikheev 9adc190209 Redesign LuaUtil::ScriptsContainer to work with ScriptsConfiguration 3 years ago
Petr Mikheev 33d71be81f Add LuaUtil::ScriptsConfiguration 3 years ago
elsid a58f1a94e3
Add helpers for binary serialization
To construct serializer from given entities:
* Data source/destination - any value that has to be serialized/deserialized,
  usually already existing type.
* Format - functional object to define high level serialization logic to
  define specific format and data schema. Like order of fields, allocation.
* Visitor - functional object to define low level serialization logic to
  operator on given data part.
  * BinaryWriter - copies given value into provided buffer.
  * BinaryReader - copies value into given destination from provided buffer.
  * SizeAccumulator - calculates required buffer size for given data.
3 years ago
psi29a 1ffa02b2fd Merge branch 'fix_windows_tests' into 'master'
Fix tests on windows

See merge request OpenMW/openmw!1313
3 years ago
elsid b5f0057ac9
Fix tests on windows 3 years ago
elsid a3b6bc7263
Fix logic expression for not found value 3 years ago
elsid e5413c0664
Add functions to compress/decompress vector of bytes 3 years ago
Petr Mikheev 17f7a1a2ea Merge branch 'fix_lua_test' into 'master'
Fix LuaUtilPackageTest.Transform

See merge request OpenMW/openmw!1302
3 years ago
elsid bb26ba30b6
Add progress reporter type
To log/report progress of long duration operations using given time period.
3 years ago
AnyOldName3 9be606a40d Finish removing old Escape classes 3 years ago
elsid 23026caacc
Fix LuaUtilPackageTest.Transform
It can fail due to float arithmetic precision with error:
Expected equality of these values:
  getAsString(lua, "moveAndScale")
    Which is: "TransformM{ move(6, 22, 18) scale(0.5, 1, 0.5) rotation(angle=8.53284e-17, axis=(1, 0, 0)) }"
  "TransformM{ move(6, 22, 18) scale(0.5, 1, 0.5) }"
3 years ago
elsid 046b5f83ee
Add ESM data loader
A component to load ESM content files with limited support for record types and
selection which of them to load. Supported record types are:
ACTI, CELL, CONT, DOOR, GMST, LAND, STAT.
3 years ago
elsid c88367b6a6
Add sqlite3 helpers 3 years ago
AnyOldName3 18869c2c75 Add some extra tests
The behaviour here is unchanged, but was previously untested.
3 years ago
AnyOldName3 7fb5b773dd Remove obsolete tests
The old behaviour was basically a bug and @ doesn't mean anything special now
3 years ago
AnyOldName3 1b83b08d80 Merge remote-tracking branch 'upstream/master' into detain-hash
Tests which no longer work are commented out.
Some of these don't work because they're effectively testing for the
presence of bugs in the old implementation.
Others don't work because we're no longer accidentally disabling the
boost::program_options feature where it generates an error if only part
of a token gets consumed.
These will be fixed by later commits.
3 years ago
AnyOldName3 af0d399103 Purge all uses of Escape Hash types 3 years ago
psi29a ae31138686 Merge branch 'options_tests' into 'master'
Add tests for openmw options

See merge request OpenMW/openmw!1253
3 years ago
florent teppe e5abadc234 Fix keyword search when the keyword is preceded by a non whitespace non alpha character 3 years ago
elsid 035307b012
Add tests for openmw options
In attempt to document current behaviour. Add commented out checks as desired
behaviour.
3 years ago
Petr Mikheev 48538d5cef 3D transforms in Lua 3 years ago
Evil Eye 2f4df12b2e Merge branch 'Fix_ASCII' into 'master'
Fixed an issue where keyword search expected the text to be all ASCII characters

See merge request OpenMW/openmw!1227
3 years ago
florent.teppe 2d32954888 Replaced Assert_true with expect_eq 3 years ago
florent.teppe 0e06e9b221 Removed useless comment and converted the file to UTF8 to keep special characters 3 years ago
florent.teppe c1c501ca35 Added test to make sure keyword search works even with non ascii characters 3 years ago
Petr Mikheev 2f25257a3e Move LuaState::makeReadOnly(sol::table) out of the class because it doesn't need to access LuaState internals. 3 years ago
elsid 6b7434ca69
Pass std::string_view instead of const std::string&
* Starting with Actor::getBodyPartMesh and ending with
  Misc::StringUtils::ciEqual.
* Add tests for Misc::StringUtils::ciEqual.
3 years ago
Petr Mikheev 33d4d88447 Function LuaUtil::toString 3 years ago
elsid fea4fb6e69
Make AiPursue path destination to be as close as possible to target
Even when target is not reachable actor will try to run there either because
target navmesh polygon is selected within extended area or because partial path
is built to the closest possible polygon.
3 years ago
psi29a 6595c731f7 Merge branch 'fix_rc_poly_mesh_flags_length' into 'master'
Fix flags length for rcPolyMesh

See merge request OpenMW/openmw!1134
3 years ago
elsid 54a676f2e3
Add functions to get length of recast type arrays
To avoid duplicating same formulas in multiple places.
3 years ago
elsid 05258ed644
Remove redundant TileCachedRecastMeshManager::hasTile function
It's used only for tests. getMesh is a valid replacement.
3 years ago
psi29a e10e9c0005 Merge branch 'navmesh_reduce_lock_wait' into 'master'
Reduce waiting duration on locks when updating navmesh object in the main thread (#6193)

Closes #6193

See merge request OpenMW/openmw!1079
3 years ago
Petr Mikheev 3ce5e9e680 Improve error messages in components/lua/serialization.cpp 3 years ago
elsid c8987bda2f
Store reference to BulletShapeInstance for btCollisionShape
To keep btCollisionShape lifetime.
3 years ago
elsid 4574e5f565
Remove redundant Navigator API functions 3 years ago
elsid 9a5ec5fd03
Store heightfields as array of heights instead of triangles
To reduce size of RecastMesh and therefore cache size.
3 years ago
elsid fdee9db20c
Consider RecastMeshManager not empty when there is water 3 years ago
elsid 5d6c93566d
Rename DetourNavigator::Water -> Cell 3 years ago
elsid 753767d6d9
Store only water shift
Rotation is not used.
3 years ago
elsid a1549321d7
Move Water struct out of RecastMesh class 3 years ago
elsid d60edb36aa
Make RecastMesh independent from recast scale factor
To avoid scaling until it's required by delaying coordinates conversion until
navmesh generation.
3 years ago
elsid af7059373c
Make RecastMesh independent from the order of RecastMeshBuilder calls
To make sure RecastMesh objects are equal if built with the same data but in
different order. Will be used later when there will be more than one place
building RecasMesh objects.
3 years ago
elsid f92843e3d2
Fix UB: reference binding to misaligned address in Lua tests
/home/elsid/dev/openmw/apps/openmw_test_suite/lua/test_serialization.cpp:166:34: runtime error: reference binding to misaligned address 0x562ea892076c for type 'const struct TestStruct1', which requires 8 byte alignment
0x562ea892076c: note: pointer points here
  00 74 73 31 00 00 00 00  00 00 f8 3f 00 00 00 00  00 00 04 40 21 79 4b 08  00 00 00 74 65 73 74 5f
              ^
    #0 0x562ea6462b8e in deserialize /home/elsid/dev/openmw/apps/openmw_test_suite/lua/test_serialization.cpp:166
    #1 0x562ea68b7402 in deserializeImpl /home/elsid/dev/openmw/components/lua/serialization.cpp:172
    #2 0x562ea68b7bf6 in deserializeImpl /home/elsid/dev/openmw/components/lua/serialization.cpp:204
    #3 0x562ea68b86ea in LuaUtil::deserialize(sol::state&, std::basic_string_view<char, std::char_traits<char> >, LuaUtil::UserdataSerializer const*) /home/elsid/dev/openmw/components/lua/serialization.cpp:251
    #4 0x562ea6464d96 in TestBody /home/elsid/dev/openmw/apps/openmw_test_suite/lua/test_serialization.cpp:197
    #5 0x562ea6d9dac6 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /home/elsid/dev/googletest/googletest/src/gtest.cc:2607
    #6 0x562ea6d9dac6 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /home/elsid/dev/googletest/googletest/src/gtest.cc:2643
    #7 0x562ea6d92e25 in testing::Test::Run() /home/elsid/dev/googletest/googletest/src/gtest.cc:2682
    #8 0x562ea6d92e25 in testing::Test::Run() /home/elsid/dev/googletest/googletest/src/gtest.cc:2672
    #9 0x562ea6d93024 in testing::TestInfo::Run() /home/elsid/dev/googletest/googletest/src/gtest.cc:2861
    #10 0x562ea6d93728 in testing::TestInfo::Run() /home/elsid/dev/googletest/googletest/src/gtest.cc:2834
    #11 0x562ea6d93728 in testing::TestSuite::Run() /home/elsid/dev/googletest/googletest/src/gtest.cc:3015
    #12 0x562ea6d94142 in testing::TestSuite::Run() /home/elsid/dev/googletest/googletest/src/gtest.cc:2994
    #13 0x562ea6d94142 in testing::internal::UnitTestImpl::RunAllTests() /home/elsid/dev/googletest/googletest/src/gtest.cc:5855
    #14 0x562ea6d9e096 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/elsid/dev/googletest/googletest/src/gtest.cc:2607
    #15 0x562ea6d9e096 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/elsid/dev/googletest/googletest/src/gtest.cc:2643
    #16 0x562ea6d93140 in testing::UnitTest::Run() /home/elsid/dev/googletest/googletest/src/gtest.cc:5438
    #17 0x562ea5d3fdc6 in RUN_ALL_TESTS() /home/elsid/dev/googletest/build/gcc/release/install/include/gtest/gtest.h:2490
    #18 0x562ea5d3fc6f in main /home/elsid/dev/openmw/apps/openmw_test_suite/openmw_test_suite.cpp:11
    #19 0x7fe3938d0b24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
    #20 0x562ea5d3fb7d in _start (/home/elsid/dev/openmw/build/gcc/ubsan/openmw_test_suite+0x173eb7d)

/home/elsid/dev/openmw/apps/openmw_test_suite/lua/test_serialization.cpp:176:34: runtime error: reference binding to misaligned address 0x562ea892078f for type 'const struct TestStruct2', which requires 4 byte alignment
0x562ea892078f: note: pointer points here
 75 63 74 32 04  00 00 00 03 00 00 00 04  00 6e 64 69 74 69 6f 6e  73 00 73 68 61 70 65 00  51 00 00
             ^
    #0 0x562ea6462df9 in deserialize /home/elsid/dev/openmw/apps/openmw_test_suite/lua/test_serialization.cpp:176
    #1 0x562ea68b7402 in deserializeImpl /home/elsid/dev/openmw/components/lua/serialization.cpp:172
    #2 0x562ea68b7bf6 in deserializeImpl /home/elsid/dev/openmw/components/lua/serialization.cpp:204
    #3 0x562ea68b86ea in LuaUtil::deserialize(sol::state&, std::basic_string_view<char, std::char_traits<char> >, LuaUtil::UserdataSerializer const*) /home/elsid/dev/openmw/components/lua/serialization.cpp:251
    #4 0x562ea6464d96 in TestBody /home/elsid/dev/openmw/apps/openmw_test_suite/lua/test_serialization.cpp:197
    #5 0x562ea6d9dac6 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /home/elsid/dev/googletest/googletest/src/gtest.cc:2607
    #6 0x562ea6d9dac6 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /home/elsid/dev/googletest/googletest/src/gtest.cc:2643
    #7 0x562ea6d92e25 in testing::Test::Run() /home/elsid/dev/googletest/googletest/src/gtest.cc:2682
    #8 0x562ea6d92e25 in testing::Test::Run() /home/elsid/dev/googletest/googletest/src/gtest.cc:2672
    #9 0x562ea6d93024 in testing::TestInfo::Run() /home/elsid/dev/googletest/googletest/src/gtest.cc:2861
    #10 0x562ea6d93728 in testing::TestInfo::Run() /home/elsid/dev/googletest/googletest/src/gtest.cc:2834
    #11 0x562ea6d93728 in testing::TestSuite::Run() /home/elsid/dev/googletest/googletest/src/gtest.cc:3015
    #12 0x562ea6d94142 in testing::TestSuite::Run() /home/elsid/dev/googletest/googletest/src/gtest.cc:2994
    #13 0x562ea6d94142 in testing::internal::UnitTestImpl::RunAllTests() /home/elsid/dev/googletest/googletest/src/gtest.cc:5855
    #14 0x562ea6d9e096 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/elsid/dev/googletest/googletest/src/gtest.cc:2607
    #15 0x562ea6d9e096 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/elsid/dev/googletest/googletest/src/gtest.cc:2643
    #16 0x562ea6d93140 in testing::UnitTest::Run() /home/elsid/dev/googletest/googletest/src/gtest.cc:5438
    #17 0x562ea5d3fdc6 in RUN_ALL_TESTS() /home/elsid/dev/googletest/build/gcc/release/install/include/gtest/gtest.h:2490
    #18 0x562ea5d3fc6f in main /home/elsid/dev/openmw/apps/openmw_test_suite/openmw_test_suite.cpp:11
    #19 0x7fe3938d0b24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
    #20 0x562ea5d3fb7d in _start (/home/elsid/dev/openmw/build/gcc/ubsan/openmw_test_suite+0x173eb7d)
4 years ago
elsid beeb882ea8
Do not use off mesh connections as a part of navmesh cache key
To reduce cache size and make it more flexible.

Adding off mesh connections to the navmesh is the last step of navmesh
generation and it's very fast comparing to other steps (microseconds vs
milliseconds). Having less cache size makes get and set operations almost 2x
times faster that also have an order of microseconds. So in total there is
no performance impact.
4 years ago
Petr Mikheev 702eb19271 Fixes and refactoring 4 years ago
Petr Mikheev b53667d555 Queries. Data structures and lua bindings. 4 years ago
Petr Mikheev 479856f812 Add components/lua/scriptscontainer and components/esm/luascripts 4 years ago
Petr Mikheev 8dbaf6022c Add components/lua/serilalization 4 years ago
Petr Mikheev 4b068b27ca Add components/lua/luastate and components/lua/utilpackage 4 years ago
elsid 09f9075842
Use RecastMeshBuilder once to create RecastMesh
This allows to move all data out of the object instead of copying.
4 years ago
elsid 84d6dea277
Inscribe physical bounding box into navmesh agent cylinder
To disallow too narrow navmesh for a bounding box.
4 years ago
elsid e9433a91fb
Add more tests for TileCachedRecastMeshManager 4 years ago
elsid d122e184cc
Report navmesh change for not posted tiles
Corresponding recast mesh tiles can be updated but navmesh tiles may never
appear for them. Report back zero navmesh version to allow oscillating recast
objects detection to work. This version is always less than any generated
navmesh tile version so any report for generated navmesh will override it.
If zero navmesh version is reported after recast mesh tile got report about
generated navmesh tile it is a no-op since generated version is always greater
than zero.
4 years ago
elsid 105cd5b06f
Add more checks to NavMeshTilesCache tests 4 years ago
psi29a e9fbd76e9b Merge branch 'windows_tests' into 'master'
Support running tests and benchmarks for windows

See merge request OpenMW/openmw!839
4 years ago
elsid 3ef1b27099
Add missing includes 4 years ago
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.
4 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 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.
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
psi29a 16bb3919d1 Merge branch 'navmesh_cache_simplification' into 'master'
Simplify navmesh cache

See merge request OpenMW/openmw!691
4 years ago
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.
4 years ago
elsid 8e1c92d9af
Use std::variant for ESM::Variant implementation 4 years ago
elsid 7f577f5f08
Do not compare hash in tests
Different std libraries have different implementation that produce different
results for the same values.
4 years ago