Commit Graph
782 Commits
Author SHA1 Message Date
Treeston 2cc36c5eec Core/AI: UnitAI.h trimming part two. WaypointX methods kicked upstairs to CreatureAI.h. 2020-07-22 15:11:26 +02:00
Ovahlord 9f116b86e9 Core/Movement: re-implement AbstractFollower as renamed version and index the pointers by following type (chase, follow, formation) for future access and improvements 2020-07-20 20:16:01 +02:00
Ovahlord fc4e2e4203 Core/Movement: followers will no longer get stuck behind obstacles 2020-07-17 13:10:58 +02:00
Ovahlord d371c9d1f6 Core/Packets: converted MSG_MOVE_TELEPORT, MSG_MOVE_TELEPORT_ACK, CMSG_SET_ACTIVE_MOVER and SMSG_MOVE_UPDATE_TELEPORT to packet class and send SMSG_MOVE_UPDATE_TELEPORT for players after receiving MSG_MOVE_TELEPORT_ACK instead of sending it alongside MSG_MOVE_TELEPORT 2020-07-16 15:26:12 +02:00
Ovahlord 322662ba69 Fixed nopch build 2020-07-15 00:45:51 +02:00
Ovahlord d82c00c915 Core/Units: changed _formationFollowers from unit references to object guids to have a safer access to its stored units 2020-07-14 23:47:23 +02:00
Ovahlord d7a4a6dad1 Core/Movement: do no predict follow destinations when the follower is faster than its target outside of catchup and formation mechanics 2020-07-09 22:02:42 +02:00
Ovahlord 4887e32dfc Core/Movement: followers will now have their relative angle to the predicted destination considered for a smoother turn movement 2020-07-09 13:46:05 +02:00
Ovahlord 29e64980d8 Core/Movement: throttle follow movement speeds only when the follower is very close to its destination 2020-07-08 00:03:26 +02:00
Ovahlord 779c52ec7b Core/Movement: cancel follow movement when the follow target has died 2020-07-05 10:42:47 +02:00
Ovahlord 6bb5405296 Core/Movement: removed unnecessary logging from f1b16b4820 2020-06-28 22:20:11 +02:00
Ovahlord 588ab1b45e Fixed nopch build 2020-06-28 14:31:35 +02:00
Ovahlord f1b16b4820 Core/Movement: added a safety and error output if a follow target has a dead / invalid follower reference that should have been cleared before. 2020-06-28 14:23:02 +02:00
Ovahlord 9bd1cb8970 Core/Movement: handle special follow movement case for companions 2020-06-27 16:04:37 +02:00
Ovahlord 043446f8f2 Core/Movement: fixed follow movement getting broken after its first update tick and removed legacy code 2020-06-27 15:37:41 +02:00
Ovah b09d6e2330 Core/Movement: reimplement follow movement (#124) 2020-06-26 21:22:21 +02:00
Giacomo Pozzoni 85532de2e9 Handle different slopes in mmaps (#24765)
* Tools/MMAPs: Remove input argument --maxAngle

Remove input argument --maxAngle . This should be just hardcoded in MapBuilder::GetMapSpecificConfig() so all settings are easily found in the same place instead of being spread around.

* Tools/MMAPs: Add new area type NAV_AREA_GROUND_STEEP

Add new area type NAV_AREA_GROUND_STEEP for ground with slope in the range (55, 70] .
NAV_AREA_GROUND is used for ground with range [0, 55] .
NAV_AREA_GROUND_STEEP takes priority over NAV_AREA_GROUND.

* Tools/MMAPs: Fix NAV_GROUND_STEEP flag not being saved in the mmtile

* Core/PathFinding: Implement NAV_GROUND_STEEP flag

Implement NAV_GROUND_STEEP flag, used only by Creatures that are in combat or evading.

* Distinguish between RC_WALKABLE_AREA and NAV_AREA_GROUND.

* Allow mobs in combat to walk on steeps up to 80°

* Allow mobs in combat to walk on steeps up to 85°.
Disable rcFilterLedgeSpans() filter as it removed long steep spans.

* Increase cost of steep spans to try making creatures walk around obstacles instead of walking on them

* Revert last commit
# Conflicts:
#	src/server/game/Movement/PathGenerator.cpp
2020-06-18 02:16:11 +02:00
Giacomo Pozzoni 9fdf598792 Cherry-pick some cmake commits (#24720)
* Build system: Support  new in cmake 3.17 Ninja Multi-Config generator

(cherry picked from commit 369b618d4f160816818681ed7e41063e2d9ba5b5)

* Build system: Fixed PCH with MSVC & Ninja generator

(cherry picked from commit d669f46b6d5190dabc686a35656e8b03f5ec325b)

* Core: Fix clang 10 warnings

(cherry picked from commit 7272508cb4b51ec5591b6f0e542ea29091db7546)

* Build system: Set -Wno-deprecated-copy only for clang 10

(cherry picked from commit 7fdeb259ba398d5d9343a5dcd1a89562dfcbe981)

* Core/Misc: GCC build and warning fixes

(cherry picked from commit 4d69cc1c567180b408ddbadb9edf26859cf4c006)

* Build system: Print found git version when warning about it being too old

(cherry picked from commit 1ae72db201189877c1b863fac140eb4b0a45c5bb)

* Build system: Removed hard requirement on BOOST_ROOT being set as environment variable, it can now be also passed as command line argument to cmake and fix compile warning with boost 1.73

(cherry picked from commit 161944b7643c62f9e7705c64e42d42e5d07f1959)

* Remove some code that was already removed from 335 and then cherry-picked into master

Co-authored-by: Shauren <shauren.trinity@gmail.com>
(cherry picked from commit 8c09b6e58b0e4f33b7a8e376a28709e693cf2914)
2020-06-11 20:24:00 +02:00
Warpten 5cb747620a Core/Movement: Fixed Animation Tier handling (#113) 2020-06-03 00:49:18 +02:00
Ovahlord 53060a39f5 Core/Movement: implement optional velocity argument to MoveLand motion master helper 2020-06-01 21:48:30 +02:00
Ovahlord 813b82efa3 Core/Units: CanFly and CanHover will now return positive results when the creature has the according movement flags dispite not having the template movement field set as enabled. This fixes several edge cases with manually enabled flight movement
* renamed IsLevitating to IsGravityDisabled for consistency
2020-05-16 19:21:27 +02:00
Ovahlord d91fa5023e Core/Objects: fixed random destination selection for spells casted by flying units
* the path generator will now check for realtime movement flags instead of movement template data for units
2020-05-16 17:15:19 +02:00
Giacomo Pozzoni e3bab35d5e Core/MMAPs: Adjust walkable climb and fix a lot of mmap raycast issues (#24539)
* Core/MMAPs: Adjust walkable climb

Adjust walkable climb as recast using walkableClimb also to find the poly from a position, giving priority to polys that are below the position but closer than walkableClimb.

* Temporarily disable static collision (the whole check should be removed)

* Core/Spells: removed deprecated mmap path check for TARGET_DEST_CASTER_FRONT_LEAP

* Core/Objects: allow flying units to use the helper as well (flying units casting radius based spells)

* Code refactor

* Handle raycasts that end in a point with no height in the mmap mesh as PATHFIND_NOPATH

* Walk back a bit from raycast hitpoints as sometime the 2D result point is outside of the polygons due to floating point errors.

* Remove whitespace

* Revert 4a197ba22a as a raycast point path should have the Z retrieved with getPolyHeight(). Raycast will only return a 2-point path with Start and Hitpoint/End

* Cleanup PathGenerator raycast case

* Fix PathGenerator raycast broken if start and end are on same poly.
Fix PathGenerator raycast broken if no wall is hit.
Remove unused case of using raycast with an existing previous path (can be added back properly if needed).
Remove forcing poly length to 2 when we actually have already the right number.

* Use closestPointOnPolyBoundary on the second try of finding a point on poly for raycast.
Note that in this case the mesh height is not used which might cause issues. The poly boundary height will be used instead.

* Handle cases where getPolyHeight() fails because the point is on polygon border (and caused by floating point imprecision)

* Add far from poly flags

* Set PATHFIND_INCOMPLETE in raycast case if startFarFromPoly or endFarFromPoly

* Fix blink close to walls with no valid polygon behind the wall

* Require to re-extract mmaps

Co-authored-by: Ovah <dreadkiller@gmx.de>
# Conflicts:
#	src/server/game/Entities/Object/Object.cpp
2020-05-16 13:45:57 +02:00
Ovahlord d8ec67df50 Core/Movement: converted collision height and move update opcodes back to movement structures and implement new movement status elements for future use 2020-05-10 19:21:33 +02:00
Ovahlord a2cea3ce08 Core/Movement: converted CMSG_MOVE_SET_COLLISION_HEIGHT_ACK and SMSG_MOVE_UPDATE_COLLISION_HEIGHT to packet class
* added new MovementInfo helpers for easy access to all packet related data
2020-05-10 01:31:53 +02:00
Ovahlord 557d5497a3 Core/Packets: fixed a console error when trying to broadcast SMSG_MOVE_UPDATE via packet sender 2020-05-09 19:51:25 +02:00
Ovahlord 04b99ab8ac Core/Packets: converted SMSG_MOVE_UPDATE to packet class 2020-05-09 17:01:42 +02:00
Ovahlord 8eccdaefc9 Core/Movement: fixed an issue that was causing hovering units not chasing their targets close enough to perform melee attacks 2020-05-02 18:07:12 +02:00
Ovah 1a85f82edd Core/Objects: further improvements for MovePositionToFirstCollision (#24523)
* Core/Objects: further improvements for MovePositionToFirstCollision

* the PathGenerator will now normalize incomplete destinations as well
* normalize destination positions before launching detour raycasts to get better direction data
* exclude unwanted pathfinding results from further use to avoid unintended behaivior

* Core/PathFinding: Split PATHFIND_FARFROMPOLY into PATHFIND_FARFROMPOLY_START and PATHFIND_FARFROMPOLY_END for start and end position

Handle PATHFIND_FARFROMPOLY_END as valid in MovePositionToFirstCollision

Co-authored-by: jackpoz <giacomopoz@gmail.com>
# Conflicts:
#	src/server/game/Entities/Object/Object.cpp
#	src/server/game/Movement/PathGenerator.h
2020-05-01 14:51:38 +02:00
Ovahlord 7b62f5ac56 Core/Movement: slightly reduce the catchup / throttle distance check range to get more accurate catchup data 2020-04-29 23:58:07 +02:00
jackpoz c5c99f1eea Core/PathFinding: Fix buffer overflow 2020-04-29 22:37:55 +02:00
Ovahlord 416b0edd51 Core/Movement:
* chase movement will now use simple near point calculations for chase movement without pathfinding enabled
* units with a big boundary radius will no longer reposition themselves
2020-04-24 23:46:04 +02:00
Ovahlord 9c6ca290f7 Core/Movement: skip catchup calculations for follow movement when the distance between the follower and its destination is just very short 2020-04-23 21:29:59 +02:00
Ovahlord d49579395e Core/Movement: added another mmap raycast exception for follow movement 2020-04-22 18:17:17 +02:00
Ovahlord 1646f2a53d Core/Movement: do not use mmap raycasts when the movement generator owner is ignoring pathfinding (units on transport for example) 2020-04-22 17:54:27 +02:00
Ovahlord 724121fbb9 Core/Movement: optimized follow movement destination calculation by reducing the number of mmap raycasts down to one 2020-04-22 17:01:25 +02:00
Ovahlord dbe365844b Core/Movement: fixed a typo in chase movement generator that was causing creatures to move backwards all the time when chasing another creature 2020-04-22 03:46:19 +02:00
Ovahlord 749fdc06d1 Core/Movement: follow movements will now throttle the follower's speed in a more aggressive manner to get them back in line more quickly when moving ahead 2020-04-20 12:40:30 +02:00
Ovah 1b8eec06ec Core/Movement: various improvements for creature knockbacks
* creature knockbacks will no longer generate a full path but instead only use a destination point to reflect sniff data
* calculate the destination by using a mmap raycast instead of using a mmap path which had the chance of creating weird movements when GetNearPosition failed to get a proper collision point (knocking arround a tree for example or just somewhere it should not go at all)
# Conflicts:
#	src/server/game/Movement/MotionMaster.cpp
2020-04-17 21:21:46 +02:00
Ovahlord b8802ccaa2 Core/Movement: do not reposition against chase targets that are still moving 2020-04-16 21:53:33 +02:00
Shauren d003ebd8e4 Core/DBLayer: Prevent using prepared statements on wrong database 2020-04-15 19:18:58 +02:00
Ovahlord 26e5823913 Core/Movement: fixed several edge cases at which units with a custom chase angle ended up endlessly repositioning against their target 2020-04-13 22:22:11 +02:00
Ovahlord 1f93a67e04 Core/Movement: inital work on chase movement rewrite
* chase movement will now launch within a sniffed time interval
* the movement will now use a predicting method to get a estimated chase destination to avoid falling behind the chase target
* ChaseRange has been dropped and stepping backward has now a own implementation within the movement generator. Todo: analyzing sniffs for the correct time interval
2020-04-13 17:12:14 +02:00
Ovahlord 479437f8d6 Core/Movement: only set velocity values for follow movement if we have to rely on our follow target's speed 2020-04-06 01:25:23 +02:00
Ovahlord 31b86c20e3 Revert "Core/Movement: Improve log when starting a spline with invalid arguments"
This reverts commit f55b15c585.
2020-04-04 19:14:30 +02:00
jackpoz d781c12b57 Core/Movement: Add support to cyclic splines to GenericMovementGenerator
GenericMovementGenerator sets the _duration to the return value of spline.Launch(). For cyclic splines, this is the duration of 1 single cycle, while the spline itself never ends.
To support this edge case in GenericMovementGenerator we just never update the _duration timer for cyclic splines.

# Conflicts:
#	src/server/game/Movement/MovementGenerators/GenericMovementGenerator.cpp
2020-04-04 19:13:21 +02:00
jackpoz eba5dafada Core/Movement: Don't start a spline with just 1 point in FlightPathMovementGenerator
Don't start a spline with just 1 point in FlightPathMovementGenerator. This happens when teleporting to a BG while on a taxi after second last node but closer to last node.
In this case the Player will be teleported to the last node.
2020-04-04 19:09:48 +02:00
jackpoz f55b15c585 Core/Movement: Improve log when starting a spline with invalid arguments
Improve log when starting a spline with invalid arguments, for example when starting a spline with just 1 point.
2020-04-04 19:03:31 +02:00
Ovahlord c2a676b774 Core/Movement: rewrite formation movement
* formation members will now draw their speeds from their formation leader and increase them based on how far they are behind their leader
* added sniffed periodic movement interval which additionally helps keeping up with formation leaders
* the formation movement generator will now persist permanently instead of being a one shot type and handles everything on its own once applied
2020-04-01 01:32:24 +02:00
Ovahlord 05bdaf47fb Core/Movement: if a creature follows an npc it will now respect the target's velocity instead of running all the time 2020-03-31 17:05:13 +02:00