1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 10:49:57 +00:00
Commit graph

226 commits

Author SHA1 Message Date
dteviot
1ef78b1e56 extracted playGreetingIfPlayerGetsTooClose() 2015-07-12 16:37:31 +12:00
dteviot
df421fce92 extracted function setPathToAnAllowedNode() 2015-07-12 16:35:15 +12:00
dteviot
b508846a64 Renamed mStoredAvailableNodes to mPopulateAvailableNodes.
Don't call getAllowedNodes() needlessly.
2015-07-12 16:32:48 +12:00
dteviot
f1774ee7c3 Fixed compile failing on OSX and Linux. 2015-07-08 19:34:33 +12:00
dteviot
52cf8541f5 End point tolerance restored to 64 units.
Corrected problem pointed out by Scrawl.
Destination needs tolerance of 64 to avoid overcrowding.
2015-07-08 18:41:03 +12:00
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.
2015-07-05 18:21:35 +12:00
dteviot
eb2aa965b9 Extracted function SetCurrentNodeToClosestAllowedNode() 2015-07-05 18:17:18 +12:00
dteviot
f942db2b27 Simplified code. 2015-07-05 18:08:09 +12:00
dteviot
9a02a85a24 Pulled duplicate code into function. 2015-07-05 18:07:14 +12:00
mrcheko
c773ed9f9a move checkWayIsClear to pathfinding; move shortcut logic to separate func (AiPackage::shortcutPath); rework AiPackage::pathTo 2015-07-04 18:00:16 +03:00
dteviot
fae93e3d82 Bugfix: was not resetting mStuckCount. 2015-07-04 19:00:27 +12:00
dteviot
46a654286b Remove fix for #1317
Expanding the AiWander distance for path grid nodes causes bigger problems than it solved.
2015-07-04 18:57:56 +12:00
dteviot
164994f3d3 Made PathFinder::buildPath() private.
Now all paths are built by calling PathFinder::buildSyncedPath().
Also removed useless comment.
2015-07-04 18:47:26 +12:00
scrawl
59db9664ba Pass the CharacterController to AiPackage::execute 2015-06-26 17:47:04 +02:00
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
2015-06-22 20:09:02 +02:00
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.
2015-06-21 16:23:40 +12:00
scrawl
3663511cdb Merge branch 'master' of https://github.com/OpenMW/openmw into osg
Conflicts:
	apps/opencs/CMakeLists.txt
	extern/ogre-ffmpeg-videoplayer/CMakeLists.txt
2015-06-16 19:53:41 +02:00
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.
2015-06-15 20:13:59 +02:00
scrawl
98a77f68a3 Fix AiWander::fastForward using incorrect pathgrid coordinates when actor recently moved to a new cell 2015-06-15 20:04:36 +02:00
scrawl
4bb3cbf0fb Remove last remains of Ogre 2015-06-03 23:04:35 +02:00
scrawl
7bacb9418d Various math code ported to osg 2015-06-03 19:41:19 +02:00
scrawl
fd50be0fb8 Restore various gameplay 2015-05-30 01:00:24 +02:00
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
2015-05-23 20:33:44 +02:00
Rohit Nirmal
396fba7fa9 Silence -Wreorder warnings, and remove -Wno-reorder. 2015-05-21 22:46:44 -05:00
scrawl
8c810e3620 Move rng to components 2015-04-22 17:58:55 +02:00
scrawl
1699759d12 Merge branch 'master' of https://github.com/OpenMW/openmw into osg
Conflicts:
	apps/opencs/view/render/cell.cpp
2015-04-19 02:29:16 +02:00
scrawl
c92592493e OpenMW: create a window and render the starting cell(s) 2015-04-12 15:38:30 +02:00
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.
2015-03-28 20:05:54 +13:00
dteviot
63ab856024 Removed duplicated code. 2015-03-23 20:57:36 +13:00
dteviot
eb1090a1b6 Waypoint check only considers X & Y distance (Fixes #2423)
When pathfinder checks if actor has reached a waypoint, ignore actor's altitude.
2015-03-23 20:09:46 +13:00
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.
2015-03-15 14:07:47 +13:00
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
2015-03-08 17:42:07 +13:00
dteviot
f2ac939e61 reverted mShouldRepeat back to unsigned char.
As recommended by Scrawl.
2015-03-07 11:04:54 +13:00
scrawl
bf915d929a Update idle voices according to research 2015-01-15 03:35:46 +01:00
scrawl
a3c861b7fa Idle voice fix 2015-01-14 00:07:14 +01:00
scrawl
871d59de6c Reduce Idle voice chance (Fixes #1964) 2015-01-12 23:29:58 +01:00
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.
2015-01-11 17:04:58 +01:00
scrawl
4d9100091d Reduce default pathing arrival tolerance to 32 units (Fixes #1605) 2015-01-07 02:34:28 +01:00
scrawl
92e4a0669c Fix for AiWander state loading 2015-01-01 18:58:17 +01:00
scrawl
559ddbb480 Quick fix for Ai fast-forward crash in exteriors (Fixes #2241) 2015-01-01 18:18:46 +01:00
scrawl
01652bbcc5 Store original actor position in AiWander package (Fixes #2200) 2015-01-01 03:38:49 +01:00
scrawl
a8ae0dec52 Implement AiWander fast-forward (Feature #1125) 2014-12-31 18:41:57 +01:00
scrawl
a1226501fa AiWander: move idle animation handling to non-delayed section (Fixes #2073) 2014-12-01 23:09:46 +01:00
scrawl
61d1aa78ce Move AiWander path finder to temporary storage (Fixes #2082) 2014-12-01 23:09:46 +01:00
terrorfisch
4eb1668467 references now initialized when they are needed 2014-10-10 23:32:15 +02:00
terrorfisch
730abf6841 Moved all variables in temporary storage for AiCombat and some more for AiWander.
+Buxfix for previous AiWander changes
2014-10-10 00:16:17 +02:00
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.
2014-10-08 22:11:45 +02:00
terrorfisch
0871d45790 Draft how to move temporary package state to CharacterController.
Example for a few values shown in AiWander.
2014-10-08 10:58:52 +02:00
scrawl
7252cb63a6 Fix cppcheck issues 2014-09-26 17:48:14 +02:00
scrawl
780a48cd1e Don't greet dead actors in AiWander 2014-09-09 00:43:12 +02:00
scrawl
9caff1d800 Don't say Idle voices when player is not in LOS (Fixes #1436) 2014-09-01 02:21:54 +02:00
scrawl
1bb82c710c Fix use of uninitialized memory in AiWander::init 2014-08-14 18:55:54 +02:00
Michał Ściubidło
f754e06be9 Fix for bug 1685 2014-07-30 07:47:09 +01:00
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.
2014-07-28 23:45:26 +01:00
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
2014-07-28 23:45:26 +01:00
Michał Ściubidło
20efeea5d9 AI tell their greatings even when player is moving (like morrowind).
Greating reset distance was greatly inflated comparing with morrowind.
2014-07-28 23:45:26 +01:00
scrawl
92f5898b32 AiWander: Make sure we have 8 idle values (Fixes #1583)
The AiWander instruction may specify more (or less) than 8.
2014-06-28 14:22:27 +02:00
scrawl
afbd5162ee Move AiWander arrival check to time-critical section 2014-06-15 14:18:16 +02:00
scrawl
a54ac579a5 Savegame: Store AiSequence 2014-06-13 02:26:52 +02:00
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. :)
2014-05-22 20:50:00 +02:00
mrcheko
9e79fb5b87 fix to broken aiwander logic 2014-05-01 11:41:25 +04:00
mrcheko
e8f7d12c01 uninit bool and invalid iterator bugs fixes 2014-04-30 23:57:19 +04:00
scrawl
28ef236f0e Don't allow setting a new return position if there already is one and we haven't reached it yet 2014-04-29 11:17:07 +02:00
scrawl
1fd7a07b5e Merge branch 'master' of https://github.com/OpenMW/openmw into return
Conflicts:
	apps/openmw/mwmechanics/aisequence.cpp
	apps/openmw/mwmechanics/aiwander.cpp
2014-04-29 09:14:13 +02:00
scrawl
9b36a13821 Feature #1289: NPCs return to default position
Make stationary NPCs return to their previous position once combat/crime AI finishes.
2014-04-29 09:09:51 +02:00
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. 2014-04-27 07:38:31 +10:00
cc9cii
6a1435c49e Remove rotation check that was freezing NPC's. 2014-04-20 17:59:08 +10:00
cc9cii
e17fab891d Suppress travis warning and one more tweak. 2014-04-20 16:49:57 +10:00
cc9cii
2b544d550b Fixed the rotation animation glitch. 2014-04-20 14:27:18 +10:00
cc9cii
000afa48b7 An attempt at making turning animation smoother. Copied some code from AiCombat for rotation. 2014-04-20 11:59:47 +10:00
cc9cii
3d26702f5e Make idle actors face the player. Turning animation is not smooth. 2014-04-20 10:36:01 +10:00
cc9cii
9bd31b6236 Added reaction time and moved game setting variables init to the constructor. 2014-04-20 10:06:03 +10:00
cc9cii
479a94b35d Backing off closed doors working, needs cleanup and tweaking. 2014-04-20 08:14:54 +10:00
cc9cii
a0fc514df7 Suppress compiler warning. 2014-04-18 15:45:39 +10:00
cc9cii
c652cb1568 More cleaning up. 2014-04-18 15:19:22 +10:00
cc9cii
2447f0f4aa Cleaned up logging statements. 2014-04-18 14:41:44 +10:00
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. 2014-04-18 14:41:44 +10:00
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. 2014-04-18 14:41:43 +10:00
cc9cii
1ceeeb4a22 Fix movement glitches for actors with low speeds (e.g. a rat). Was caused by false detection of being stuck. 2014-04-18 14:41:43 +10:00
cc9cii
f597d3e88b Use duration rather than frame counts. Stops false detection of being "stuck" with high frame rates (e.g. indoors). 2014-04-03 07:46:26 +11:00
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.
2014-03-29 19:35:52 +11:00
cc9cii
90a813ad2c Allow interrupting a walking NPC to trigger a greeting. 2014-03-29 19:35:52 +11:00
scrawl
c8c0e5de38 Fixed code issues found with unity build. Missing include guards, duplicated functions, ... 2014-03-16 23:49:06 +01:00
cc9cii
e6977d00e8 Oops. Fix typo picked up by Zini. 2014-03-15 08:16:35 +11:00
cc9cii
b2e3fa70c2 Fix spelling errors in comments. 2014-03-14 07:04:39 +11:00
cc9cii
d92740efc9 Bug #900 fix - only fixed AiWonder, AiCombat, AiTravel and others may need a different strategy to this. 2014-03-13 23:44:52 +11:00
Marc Zinnschlag
367919200f moved CellRefList into a separate file 2014-02-23 20:11:05 +01:00
Marc Zinnschlag
7693f712bc started making CellStore into a proper class; encapsulated mCell member 2014-02-21 11:35:46 +01:00
scrawl
52f89e9a17 Don't play "idle" voice entries for NPCs with Hello 0
Not entirely sure if this is correct, but it prevents the NPCs in the starting boat from incorrectly playing them.
2014-01-31 04:43:35 +01:00
scrawl
39d86a9468 Improvements to smooth NPC steering 2014-01-31 04:43:29 +01:00
scrawl
e717694b36 Reset Run stance in AiWander 2014-01-29 15:37:27 +01:00
Marc Zinnschlag
fd5486864a Merge remote-tracking branch 'gus/AIFix2'
Conflicts:
	apps/openmw/mwbase/mechanicsmanager.hpp
	apps/openmw/mwmechanics/actors.cpp
	apps/openmw/mwmechanics/actors.hpp
	apps/openmw/mwmechanics/mechanicsmanagerimp.cpp
	apps/openmw/mwmechanics/mechanicsmanagerimp.hpp
2014-01-28 12:33:31 +01:00
gus
707e579dfe Merge branch 'master' of https://github.com/zinnschlag/openmw.git into AIFix2
Conflicts:
	apps/openmw/mwmechanics/aifollow.cpp
2014-01-24 19:16:50 +01:00
scrawl
05e75e1214 Closes #1127: Fix for subtitles for idle dialogue appearing outside of hearing range 2014-01-19 20:54:05 +01:00
scrawl
bea161331c Play 'hello' voiced dialogue entries in AIWander 2014-01-19 20:53:58 +01:00
scrawl
69ca03c308 Issue #777: Move DrawState to CreatureStats. All creatures can cast spells, and some creatures have weapons. 2014-01-19 09:43:41 +01:00
scrawl
e410eb5273 Play 'Idle' voiced dialogue entries in AIWander. Tweak voice max distance. 2014-01-17 10:55:46 +01:00
scrawl
28a2585106 Unsheath weapon in AiWander 2014-01-15 14:53:29 +01:00
Marc Zinnschlag
3e58eb34e4 Merge remote-tracking branch 'sergeyshambir/startcombat'
Conflicts:
	apps/openmw/mwscript/docs/vmformat.txt
2014-01-13 10:17:10 +01:00
gus
5d038423ec attempt to solve Bug #1009 by not building graph every frame 2014-01-12 18:42:31 +01:00
scrawl
098f9712f1 Add getPlayerPtr() utility method. Reduces dependencies a lot. 2014-01-08 18:39:44 +01:00
Sergey Shambir
5c7e39a92f Implemented script commands StartCombat, StopCombat, GetTarget.
Also renamed one field of AIWander class because it's not longer
unknown.
2014-01-07 04:43:06 +04:00
scrawl
b22dd40b41 Implement Paralyze magic effect 2014-01-03 17:06:05 +01:00
scrawl
eba068149d Fix AIWander crash 2013-11-25 15:38:18 +01:00
gus
650a112e2e better timer 2013-10-30 20:42:50 +01:00
Chris Robinson
9499ac4fd5 Increase the distance for reaching a path node 2013-08-29 17:41:20 -07:00
Chris Robinson
f9dbce685a Avoid killing AIWander and AITravel when far away
This fixes the problem of certain NPCs not wandering because they
happened to spawn near a cell border away from the player, which
immediately "completed" the wander package.

AIWander can't cause NPCs to cross cell boundaries, so there's no risk
of them walking into an unloaded to. AITravel will now simply stop
moving, and resume later when the cell is loaded.
2013-08-29 17:41:20 -07:00
scrawl
982f743ddd Fix wrong idle animations played 2013-08-03 13:13:33 +02:00
scrawl
7dc30a01cd Some changes suggested by cppcheck 2013-07-31 18:46:32 +02:00
Torben Carrington
09beafd044 Pathfinding Overhaul - Master cleanup! Cleaned pathfinding entirely, all AI packages that are implemented as well, Increased buffer! This makes the intro guard no longer walk into you or go to far into the room (not tested against vanilla distances but it seems accurate enough until the next itteration of pathfinding fixes). 2013-05-31 17:49:52 -07:00
Torben Carrington
a4caec56cf Pathfinding Overhaul - Fixed selecting cells that are inaccessable from AIWander and pathfinding in general (sadly requires minor effort on the AI Packages implementation but it is the quickest way I can see), minor cleanup again (there is a lot to cleanup, this will prolly be in every commit). 2013-05-31 17:01:42 -07:00
Torben Carrington
73a9671742 Pathfinding Overhaul - Changed the name of checkIfNextPointReached to a more intuitive name considering what it does (checkPathCompleted) and fixed a minor bug in it, modified buildPath() to take one final parameter, a bool which dictates whether or not to always use pathfinding (like AIWander should be doing) or to allow for "shortcuts", modified all ai packages to work with these two changes. 2013-05-29 20:05:17 -07:00
Torben Carrington
c080785235 Pathfinding Overhaul - Finished cleaning, removed unnecessary parameter in one function, fixed use of the function in ai packages and added use of clearPath() function in aiwander, fixed algorithms and got rid of excess subtractions in getDistance functions (thanks to Chris!). 2013-05-29 19:26:45 -07:00
Torben Carrington
dbbc96f600 AIWander Segmentation Fault Fix - Fixes the segmentation fault that used to occur when there was no pathgrid in the cell and a range was passed to AIWander. 2013-05-27 11:44:46 -07:00
Torben Carrington
ebc1fdd017 AIWander Patch - fixed another possibility of a bug occuring, best to fix it now then wait until it happens. 2013-05-27 09:05:42 -07:00
Torben Carrington
bd6d54cc8f AIWander Minor Patch - Forgot an else statement and another check on an empty node vector, previously no nodes in range or only one would cause the AIWander to not do anything, now they will play idles correctly still. 2013-05-27 03:24:41 -07:00
Torben Carrington
fd96d47fe4 AIWander Completed. Replicates vanilla as best possible, pathfinding needs fixing before this looks correct but once the pathfinding files are edited this will behave pretty much exactly as vanilla. Major credit to Hrnchamd for major research. 2013-05-26 11:30:42 -07:00
Torben Carrington
96daad7a22 AIWander - shortened some if statements and made super minor optimizations to others, now using proper GMST to load proper idlechance instead of hacky set value." 2013-05-26 09:31:56 -07:00
Torben Carrington
e37324b967 AIWander everything works. only two things to do: Implement limiting selection on z axis, and correcting decision algorithm. 2013-05-26 08:49:44 -07:00
Torben Carrington
1cfe037d6b AIWander - Added support for the Repeat parameter to mimic vanilla. 2013-05-24 04:49:20 -07:00
Chris Robinson
1d934e3112 Reduce some stdout spam 2013-04-06 04:46:28 -07:00
Marc Zinnschlag
a092deaee8 various fixes 2012-11-16 20:28:20 +01:00
marcin
51027c541e Feature #391 Dummy AI package classes 2012-11-16 18:38:15 +01:00
marcin
bed0280ba1 Feature #391 Dummy AI package classes 2012-11-15 22:33:50 +01:00
marcin
4b939c7521 Feature #391 Dummy AI package classes 2012-11-15 22:15:20 +01:00
marcin
e6c8e1f0d7 Feature #391 Dummy AI package classes 2012-11-14 18:42:04 +01:00