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

Increasing General Performance of MFHelper and al #232

Merged
merged 10 commits into from
Jul 2, 2021

Conversation

Ra-Ni
Copy link
Contributor

@Ra-Ni Ra-Ni commented Apr 24, 2021

Previous implementation relied on the leader's current act and resulted in huge delays between changing towns. This motivated me to remove the redundant checks for the leader's act to only once - when the player first joins the game. The remaining act changes are performed by the leader telling the helper to switch acts (much like in follower).

The code has been tested on a stable release and I saw some differences between the stable and dev version. I'd appreciate it if you can confirm it works.

…mply change towns

1. Move the player act variable detector out of the while loop because we don't need it anymore in that main loop. We just need to query the act once to sync with the leader's starting town.

2. add a new goto command that will listen in a similar manner to the follower script.
Just like in Mephisto.js and Andariel.js, a function is used to broadcast the leader's intent on changing acts prior to doing so. This allows the MFHelper to rapidly react to the leader's intention to change acts rather than previous implementations which relied on the leader's current act.
@Ra-Ni
Copy link
Contributor Author

Ra-Ni commented Apr 24, 2021

36d71ff2543a74b5758b6eca69765e72.mp4

@Ra-Ni Ra-Ni changed the title Increasing Performance of MFHelper by Broadcasting the Intents of the Leader Increasing General Performance of MFHelper and al Apr 24, 2021
@Ra-Ni
Copy link
Contributor Author

Ra-Ni commented Apr 24, 2021

  1. Why were we using skill cast on tk?

minor change, unicast is safer.
@XoniBlue
Copy link

XoniBlue commented May 5, 2021

getting an error when using these update files. player = Misc.findPlayer(Config.Leader); no fuction line 118

woops forgot curly bracket
@Ra-Ni
Copy link
Contributor Author

Ra-Ni commented May 6, 2021

getting an error when using these update files. player = Misc.findPlayer(Config.Leader); no fuction line 118

ill work on it tonight. they made changes to it

Copy link
Collaborator

@jaenster jaenster left a comment

Choose a reason for hiding this comment

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

Thanks for making a pull request!

I been a bit behind on things, so sorry if you had to wait a while. I never use MFHelper so i have nothing to say about the content, but i have a few suggestions for small code changes, with examples how i should do it. Feel free to ignore my examples and find your own fixes =)

Seems good for the rest! Thanks

d2bs/kolbot/libs/common/Pather.js Show resolved Hide resolved
d2bs/kolbot/libs/common/Pather.js Outdated Show resolved Hide resolved
d2bs/kolbot/libs/bots/MFHelper.js Outdated Show resolved Hide resolved
d2bs/kolbot/libs/bots/MFHelper.js Outdated Show resolved Hide resolved
d2bs/kolbot/libs/common/Pickit.js Outdated Show resolved Hide resolved
Ra-Ni added 5 commits May 9, 2021 03:49
Broadcast only if MFLeader is true (reduces workload).
removed bin search in favor of just pop
TK packet casting is active if packetcasting is 2. Else, skill cast it.
@Ra-Ni
Copy link
Contributor Author

Ra-Ni commented May 9, 2021

Thanks for making a pull request!

I been a bit behind on things, so sorry if you had to wait a while. I never use MFHelper so i have nothing to say about the content, but i have a few suggestions for small code changes, with examples how i should do it. Feel free to ignore my examples and find your own fixes =)

Seems good for the rest! Thanks

Appreciate your feedback. I implemented the changes you suggested.

@Ra-Ni Ra-Ni requested a review from jaenster May 9, 2021 09:16
@XoniBlue
Copy link

XoniBlue commented May 9, 2021

still throws an error from mfhelper line 118 player = Misc.findPlayer(Config.Leader); says not a function

@jaenster
Copy link
Collaborator

jaenster commented Jul 2, 2021

still throws an error from mfhelper line 118 player = Misc.findPlayer(Config.Leader); says not a function

This does not make sense, but eh. Could anyone confirm this? =)

@e-n-g
Copy link
Contributor

e-n-g commented Jul 2, 2021

still throws an error from mfhelper line 118 player = Misc.findPlayer(Config.Leader); says not a function

This does not make sense, but eh. Could anyone confirm this? =)

I'm not seeing that issue. I just imported the changes and it's running as expected; having them switch acts early does seem to speed things up.

@XoniBlue make sure you're using an up to date Misc.js, older version don't have the findPlayer function.

@jaenster jaenster merged commit cd4b163 into blizzhackers:master Jul 2, 2021
mf022 added a commit that referenced this pull request Jul 11, 2021
@IceKickr
Copy link

After I pulled this commit my bot team stopped working. I can see my leader saying things like "goto A2" but followers are ignoring the command in most cases. In some other cases, leader doesn't say "goto AX" at all. I'm not sure what's going on. Anybody else seeing this behavior?

@e-n-g
Copy link
Contributor

e-n-g commented Jul 29, 2021

After I pulled this commit my bot team stopped working. I can see my leader saying things like "goto A2" but followers are ignoring the command in most cases. In some other cases, leader doesn't say "goto AX" at all. I'm not sure what's going on. Anybody else seeing this behavior?

My team hasn't had that issue. They follow the leader just fine up until Chaos where MFHelper gives up and DiabloHelper takes over.

Two things I have noticed is that it's a bit slower to give up on MFHelper once they reach CS since the area check was removed (not really a big deal and expected) and that after Baal I have the leader run additional scripts (so no more followers at that point) and the leader will sometimes say to go to the wrong act. I haven't had time to look into that one though.

@IceKickr
Copy link

IceKickr commented Jul 29, 2021

My team hasn't had that issue. They follow the leader just fine up until Chaos where MFHelper gives up and DiabloHelper takes over.

Hmmm. Must be some (mis)configuration on my side.

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

Successfully merging this pull request may close these issues.

5 participants