Jump to content

Movement: Follow path strafing or running backwards


Recommended Posts

Hi folks,

I am working hard to improve the movement of my C# fight class based hunter. Currently I am tuning some infight moves.

At the moment I have some routine which makes the toon to get away from near enemies. It works pretty well in simple situations. It walks away by simulating press/release of movement keys. This movement approach is not easy to manage when it comes to stuck detections and resolution, for example when the bot is going backward and moves against a wall.

I think it would be much easier to solve this issue when the movement was managed with paths. The problem I have with paths is that the toon always follows the paths by turning the back to the mob and running forward.

Is it somehow possible to make the toon follow the path strafing or going backward?

Link to comment
Share on other sites

I am using the current version of wrobot for vanilla private server.

But I am not sure whether or not I explained my question right. What I want to archieve is that I can tell my toon to follow a path to a specific position running backward instead of running forward. I don't mean to reverse a path.

So instead of, for example this:

wManager.Wow.Helpers.Move.MoveInject(wManager.Wow.Enums.Keybindings.MOVEBACKWARD, false);
wManager.Wow.Helpers.Move.MoveInject(wManager.Wow.Enums.Keybindings.MOVEBACKWARD, true);

I want to do something like this:

MovementManager.GoBackward(PathFinder.FindPath(NewPosition), false);

Please note the imaginary GoBackward() method.
Have you an idea how to realize this?

Link to comment
Share on other sites

Sorry, I read your post to quickly, use code like:

        wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) =>
            var me = wManager.Wow.ObjectManager.ObjectManager.Me;
            if (wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause &&
                unit.IsValid &&
                !me.IsCast &&
                unit.IsGoodInteractDistance) // put here your conditions to running backwards
                var p = robotManager.Helpful.Math.GetPosition2DOfAngleAndDistance(me.Position, robotManager.Helpful.Math.GetAngle(unit.Position, me.Position), wManager.Wow.Helpers.CustomClass.GetRange - unit.GetDistance - 3);
                var z = wManager.Wow.Helpers.PathFinder.GetZPosition(p);
                if (z != 0)
                    p.Z = z;
                    wManager.Wow.Bot.Tasks.GoToTask.ToPosition(p, 3.5f, true, context => (wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause));


Link to comment
Share on other sites

Hey thanks! The destination coordinate calculation based on robotManager.Helpful.Math.GetPosition2DOfAngleAndDistance looks interesting.

I just tried the snippet, needs more fine tuning, but could be a base for a solution.

The one thing I thought about is not done with this snippet: Follow a path while walking backward or strafing. The toon is always turning arround and follwing the path looking straight away from the mob.

A human player would either turn 90 degrees and strafe away (to move faster) or simply strafe away to the right or left. Turning 180 degrees around and run away with the back pointing to the mob is not done pretty often by human players.

Any ideas?

Link to comment
Share on other sites

  • 5 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...