Commit Graph
822 Commits
Author SHA1 Message Date
Ovahlord c41fe84b8c Core/AI: reduce differences in ScriptedEscortAI between 4.x and 335 2021-04-12 10:32:44 +02:00
Ovahlord f72b3c64b3 Revert "Core/PathFinding: calculate pathing with 0.5f steps and convert them to blizzlike splines later in the process to get more precise results" 2021-03-31 21:37:24 +02:00
Ovahlord 82714dfa59 Core/Movement: removed the 1s initial delay when launching a waypoint path 2021-03-26 18:25:04 +01:00
Ovahlord 317bc49501 Core/Movement: flight waypoint movement is now correctly using catmullrom and uncompressed splines 2021-03-24 11:09:12 +01:00
Ovahlord 087e7e961a Core/Movement: waypoint movement will no longer pick up ongoing spline destinations when the spline path is being stored in db 2021-03-12 22:02:45 +01:00
Ovahlord 3cb0a99019 Core/Movement: expose orientation, velocity and delay members to SmartAI waypoints as well
superceeds #200
2021-02-24 16:22:36 +01:00
Ovahlord 0299fa4fe1 Core/Misc: replace boost::optional with std::optional 2021-02-19 14:07:43 +01:00
Ovahlord c3e9861723 Core/Movement: implement creature movement info table to override movement speeds based on movement IDs
thx to @xvwyh for providing initial table data for the most common entries
2021-02-16 16:56:10 +01:00
Ovahlord c20838ceaa Core/Movement: allow waypoints to have orientation values of 0 2021-02-05 11:16:45 +01:00
Ovahlord c7540fc930 Core/Misc: corrected some oversights in recent commits 2021-01-26 05:37:10 +01:00
Ovahlord 9687131c65 Core/Movement: waypoint movement will now respect the currentwaypoint field in the creature table 2021-01-24 10:18:29 +01:00
Ovahlord 45e1dd7376 Core/PathFinding: re-added a accidentally dropped path length limit sanitizer 2021-01-24 10:18:29 +01:00
Ovahlord 71fe0ed943 Core/PathFinding: calculate pathing with 0.5f steps and convert them to blizzlike splines later in the process to get more precise results 2021-01-22 18:34:09 +01:00
Ovahlord b7aafc8d01 fixed warnings 2021-01-15 16:23:09 +01:00
Ovahlord dfab041648 Core/Movement: initialize stalled member in CyclicMovementGenerator's 2nd ctor overload 2021-01-15 16:01:18 +01:00
Ovahlord 7f04fb8137 Core/Movement: added a missing pointer check 2021-01-15 12:10:50 +01:00
Ovahlord d5f9b8c26f Core/Movement: implement smooth waypoints
* delays can now be negative to support sniffed transition times from one waypoint path to another
* early transitions will now pick up the ongoing spline destination and start calculating their path from that point on
* waypoints may now use db side spline pathings in a new db table to support special spline shapes are not generated by normal pathfinding (e.g. scripted flight paths)
* current waypoints will still the work the way they did before for legacy and custom support
2021-01-15 12:10:49 +01:00
Giacomo Pozzoni 5e3b57bae7 Core/Unit: Fix movement hiccups in water
* Core/Unit: Allow to define Units which can enter water but cannot swim

Allow to define Units which can enter water but cannot swim, i.e. crabs walking at the bottom of a sea.

* Add UNIT_FLAG_SWIMMING to creatures when entering combat

* Fix charmed creatures not entering water

* Always allow Creatures controlled by players to enter water

* Add swimming flag when possessing a unit and remove it properly at the end, even if the creature engaged combat before and after.
When adding/removing UNIT_FLAG_SWIMMING manually calling Creature::RefreshSwimmingFlag(true) might be required.
2021-01-11 12:33:54 +01:00
Ovahlord 2075879183 Core/Movement:
* splines that are being sent via StopMoving() will now send the correct spline data when a unit has died
* corrected setting the NowDead field in SMSG_ATTACK_STOP to prevent creature's from looking away from the cool guys when dying
2020-11-19 03:18:06 +01:00
Ovahlord 882254e3cd Core/Movement: added PauseMovement and Resume functionality to cyclic spline movement generator to support pause and resume movements (e.g. on gossip hello) 2020-11-18 04:58:27 +01:00
Ovahlord 88024e0e74 Core/Packets: converted more packets to packet class 2020-11-02 17:51:08 +01:00
Ovahlord 961f82988d Core/Movement: allow MotionMaster::MovePoint to use velocity arguments and implement speed paramemters for SMART_ACTION_MOVE_OFFSET and SMART_ACTION_MOVE_TO_POS 2020-10-30 18:57:09 +01:00
Ovahlord f1ef08fc84 Core/Movement: added optional velocity argument for MotionMaster::MoveTakeoff helper to manually specify velocity values 2020-09-29 17:40:31 +02:00
Ovahlord 361ac2292b Core/Movement: add velocity field to waypoint_data to allow specifying custom speed value for waypoints and cyclic splines
* standartized member naming in WaypointNode and WaypointPath struct
2020-09-24 14:30:48 +02:00
Ovahlord c9afa1a6ed Core/Units: renamed SetInFront to SetOrientationTowards to clarify its actual functionality and added comments to SetOrientationTowards, SetFacingTo and SetFacingToObject 2020-09-23 20:48:44 +02:00
Ovahlord 27c1fd6aee Core/Movement: implement cyclic spline database support 2020-09-21 00:32:55 +02:00
xvwyh 6342b0def2 Core/PathFinding: Fix GetPathPolyByPosition() using only 2D distance instead of 3D
Signed-off-by: jackpoz <giacomopoz@gmail.com>
2020-09-19 21:41:31 +02:00
Ovahlord df370885a0 fixed nopch build 2020-09-11 21:43:30 +02:00
Giacomo Pozzoni fe30a6ef00 Core/AI: Make critters flee as soon as engaged in combat and make them evade after they stop running in fear 2020-09-11 21:33:54 +02:00
Ovahlord b6ea5033fa Core/Movement: 5cc2b41146 codestyle followup 2020-09-11 21:13:01 +02:00
Ovahlord 5cc2b41146 Core/Movement: setting path length limits will now round the amount of smooth path points up instead of down to reduce edge cases in which charge effects close to their maximum cast range would return no path 2020-09-11 20:50:57 +02:00
Treeston 8385c3ffd3 Core/Movement: MoveSplineFlag::animId -> animTier, MoveSpline::GetAnimation() -> GetAnimationTier() 2020-09-08 20:52:34 +02:00
Ovahlord 9d345f0d87 Core/Creatures: creature groups no longer unnecessarily throw their data on the heap and formations now support inversing angles when waypoint Ids are 0 2020-08-28 23:02:05 +02:00
jackpoz 5989ad860c Core/Movement: Fix RandomMovementGenerator for swimming creatures
Fix RandomMovementGenerator for swimming creatures not moving at all due to PATHFIND_FARFROMPOLY being handled as wrong path.
2020-08-23 20:38:03 +02:00
Ovahlord c9041a93a5 Core/Movement: reverted the spline segment length validation until he path generation generates proper segments 2020-08-07 23:52:05 +02:00
Ovahlord 3e66838874 Core/Movement: ensure that the wander distance of random movement is always at least 0.1 bathtub.... eeh yards 2020-08-05 18:53:33 +02:00
Ovahlord 2fad073f4c Core/Movement: added velocity argument to MoveCirclePath helper 2020-08-05 17:07:30 +02:00
Ovahlord eea7209142 Core/Movement: ported segment length validation and computePosition updates from master 2020-08-05 17:06:48 +02:00
Ovahlord f9fdce6d4f Core/Movement: converted SMSG_ON_MONSTER_MOVE and SMSG_ON_MONSTER_MOVE_TRANSPORT to packet class
* define and use MOVEMENTFLAG2_IS_VEHICLE_EXIT_VOLUNTARY
2020-08-05 13:55:17 +02:00
Treeston 942c3a77da Core: Combat/threat system rewrite (PR #19930)
- PvE combat is now always mutual. UNIT_FLAG_IN_COMBAT is backed by actual references to the units we're in combat with.
- PvP combat is now also tracked, and almost always mutual; spells like Vanish and Feign Death can break this rule. That means we can easily determine a list of players we're fighting.
- By extension, IsInCombatWith now has sensible behavior when invoked on nonplayers.
- Threat and combat systems are no longer the same.
  - They still have an enforced relationship (threat implies combat - clearing combat clears threat)...
  - ...but we can have combat without threat. A creature (with threat list) isn't considered to be engaged until it has an entry on its threat list...
  - ...which means we can now faithfully replicate retail engage behavior. Combat on projectile launch - engagement start on projectile impact. Yay for progress!
- AI method refactor, as already ported in 6113b9d - `JustEngagedWith`, `JustEnteredCombat` and `JustExitedCombat`.
- Vehicle threat is now properly pooled on the main vehicle body (fixes #16542).
- Various edge case bug fixes for threat redirects (Misdirection "cancelling" Vigilance and similar).
- Target re-selection is now significantly faster.
- Fixed a ton of other smaller edge case bugs, probably.

Closes #7951 and #19998.
2020-07-22 16:49:37 +02:00
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