Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Walking Hammerdin bugfix #749

Closed
wants to merge 4 commits into from
Closed

Walking Hammerdin bugfix #749

wants to merge 4 commits into from

Conversation

drallcom3
Copy link
Contributor

The Hammerdin often accidentally clicked on monsters while walking to the end location. He did so while having Vigor active (because the bot thinks he's still walking). The existing fix to activate Concentration early did not work. Now it does.
You might have noticed many complaints about it in Discord.

If you want to test:
Do Eldritch or Trav 10x without the fix as a Hammerdin without any form of teleport. You will notice him casting hammers with Vigor active at the beginning.
With my fix that doesn't happen anymore.

Eld, Shenk, Trav, Pindle fixed. The others not, because they're impossible without teleport anyway.

The Hammerdin often accidentally clicked on monsters while walking to the end location. The fix to activate Concentration early did not work. Now it does.
@D2RLegit
Copy link
Contributor

D2RLegit commented May 6, 2022

Not at a pc but it looks like you took out vigor altogether for the run and replaced it with concentration? Have you verified this still works with a hdin wearing a enigma and also when using charges?

Using teleport charges that much would get expensive.
@drallcom3
Copy link
Contributor Author

Vigor is still being use like before, up until the safe spot right before a boss. Just the last few meters are done with Concentration.
The bot was supposed to do that all along, but the functionality was broken.

Works fine with teleport charges.
I don't have an Enigma, but I don't see why it won't work. I haven't touched that part. Someone has to test it of course.

Hammerdin now uses teleport charges inside Pindle's house, because why not. Prevents the zombies from charging you.

Before no teleport charges were being used.
@drallcom3
Copy link
Contributor Author

I realized that I could just test it in singleplayer, so I did that. No issues with Enigma. Teleports happily around.

Comment on lines -54 to -59
def on_capabilities_discovered(self, capabilities: CharacterCapabilities):
# In case we have a running pala, we want to switch to concentration when moving to the boss
# ass most likely we will click on some mobs and already cast hammers
if capabilities.can_teleport_natively:
self._do_pre_move = False

Copy link
Collaborator

@aliig aliig May 9, 2022

Choose a reason for hiding this comment

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

Why was this function removed? I'm not 100% sure of the consequences of this but @VladimirMakaev might know

Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering the same which is why I asked if it still works for hdin with tele. Ive been running as a walkadin and seems fine. Ill double verify in a bit if enigma still works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When debugging self._do_pre_move it turned out that it reverts back to true. The Hammerdin class logic expected it to stay false though. It was the main culprit of why the Hammerdin seemed to "attack" while having Vigor turned on. It should have switched to Concentration, but didn't. Not relying on self._do_pre_move fixed it immediately and then the on_capabilities_discovered wasn't required anymore.

Also it lead to unneccesarily complicated logic constructs that were hard to follow and could be done in a simpler and more readable way.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I wouldn't touch this code. It can easily break something for Enigma / Tele-Charge paladin . And you need to test 3 different version of paladin on all routes to make sure it's sound:

  1. Walkdadin Trav/Shenk/...
  2. Enigma Paladin Trav/Shenk/...
  3. Tele-Charge Paladin Trav/Shenk

Copy link
Collaborator

Choose a reason for hiding this comment

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

You should just cast Concentration and move with PreMove=False that way you won't change to Vigor.
preMove() will flip to Vigor in case of Walkadin or Tele-Charge (there is no way to pass that telecharge is to be used based on current code structure). So in case you're opting to tele-charge then you should manage PreMove part manually. E.g. casting concentration and doing PreMove=False, TeleCharge = True or PreMove=True if you want Vigor to be on for walking / running out of tele charges and walking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wouldn't touch this code. It can easily break something for Enigma / Tele-Charge paladin . And you need to test 3 different version of paladin on all routes to make sure it's sound:

1. Walkdadin Trav/Shenk/...

2. Enigma Paladin Trav/Shenk/...

3. Tele-Charge Paladin Trav/Shenk

It didn't even work the way it was intended to work. No need to re-introduce bugs.

This PR has been tested extensively with all three variants. Some people even happily and successfully use it for their daily runs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You should just cast Concentration and move with PreMove=False that way you won't change to Vigor. preMove() will flip to Vigor in case of Walkadin or Tele-Charge (there is no way to pass that telecharge is to be used based on current code structure). So in case you're opting to tele-charge then you should manage PreMove part manually. E.g. casting concentration and doing PreMove=False, TeleCharge = True or PreMove=True if you want Vigor to be on for walking / running out of tele charges and walking.

Which is what I did.

@D2RLegit
Copy link
Contributor

D2RLegit commented May 9, 2022

[0.7.3-dev 2022-05-09 06:47:41,781] INFO Capabilities: CharacterCapabilities(can_teleport_natively=False, can_teleport_with_charges=True)

Populates when using walkadin for pindle.
Walkadin does not work for pindle in this pr.

@drallcom3
Copy link
Contributor Author

I get:
INFO Capabilities: CharacterCapabilities(can_teleport_natively=False, can_teleport_with_charges=False)
and when adding checks further down the line:
DEBUG capabilities.can_teleport_natively: False
DEBUG capabilities.can_teleport_with_charges: False
when doing Pindle without any teleport equipped.

Did you get that message while having a teleport charge item equipped and ready?

I can only achieve
INFO Capabilities: CharacterCapabilities(can_teleport_natively=False, can_teleport_with_charges=True)
if I have a teleport item with charges equipped and a hotkey assigned in-game and a hotkey assigned in the config. Which is (I assume) cirrect behaviour. If you did the test with a teleport charge item equipped, you're not a Walkadin anymore. I just ran the test. With teleport charges the Hammerdin behaves exactly like in master. Which is correct behaviour, since this PR is about walking, not teleport charges. The Hammerdin needs some more fixes, as you have discovered, but I didn't want to make this PR too massive.

In short: I can't see a bug here (that didn't already exist).

@D2RLegit
Copy link
Contributor

D2RLegit commented May 9, 2022

It saying i have teleport charges when i run pindle even though im not using any teleport or teleport charge items. it should be a walkdin and its being recognized that it has teleport charges. I will try again if you say your not getting that error.

@drallcom3
Copy link
Contributor Author

Thanks.
If your self.capabilities.can_teleport_with_charges were incorrectly true, that would be a bug well beyond the Hammerdin file (as it's not being set in there and the info shows up before any boss functions are executed).

@D2RLegit
Copy link
Contributor

D2RLegit commented May 9, 2022

Pretty sure its because you removed

def on_capabilities_discovered(self, capabilities: CharacterCapabilities):
    # In case we have a running pala, we want to switch to concentration when moving to the boss
    # ass most likely we will click on some mobs and already cast hammers
    if capabilities.can_teleport_natively:
        self._do_pre_move = False

but i could be wrong. I am trying pindle on another pr real quick. Works on other pr's your seems to have problems with pindle and a walkadin.

@drallcom3
Copy link
Contributor Author

What exactly does happen to your Hammerdin when you do Pindle with this PR?

@drallcom3
Copy link
Contributor Author

It's actually this #758 bug.
The Hammerdin just made us discover it.

@drallcom3 drallcom3 mentioned this pull request May 10, 2022
Comment on lines -54 to -59
def on_capabilities_discovered(self, capabilities: CharacterCapabilities):
# In case we have a running pala, we want to switch to concentration when moving to the boss
# ass most likely we will click on some mobs and already cast hammers
if capabilities.can_teleport_natively:
self._do_pre_move = False

Copy link
Collaborator

Choose a reason for hiding this comment

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

I wouldn't touch this code. It can easily break something for Enigma / Tele-Charge paladin . And you need to test 3 different version of paladin on all routes to make sure it's sound:

  1. Walkdadin Trav/Shenk/...
  2. Enigma Paladin Trav/Shenk/...
  3. Tele-Charge Paladin Trav/Shenk

Comment on lines -54 to -59
def on_capabilities_discovered(self, capabilities: CharacterCapabilities):
# In case we have a running pala, we want to switch to concentration when moving to the boss
# ass most likely we will click on some mobs and already cast hammers
if capabilities.can_teleport_natively:
self._do_pre_move = False

Copy link
Collaborator

Choose a reason for hiding this comment

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

You should just cast Concentration and move with PreMove=False that way you won't change to Vigor.
preMove() will flip to Vigor in case of Walkadin or Tele-Charge (there is no way to pass that telecharge is to be used based on current code structure). So in case you're opting to tele-charge then you should manage PreMove part manually. E.g. casting concentration and doing PreMove=False, TeleCharge = True or PreMove=True if you want Vigor to be on for walking / running out of tele charges and walking.

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

Successfully merging this pull request may close these issues.

4 participants