Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing smooth waypoint features #22863

Open
Ovahlord opened this issue Dec 15, 2018 · 10 comments
Open

Missing smooth waypoint features #22863

Ovahlord opened this issue Dec 15, 2018 · 10 comments

Comments

@Ovahlord
Copy link
Contributor

Ovahlord commented Dec 15, 2018

Description:
Let's turn this into a documentation about what features has been added and what are missing.
Since the rework of the waypoint movement the node-to-node movement works pretty much as it should and serves as a perfect base for the implementation of the missing parts.

There are yet two missing features that needs to be added:

  • Adding at least one spline point to a packet that is a little bit ahead of the actual path.
  • Transitioning from one point to another should be smoothened out. The current path generators are just going straight for the destination without considering the starting angle of the npc.

Current behaviour:
current state waypoints
This is the current state. It's a very simple point to point movement with multiple spline points between the start point and destination that are being generated by the pathfinding.

  • The node to node movement is correct, the connection between them isn't.

Expected behaviour:
expected state waypoints
This is the state as it happens to be on retail. The first difference is:

  • The path packet contains at least one additional spline point that goes beyond the destination of a waypoint. Mostly to prevent npc's appear stuttering when stopping for a short moment or in case of a lag.
  • Every turn to a different direction is containing a smooth curve that is currently being completely ignored. The pathfinding needs to consider the movers current orientation to build a curve to join the path.
  • It appears that Blizzard is using some internal orientation values for every single waypoint to create curves in between the single points which can be seen very well on scripted flying mounts.
    This would look like this then:

expected state waypoints

There has been done some explaination by Treeston about that when he was adding the spline-chain system which is basically a hack since it merely reproduces the movement from static data that usually should be generated by the core on its own.

Summary:
Waypoints are no real waypoints. In fact they are segment markers. These segment markers are used by the spline system to calculate one giant path in one stroke and split the generated spline points into smaller segments that are split by the waypoint nodes. Why? To send smaller monster move packets and of course for scripting purposes. This also explains how they handle the one spline point ahead case. It's the first spline point of the next path segment.

Steps to reproduce the problem:

  1. Just do any waypoint movement on TC and check retail / videos afterwards

Branch(es):
both

TC rev. hash/commit:
master: e9bcae1
335: 9a924fb

@Keader
Copy link
Member

Keader commented Dec 15, 2018

Related with
#13467
#18888
28050f3
#18020

@Ovahlord
Copy link
Contributor Author

The first major difference between this and the previous discussions is: the smooth waypoint movement does NOT generate an entire path from all points in one strike. It is still point to point movement but with smooth transitions by using the extra long pathings and smoothing out curves.

@Keader
Copy link
Member

Keader commented Dec 15, 2018

The more close of retail behavior, is treeston goodhack movement (long spline or something like that) xd

@Treeston
Copy link
Member

Treeston commented Jul 8, 2019

#17946 for previous discussion

@Nyr97
Copy link
Contributor

Nyr97 commented May 6, 2020

Is there no way to try to get how movement is developed through flight path and copy the behaviour onto normal waypaths? I know for a fact that the smoothing is done when transitioning from one waypoint to another during flight paths.

@Treeston
Copy link
Member

Treeston commented May 6, 2020

iirc flight path waypoints are in dbcs, animation is done fully client side

@Nyr97
Copy link
Contributor

Nyr97 commented May 6, 2020

So basically we can't. I can tell as well that sometimes when npcs are trying to get involved in combat or when leaving a fight to get back to their waypath, these do transition smoothly between their position to the next waypoint of their pathing. It's rare to be seen since certain conditions are supposed to be met but I've noticed it a few times now.

@Killyana
Copy link
Member

Killyana commented May 7, 2020

We already have a PR #23864 for this issue, it works fine in cata as you can see in the video, but not in wotlk for some reason.

@Nyr97
Copy link
Contributor

Nyr97 commented May 7, 2020

I've tried that solution in WoTLK branch but it seems to be making the npcs do weird stuff in pathing, literally rolling back and in the whole time. As for any other branch, I can tell it doesn't work on the WoD one either.

@Ovahlord
Copy link
Contributor Author

Ovahlord commented May 7, 2020

Long story short on how to achieve smooth movement:

  1. Splines have to go beyond the destination of a waypoint.

  2. Once the original waypoint position is reached, launch the next spline, which then includes the unreached destination of the previous spline. That's it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants