Commit Graph

195 Commits (d4d46fc60256177968c96e9653ced2f83652338e)

Author SHA1 Message Date
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
scrawl 22f01b1232 Merge branch 'master' of https://github.com/OpenMW/openmw into osg
Conflicts:
	apps/launcher/graphicspage.cpp
	apps/opencs/editor.cpp
	apps/opencs/model/doc/document.cpp
	apps/opencs/view/render/cell.cpp
	apps/opencs/view/render/mousestate.cpp
	apps/opencs/view/render/textoverlay.cpp
	apps/opencs/view/render/worldspacewidget.cpp
	apps/openmw/mwclass/creature.cpp
	apps/openmw/mwclass/npc.cpp
	apps/openmw/mwgui/inventorywindow.cpp
	apps/openmw/mwgui/loadingscreen.cpp
	apps/openmw/mwgui/mapwindow.cpp
	apps/openmw/mwgui/pickpocketitemmodel.cpp
	apps/openmw/mwgui/waitdialog.cpp
	apps/openmw/mwmechanics/combat.cpp
	apps/openmw/mwmechanics/mechanicsmanagerimp.cpp
	apps/openmw/mwrender/globalmap.cpp
	apps/openmw/mwworld/physicssystem.cpp
	apps/openmw/mwworld/refdata.cpp
	apps/openmw/mwworld/scene.cpp
	apps/openmw/mwworld/worldimp.cpp
	components/sdlutil/sdlinputwrapper.cpp
	extern/shiny/Main/Factory.cpp
	extern/shiny/Main/MaterialInstance.cpp
	extern/shiny/Main/Platform.cpp
	extern/shiny/Main/ShaderSet.cpp
10 years ago
Rohit Nirmal 396fba7fa9 Silence -Wreorder warnings, and remove -Wno-reorder. 10 years ago
scrawl 8c810e3620 Move rng to components 10 years ago
scrawl 1699759d12 Merge branch 'master' of https://github.com/OpenMW/openmw into osg
Conflicts:
	apps/opencs/view/render/cell.cpp
10 years ago
scrawl c92592493e OpenMW: create a window and render the starting cell(s) 10 years ago
dteviot be6ee927b9 AiWander, use closest two points if distance is too small (Fixes #1317)
In AiWander, if wander distance is set too small to get two points, take the closest two points.
10 years ago
dteviot 63ab856024 Removed duplicated code. 10 years ago
dteviot eb1090a1b6 Waypoint check only considers X & Y distance (Fixes #2423)
When pathfinder checks if actor has reached a waypoint, ignore actor's altitude.
10 years ago
dteviot 3f28634d1f consolidate random number logic
Note, I suspect Rng::rollClosedProbability() is not needed.  The only difference between it and rollProbability() is that one time in 37k (on Windows), it will give an output of 1.0.
On some versions of Linux, the value of 1.0 will occur about 1 time in 4 billion.
10 years ago
dteviot ca8c8c6aa4 fixing MSVC 2013 warning C4244: & C4305
conversion from 'const float' to 'int', possible loss of data
conversion from 'double' to 'int', possible loss of data
conversion from 'float' to 'int', possible loss of data
10 years ago
dteviot f2ac939e61 reverted mShouldRepeat back to unsigned char.
As recommended by Scrawl.
10 years ago
scrawl bf915d929a Update idle voices according to research 10 years ago
scrawl a3c861b7fa Idle voice fix 10 years ago
scrawl 871d59de6c Reduce Idle voice chance (Fixes #1964) 10 years ago
scrawl b108fbe986 Remove incorrect implementation of fGreetDistanceReset
This can't be right. A reset distance of 512 is smaller than the maximum greeting distance for certain NPCs, which would then say greetings non-stop.
10 years ago
scrawl 4d9100091d Reduce default pathing arrival tolerance to 32 units (Fixes #1605) 10 years ago
scrawl 92e4a0669c Fix for AiWander state loading 10 years ago
scrawl 559ddbb480 Quick fix for Ai fast-forward crash in exteriors (Fixes #2241) 10 years ago
scrawl 01652bbcc5 Store original actor position in AiWander package (Fixes #2200) 10 years ago
scrawl a8ae0dec52 Implement AiWander fast-forward (Feature #1125) 10 years ago
scrawl a1226501fa AiWander: move idle animation handling to non-delayed section (Fixes #2073) 10 years ago
scrawl 61d1aa78ce Move AiWander path finder to temporary storage (Fixes #2082) 10 years ago
terrorfisch 4eb1668467 references now initialized when they are needed 10 years ago
terrorfisch 730abf6841 Moved all variables in temporary storage for AiCombat and some more for AiWander.
+Buxfix for previous AiWander changes
10 years ago
terrorfisch 4391c1fd00 Addded the parts of AiWander that I fully understand to the temporary storage.
The rest should be done by someone who has a clearer overview over the class.
10 years ago
terrorfisch 0871d45790 Draft how to move temporary package state to CharacterController.
Example for a few values shown in AiWander.
10 years ago
scrawl 7252cb63a6 Fix cppcheck issues 10 years ago
scrawl 780a48cd1e Don't greet dead actors in AiWander 10 years ago
scrawl 9caff1d800 Don't say Idle voices when player is not in LOS (Fixes #1436) 10 years ago
scrawl 1bb82c710c Fix use of uninitialized memory in AiWander::init 11 years ago
Michał Ściubidło f754e06be9 Fix for bug 1685 11 years ago
Michał Ściubidło bd3729a6cb Add grace periods for player greeting.
Add delay for NPC greating. NPC ignores greeted player after some time.
Fixes bug 1503.
11 years ago
Michał Ściubidło d47bfbe69c Implement AI greeting states.
Greeting consist of 3 phases:
- none - default one, greeting state can only change to "in progress"
  when near enough and some time passes
- in progress - NPC says his greating and rotates toward player,
  state can only change to "done" after some time
- done - rotation is stoped, after idling can go away from player,
  state can only change to "none" when player and NPC are faraway
11 years ago
Michał Ściubidło 20efeea5d9 AI tell their greatings even when player is moving (like morrowind).
Greating reset distance was greatly inflated comparing with morrowind.
11 years ago
scrawl 92f5898b32 AiWander: Make sure we have 8 idle values (Fixes #1583)
The AiWander instruction may specify more (or less) than 8.
11 years ago
scrawl afbd5162ee Move AiWander arrival check to time-critical section 11 years ago
scrawl a54ac579a5 Savegame: Store AiSequence 11 years ago
Emanuel Guevel 1e4a854433 Remove static method MWWorld::Class::get(&Ptr)
It was just adding a level of indirection to Ptr.getClass().
All the call were replaced by that instead. The number of lines changed
is important, but the change itself is trivial, so everything should be
fine. :)
11 years ago
mrcheko 9e79fb5b87 fix to broken aiwander logic 11 years ago
mrcheko e8f7d12c01 uninit bool and invalid iterator bugs fixes 11 years ago
scrawl 28ef236f0e Don't allow setting a new return position if there already is one and we haven't reached it yet 11 years ago
scrawl 1fd7a07b5e Merge branch 'master' of https://github.com/OpenMW/openmw into return
Conflicts:
	apps/openmw/mwmechanics/aisequence.cpp
	apps/openmw/mwmechanics/aiwander.cpp
11 years ago
scrawl 9b36a13821 Feature #1289: NPCs return to default position
Make stationary NPCs return to their previous position once combat/crime AI finishes.
11 years ago
cc9cii 1fb2c8d87b NPC turning is less hacky but still not perfect. NPC's should walk away after a period of non-action by the player (vanilla behaviour) - not yet implemented. 11 years ago
cc9cii 6a1435c49e Remove rotation check that was freezing NPC's. 11 years ago
cc9cii e17fab891d Suppress travis warning and one more tweak. 11 years ago
cc9cii 2b544d550b Fixed the rotation animation glitch. 11 years ago
cc9cii 000afa48b7 An attempt at making turning animation smoother. Copied some code from AiCombat for rotation. 11 years ago
cc9cii 3d26702f5e Make idle actors face the player. Turning animation is not smooth. 11 years ago
cc9cii 9bd31b6236 Added reaction time and moved game setting variables init to the constructor. 11 years ago
cc9cii 479a94b35d Backing off closed doors working, needs cleanup and tweaking. 11 years ago
cc9cii a0fc514df7 Suppress compiler warning. 11 years ago
cc9cii c652cb1568 More cleaning up. 11 years ago
cc9cii 2447f0f4aa Cleaned up logging statements. 11 years ago
cc9cii aad13d315c Fixed issue where allowed nodes were being erased. PathFinder was returning an empty path if the closest pathgrid point to the start was also the closest pathgrid point to the goal. Still need to clean up and remove logging statements. 11 years ago
cc9cii d3be725ee7 Actors are moved on if idling near a closed interior door. Unreachable pathgrid points due to a closed door are removed from the allowed set of points. 11 years ago
cc9cii 1ceeeb4a22 Fix movement glitches for actors with low speeds (e.g. a rat). Was caused by false detection of being stuck. 11 years ago
cc9cii f597d3e88b Use duration rather than frame counts. Stops false detection of being "stuck" with high frame rates (e.g. indoors). 11 years ago
cc9cii 07fd801d94 My previous analysis of the pathfinding issue was incorrect. It was in fact caused due to some of the pathgrid points being unreachable. Instead of returning an empty path in such a scenario, incorrect path + requested destination were being returned. There was also a defect where past cost was being used for selecting open points.
There is still an unresolved issue where mGraph and mSCComp are being rebuilt unnecessarily.  The check mCell != cell in buildPath() is being triggered frequently. Not sure why.
11 years ago