Commit Graph

254 Commits (master)

Author SHA1 Message Date
elsid d0bc1b75e8
Remove unused parameters 6 years ago
elsid c9f3064cbd
Update ObstacleCheck once per frame 6 years ago
elsid 6d89241178
Check is path completed by osg::Vec3f position 6 years ago
elsid 31340a212a
Fix functions name style 6 years ago
elsid 4d868bec92
Use osg::Vec3f to store path nodes in Pathfinder 6 years ago
Andrei Kortunov 70ed8fd1a9 Use constants instead of widely used magic numbers (task #4645) 6 years ago
Capostrophic 7ef6fa9f61 Remove deprecated GMST get* functions 6 years ago
Andrei Kortunov 5a4d0cec3a Use new logging system for game itself 6 years ago
Andrei Kortunov ee45f54b53 Refactor AiTemporaryStorage usage 7 years ago
Andrei Kortunov 2f5beb8853 Remove unnecessary hack 7 years ago
Andrei Kortunov 81f29d8dcd AiWander: resume moving to destination after combat 7 years ago
Andrei Kortunov 9d27eb197f AiWander: return to initial position only after combat 7 years ago
scrawl 99ffaafe30
Revert "Merge pull request #1701 from akortunov/standfix"
This reverts commit da47fc79f5, reversing
changes made to 7324bd368f.
7 years ago
Andrei Kortunov 3636cf2015 Do not apply queue movement for standing actors 7 years ago
Andrei Kortunov f7f8dfaf2a AiWander: do not allow flying/swimming creatures to use pathgrid 7 years ago
scrawl c50b18b3bb
Move PathgridGraph out of CellStore
By definition this is not 'Mutable state of a cell' and does not belong in CellStore.

This change should improve startup times (graph is now loaded on demand) and edits to 'pathgrid.hpp' no longer cause the entirety of OpenMW to be rebuilt.
7 years ago
Andrei Kortunov 9943bd4d74 AiWander fast forwarding improvements (bug #3638) 7 years ago
scrawl 03554b2f4b Fix some style issues flagged by cppcheck 7 years ago
Andrei Kortunov 91adfc9fc0 AiWander: reset spawn position, if an actor was moved to another cell (bug #4010) 7 years ago
elsid 748f5225a9 Copy PathFinder::mPath back value when pass to MWMechanics::AiPackage::pathTo as dest
May become dangling reference because method may remove all elements from mPath.
8 years ago
scrawl 333648c975 Merge pull request #1324 from akortunov/doorfix
Improved doors detection
8 years ago
Andrei Kortunov 37952c9a79 Added door detection based by ray casting 8 years ago
Allofich 4f08084e79 Make stationary actors return to position on load
Also makes wandering actors resume their previous destination when an interrupting combat or pursuit ends.

(Fixes #3656)
8 years ago
Ewan Higgs 38a2de3c51 convert std::autor_ptr to std::unique_ptr, originally by Ewan Higgs and updated by Bret Curtis 8 years ago
Allofich ff3e307059 Pass parameters by const reference 8 years ago
scrawl 29556a1802 More consistent wording of errors/warnings
A Warning indicates a potential problem in the content file(s) that the user told OpenMW to load. E.g. this might cause an object to not display at all or as intended, however the rest of the game will run fine.

An Error, however, is more likely to be a bug with the engine itself - it means that basic assumptions have been violated and the engine might not run correctly anymore.

The above mostly applies to errors/warnings during game-play; startup issues are handled differently: when a file is completely invalid/corrupted to the point that the engine can not start, that might cause messages that are worded as Error due to the severity of the issue but are not necessarily the engine's fault.

Hopefully, being a little more consistent here will alleviate confusion among users as to when a log message should be reported and to whom.
8 years ago
Aussiemon 2f66b91ac5 Added check to prevent attempted wandering of empty paths 8 years ago
Leon Krieg 739cd5ba45 Fixed more spelling mistakes 8 years ago
mrcheko a22fc43947 aiwander: reset path on cell change
remove redundant mIsWanderDestReady var
8 years ago
mrcheko 612c7f1a2f Revert "Revert "Merge pull request #993 from mrcheko/pathfinding""
This reverts commit 3732979eec.
8 years ago
scrawl 3732979eec Revert "Merge pull request #993 from mrcheko/pathfinding"
This reverts commit 5190275b37, reversing
changes made to d7845012bf.
9 years ago
scrawl 30b549124e Fix use-after-free 9 years ago
mrcheko d2fe6fe857 Merge remote-tracking branch 'refs/remotes/origin/master' into pathfinding
# Conflicts:
#	apps/openmw/mwmechanics/aiactivate.cpp
#	apps/openmw/mwmechanics/aicombat.cpp
#	apps/openmw/mwmechanics/aicombat.hpp
#	apps/openmw/mwmechanics/aifollow.cpp
#	apps/openmw/mwmechanics/aipackage.cpp
#	apps/openmw/mwmechanics/aipackage.hpp
#	apps/openmw/mwmechanics/aiwander.cpp
#	apps/openmw/mwmechanics/aiwander.hpp
9 years ago
mrcheko 0793e4a80e refactor pathfinding code in AiWander: use AiPackage::pathTo, reuse AiPackage::ObstacleCheck 9 years ago
Allofich c2b51112f2 AI package cleanups 9 years ago
Allofich 55ac1fab68 Change Wander duration to run on a counter 9 years ago
Allofich bce66c629a Change editor-placed AI packages to cycle 9 years ago
scrawl 5edfe8c41c Reduce the wander fast forward overcrowding offset (Fixes #3370) 9 years ago
Austin Salgat be16857f96 Fix wrong height being used for water detection 9 years ago
Austin Salgat e9157e9200 Fix idle animation and Fix water creature manual wandering 9 years ago
Austin Salgat 3dec10c686 Update variable to prevent underflowing
While not an issue presently, the variable may be used in the future in a way that could create issues if it underflows.
9 years ago
Austin Salgat 84179c262f Update manual wandering to prevent actor from leaving/entering water
Water creatures will stay in the water, while land creatures will stay on land when wandering.
9 years ago
Austin Salgat fc03216d48 Refactor to reuse existing obstacle detection 9 years ago
Austin Salgat 34726c24d9 Fix mDistance being reset prematurely
This was causing wandering without pathgrids to become disabled for most wandering units. Additionally, wandering now behaves the same for both NPCs and creatures.
9 years ago
Austin Salgat 92b352989a Add logic for NPC wandering without pathgrids 9 years ago
Austin Salgat c02881a4f8 Fix creatures not wandering 9 years ago
Austin Salgat 38f5a225ea Refactor PathFinder functions to be useable by AiWander
This avoids having to duplicate the distanceSquared and getClosestPoint functions.
9 years ago
Austin Salgat 96231e17f0 Fix wandering NPCs going off pathgrid
If multiple pathgrids exist in the same cell, sometimes an NPC would port to a different pathgrid that was nearby. This is an issue since it allowed them to do things like travel through walls to inaccessible areas. Now they will only wander along the closest connected pathgrid.
9 years ago
scrawl 90a99991d1 Use empty() instead of !size() 9 years ago
scrawl 50ed061154 AiWander: reset mAllowedNodes on cell change (Fixes #3176, Fixes #3130) 9 years ago
mrcheko d7d5cc6689 Merge remote-tracking branch 'upstream/master' into pathfinding
Conflicts:
	apps/openmw/mwmechanics/aicombat.cpp
	apps/openmw/mwmechanics/aifollow.cpp
	apps/openmw/mwmechanics/aipackage.cpp
	apps/openmw/mwmechanics/aipackage.hpp
	apps/openmw/mwmechanics/aiwander.cpp
	apps/openmw/mwmechanics/pathfinding.hpp

Ogre::Vector3->osg::Vec3f; REACTION_INTERVAL->AI_REACTION_TIME; MakeOgreVec3->MakeOsgVec3
9 years ago
dteviot 8e2fe1985d Fixed errors pointed out by Zini.
1. Removed "Actor" from name of function  isActorNearInactiveCell().
2. Corrected case of CoordinateConverter member function names.
9 years ago
dteviot 1dfe438a5d reduce "reset if stuck" AiWander timeout.
Now is about 14 seconds, instead of 300.
9 years ago
dteviot f2c9b9351f Try going right and left to "unstick" actor. 9 years ago
dteviot 31d82b6b0c Unifiy evadeObstacles() logic between AiWander and AiPackage
Can't use same code, but logic is now same.
9 years ago
dteviot f59e918a3b removed useless code.
zTurn ignores turns < 0.0087 radians.
9 years ago
Marc Zinnschlag a52b947efe Merge remote-tracking branch 'dteviot/MagicEffectsRefactorDraft3' 10 years ago
dteviot 77a1d947cc extracted MWMechanics::getPlayer() 10 years ago
dteviot 85bc41dedb replaced FLT_MAX with numeric_limits. 10 years ago
dteviot 942a987d52 centralize the world/cell coordinate conversion logic. 10 years ago
Arthur Moore 08d5aaf0fc Remove more comments 10 years ago
Arthur Moore 6fce49bfb5 Don't warn twice when unable to play an idle animation 10 years ago
Arthur Moore 61c3835637 Don't try to play animations we know are bad
Prevents log spam
10 years ago
Arthur Moore 5ea596f38d Refactor onChooseActionStatePerFrameActions
This prevents playIdle errors from tyring to play idleAnimation 0
10 years ago
Arthur Moore f69de1f263 Alert the user if trying to play a non-idle animation
Continue to propagate success/failure up the call stack.
10 years ago
dteviot c7aacaee70 extracted function returnToStartLocation(). 10 years ago
dteviot 5e519ef550 extract function isPackageFinished(). 10 years ago
dteviot ad0d807103 extracted function reactionTimeActions(). 10 years ago
dteviot 9c0e3d6c28 extracted functions doPerFrameActionsForState() and onChooseActionStatePerFrameActions(). 10 years ago
dteviot 76f95eafe7 extract function onWalkingStatePerFrameActions(). 10 years ago
dteviot 5ec310dfba extract function onIdleStatePerFrameActions(). 10 years ago
dteviot 00eef585af renamed mPlayedIdle to mIdleAnimation. 10 years ago
dteviot 22f49128cc replaced multiple booleans with single state variable. 10 years ago
dteviot 1ed6e95c07 Got rid of some radians to degrees to radians conversions. 10 years ago
dteviot 3ebe9fb34f renamed mRotate to mTurnActorGivingGreetingToFacePlayer 10 years ago
dteviot e294cd95cd extracted function playIdleDialogueRandomly() 10 years ago
dteviot 22059d68f6 Remove duplicated code. 10 years ago
dteviot 0b089a5564 extracted function evadeObstacles() 10 years ago
dteviot 1ef78b1e56 extracted playGreetingIfPlayerGetsTooClose() 10 years ago
dteviot df421fce92 extracted function setPathToAnAllowedNode() 10 years ago
dteviot b508846a64 Renamed mStoredAvailableNodes to mPopulateAvailableNodes.
Don't call getAllowedNodes() needlessly.
10 years ago
dteviot f1774ee7c3 Fixed compile failing on OSX and Linux. 10 years ago
dteviot 52cf8541f5 End point tolerance restored to 64 units.
Corrected problem pointed out by Scrawl.
Destination needs tolerance of 64 to avoid overcrowding.
10 years ago
dteviot 1239667cb4 AiWander uses points between PathGrid points (Fixes #1317)
When there is only on PathGrid point within a NPC's wander distance, expand possible wander destinations by using positions between PathGrid points.
10 years ago
dteviot eb2aa965b9 Extracted function SetCurrentNodeToClosestAllowedNode() 10 years ago
dteviot f942db2b27 Simplified code. 10 years ago
dteviot 9a02a85a24 Pulled duplicate code into function. 10 years ago
mrcheko c773ed9f9a move checkWayIsClear to pathfinding; move shortcut logic to separate func (AiPackage::shortcutPath); rework AiPackage::pathTo 10 years ago
dteviot fae93e3d82 Bugfix: was not resetting mStuckCount. 10 years ago
dteviot 46a654286b Remove fix for #1317
Expanding the AiWander distance for path grid nodes causes bigger problems than it solved.
10 years ago
dteviot 164994f3d3 Made PathFinder::buildPath() private.
Now all paths are built by calling PathFinder::buildSyncedPath().
Also removed useless comment.
10 years ago
scrawl 59db9664ba Pass the CharacterController to AiPackage::execute 10 years ago
scrawl a5670b5133 Merge branch 'master' of https://github.com/OpenMW/openmw into osg
Conflicts:
	apps/opencs/CMakeLists.txt
	apps/opencs/main.cpp
	apps/openmw/mwworld/player.hpp
10 years ago
dteviot c65e7a31e7 Aquatic creatures no longer try to get onto land.
AiWander for aquatic creatures no longer uses path grid points as they're usually on land.
10 years ago
scrawl 3663511cdb Merge branch 'master' of https://github.com/OpenMW/openmw into osg
Conflicts:
	apps/opencs/CMakeLists.txt
	extern/ogre-ffmpeg-videoplayer/CMakeLists.txt
10 years ago
scrawl 5347d407d8 Disallow AiWander fast-forward for water creatures
Pathgrid nodes are usually above the water level, so appearing at a random node would have the creature break out of the water level it's supposed to be constrained to.
10 years ago
scrawl 98a77f68a3 Fix AiWander::fastForward using incorrect pathgrid coordinates when actor recently moved to a new cell 10 years ago
scrawl 4bb3cbf0fb Remove last remains of Ogre 10 years ago
scrawl 7bacb9418d Various math code ported to osg 10 years ago
scrawl fd50be0fb8 Restore various gameplay 10 years ago