Skip to content

Core/Movement: fix the issues regarding MovePoint not handling correc…#17028

Closed
chaodhib wants to merge 1 commit into
TrinityCore:3.3.5from
chaodhib:move_on_root_fix
Closed

Core/Movement: fix the issues regarding MovePoint not handling correc…#17028
chaodhib wants to merge 1 commit into
TrinityCore:3.3.5from
chaodhib:move_on_root_fix

Conversation

@chaodhib

@chaodhib chaodhib commented Apr 24, 2016

Copy link
Copy Markdown
Contributor

This fix issues regarding Motionmaster::MovePoint() not handling correctly rooted units:

  1. Fix the bug that occurs when MovePoint is called on a rooted npc. The unit would previously "teleport" to the destination point.
  2. Fix the bug that occurs when a unit moving by PointMovementGenerator is rooted. It does not continue its movement after it's unrooted.

The PR is not ready to get merged as is. This is a draft. It needs some polish but the fix seems to be working.

Testing done:

  • call MovePoint() on a static unit and see if that units moves to the point.
  • call MovePoint() on a moving unit and see if that units moves to the point
  • call MovePoint() on a rooted unit. The unit should resume its movement and move toward the point as soon as the root fades.
  • Root (by casting frost nova on it for example) a unit already moving by MovePoint(). The unit should resume its movement and move toward the point as soon as the root fades.

I tried to make the least amount of changes so that the PR is as readable as possible. I think however that the whole movement system needs some serious clean up and this means unreadable and massive PRs in the future I'm afraid.

@ccrs

ccrs commented Apr 24, 2016

Copy link
Copy Markdown
Contributor

ermmm, right xd

I've already done all the work here, lets not duplicate efforts xd
(I need to update my PR I know)

void MotionMaster::ResumeMovement()
{
MovementExpired();
} No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line

@jackpoz

jackpoz commented Apr 25, 2016

Copy link
Copy Markdown
Member

I think however that the whole movement system needs some serious clean up and this means unreadable and massive PRs in the future I'm afraid.

The idea is to have a PR with only cleanup changes, maybe little changes in small PRs (like "Renamed _something() to Something() ") to allow a reviewer spot possible issues

@Aokromes

Copy link
Copy Markdown
Member

Any reason to don't merge this?

@chaodhib

Copy link
Copy Markdown
Contributor Author
  • I need to clean it up a bit
  • I need to test the case where we root a controlled unit. Because of the way I implemented the solution (using MovementSlot::MOTION_SLOT_CONTROLLED,) there might be some issues.

@ccrs

ccrs commented May 26, 2016

Copy link
Copy Markdown
Contributor

mutate is not the way to go.
Delay this till my PRs are merged (or work together with me to fasten things up) and lets make the solution together.

@Treeston

Copy link
Copy Markdown
Contributor

@ccrs where is your pr on this?

@Treeston

Copy link
Copy Markdown
Contributor

This PR introduces a critical bug with mob pathing.

Repro:

  1. Freeze a target (ex. Frost Nova)
  2. Stun the target (ex. Deep Freeze)
  3. Have the freeze effect expire before the stun does
  4. After the stun expires, the mob will not resume moving

@ccrs

ccrs commented Jul 16, 2016

Copy link
Copy Markdown
Contributor

due to the nice logic of duplicating and separate work on 52343241 PRs its simply not updated, but got it working on everything

@Treeston

Copy link
Copy Markdown
Contributor

@ccrs got a branch I can play with? Going through your open PRs and reviewing atm.

@chaodhib

Copy link
Copy Markdown
Contributor Author

The PR has some holes like the scenario described by Treeston and is not ready to merged. However this could be solved by adding another layer in the MoveGen stack (remove the size limit of the stack which is now set to 3). I don't think the idea behind this PR should be dismissed since it's simpler than ccrs's solution because I'm reusing existing components.

@Shauren

Shauren commented Jul 17, 2016

Copy link
Copy Markdown
Member

@chaodhib MoveGen should probably be rewritten to use std::priority_queue with a lot of possible slots
and possible priority (simplified, i know this isnt everything)
stun > root > script_controlled (MovePoint) > target chase > waypoints -> idle

@Aokromes

Aokromes commented Jun 3, 2017

Copy link
Copy Markdown
Member

Conflicting files
src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
src/server/game/Movement/MovementGenerators/PointMovementGenerator.h

@Keader

Keader commented Jun 3, 2017

Copy link
Copy Markdown
Contributor

wow, part of my issues in razorscale is solved here o.o

@chaodhib

chaodhib commented Jun 3, 2017

Copy link
Copy Markdown
Contributor Author

I'm going to focus on #18771 first before I resume working on this PR. However, could you elaborate @Keader ?

@Keader

Keader commented Jun 3, 2017

Copy link
Copy Markdown
Contributor

@chaodhib in #19828 i'm having issues with razorscale making "teleport" instead move after add UNIT_STATE_ROOT and remove UNIT_STATE_ROOT.
And having issues too after remove UNIT_STATE_ROOT, he dont start chase movement again (i need force using me->GetMotionMaster()->MoveChase() )
If he wipes in last phase (ground phase, without unit_state_root) he start walk in the air instead make fly animation

2 of my issues looks like fixed by this pr

@chaodhib

chaodhib commented Jun 3, 2017

Copy link
Copy Markdown
Contributor Author

Ok, I'll investigate as soon as I can.

@ccrs

ccrs commented Jun 4, 2017

Copy link
Copy Markdown
Contributor

@Keader totally not related, you simply erase slot_active with a movepoint....

to put it simple MovePoint erases MoveChase because they share the same slot. 1 : 1 script developer manual. no issue or bug on motionmaster.

@ariel-

ariel- commented Jun 9, 2017

Copy link
Copy Markdown
Contributor

Agree that an api allowing to resume chase after movepoint would make scripting more intuitive.

@Faq

Faq commented Nov 12, 2017

Copy link
Copy Markdown
Contributor

@ccrs where to see your mentioned PR?

@ghost

ghost commented Nov 12, 2017

Copy link
Copy Markdown

@Faq : his TrinityCore PRs are listed here: https://github.com/TrinityCore/TrinityCore/pulls/ccrs

@Aokromes

Copy link
Copy Markdown
Member

Conflicting files
src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
src/server/game/Movement/MovementGenerators/PointMovementGenerator.h

@joschiwald

Copy link
Copy Markdown
Contributor

Superseded by #21888

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants