hectorgimenez / koolo

Diablo II Resurrected bot written in Go
MIT License
81 stars 52 forks source link

Casting skills along the way. #37

Closed RobotGaston closed 11 months ago

RobotGaston commented 12 months ago

Thank you for further improvements. Thank you for looking into cta and buffing improvements.

There is a problem with a new added "buffing" system in - 7fee717

Character - sorceress.

She has CallToArms OnSwap.

On her way to an objective she can randomly stop during teleporting, in the middle of location where she is not supposed to, then select frothen armor and start casting it 10x times or so (freezing in one place), after that, character switching back to teleport and proceed to the final destination point.

Such behaviour was never observed in a "previous main build version"

Could you look into this please? thank you :)

P.S. I'm not experiencing any difficulties with waypoint menu. Character can select all the acts, wps with 100% success...

hectorgimenez commented 12 months ago

mmmm, definitely that's not the expected behavior 🤣 In theory with the new implementation (not very tested at this point, honestly) the expected behavior should be: when character gets out of the town, if any buff is missing, it will rebuff all of them (including cta), and continue teleporting, but at anytime it detects again a missing buff will run the buff action again, but it should be very fast, so yeah if your frozen armor expires during teleport it should stop, rebuff and continue teleporting.

Are you using Frozen, Shiver or Chilling armor? is CTA used also when that thing happens? it's buffing also just at the beginning when character uses the WP for the first time in a game?

RobotGaston commented 12 months ago

-I'm using Frozen armour.

-CTA is used when this happens. (I have CTA on the swap in 2nd slot).

-And yes, it is buffing at the start of the run correctly (at the waypoint when character uses wp for the first time :) ).

It correctly casting buffs where it supposed to, at the start of the each and every run while the character is getting on the selected waypoint (andariel, countess, ect...)

- Sometimes at the start at the run character goes to the starting waypoint, selecting teleport skill, teleport away from wp, and only after that it casting BO and Frozen armour.

Here is the log:

internal/bot.go:92 Load completed, continuing execution action/buff.go:80 CTA found: swapping weapon and casting Battle Command / Battle Orders action/buff.go:44 Buffing... action/buff.go:80 CTA found: swapping weapon and casting Battle Command / Battle Orders DEBUG action/buff.go:44 Buffing...

-

Character casts BO from the CTA at the start of the run. Then character going to his target and during teleportation to it it stops in random place in a location in pack of mobs, and starts casting real quick Battle orders, Battle command, and frozen armour sticking on the casting frozen armour. Repeating casting frozen armour 8-10x times, then unsticking, switching to teleport skill and proceed to teleport further to it's target...

Thank you for the explanation. After reading it this is what I think is happening:

The problem I suspect is - the istate of the character, by some reason, is incorrectly being detected by the program - that character is out of buff (along the way while teleporting), which is triggering it to recast the buff it thinks is missing. While in reality the buffs are ON and active...

my guess is: -the program is Incorrectly determines the state of the character while on the battlefield... (It thinks buffs are OFF and needs to be re recasted while they are actually ON).

It happen not all the time, just time to time...It needs to be caught...:) I observed it more often happened in arcane sanctuary (summoner routine) during teleportation, and in a more rarer occasion in a countess runs. I'll keep on testing and report back If I had anything to add...

RobotGaston commented 12 months ago

Just observed. -Character is not casting buffs, at the start of each run.

When in game, if the character still has a buffs on it from a previous run it was doing in the same game, it's NOT casting a rebuffs in a new next run. It just starting a next run, goes to a waypoint and goes straight to target skipping casting a buffs at waypoint in a location (which it supposed to do).

Next run is started. Character going to wp, SKIPPING buffs, and just starting to teleport to the final destination. Somewhere in the middle of the teleportation. in a random place. character stops, RECASTS - BO -BC -F ARMOUR - gets stuck on recasting F Armour - keeping it casting 8-10 times staying in place. and thennn being unable to unstick of recasting F Armour ending game with this :

DEBUG internal/bot.go:92 Load completed, continuing execution DEBUG action/buff.go:80 CTA found: swapping weapon and casting Battle Command / Battle Orders DEBUG action/buff.go:44 Buffing... DEBUG health/belt_manager.go:32 Using HealingPotion potion on Mercenary [Column: 1]. HP: 90 WARN internal/single_supervisor.go:77 Game finished with errors, reason: unrecoverable error occurred, game can not continue: attempt limit reached on step: MoveToStep: path could not be calculated, maybe there is an obstacle or a flying platform (arcane sanctuary). Game total time: 369.72s github.com/hectorgimenez/koolo/internal.(SinglePlayerSupervisor).Start C:/Users/........../internal/single_supervisor.go:77 main.main.func2 C:/Users/........./cmd/koolo/main.go:96 golang.org/x/sync/errgroup.(Group).Go.func1 C:/.........../go/pkg/mod/golang.org/x/sync@v0.4.0/errgroup/errgroup.go:75

:)

hectorgimenez commented 12 months ago

I pushed a small change, will not fix the problem but I think it will mitigate the effect, now it should be casting the buff sequence at the start of each run.

By the way, could you please confirm when this is happening to you, that really really that at least ONE buff was missing? I've been trying it for a while and for me is always casting the buff only when at least one is missing. I don't have CTA right now so testing that part is difficult.

RobotGaston commented 12 months ago

thank you for the update, Hector! :) Was waiting for the changes/tweaks impatiently... :) as the https://github.com/hectorgimenez/koolo/commit/7fee71774a47f3dbd23d744955a54ea60bbbd3c0 was unusable for me at that state.. )

I put the 3df89d9 on test right now.

Will report back :)

and yes, you are right, the above problem appeared only when I used CTA on a 2nd slot for the character. When I don't have CTA, and I set my config file to - useCTA=FALSE, there wasn't any problem at all as I can recall... Sorceress was correctly applying frozen armour at the start of the runs and there wasn't any problems or stops while teleporting...

Also Thank you Very Much! for giving a "buffing" sequence a separate file, this is Highly appreciated. It's more friendly and tweak ble this way.

anyhow, rushed to the tests ...

hectorgimenez commented 12 months ago

btw, the "usecta" configuration flag was removed, now it's ignored. If the tool detect the CTA equipped and the keybindings assigned it will try to use it automatically, if you don't have CTA or keybindings are not set, will skip. So you don't need to keep switching on/off the flag.

RobotGaston commented 12 months ago

Ahh I see.. :)

okay now, at the start of the run (first run in a new game) on the fist battlefield wp sorceress giving self bo: (double times)

internal/bot.go:92 Load completed, continuing execution action/buff.go:84 CTA found: swapping weapon and casting Battle Command / Battle Orders action/buff.go:48 Buffing... health/belt_manager.go:37 Using HealingPotion potion [Column: 2]. HP: 84 MP: 229 action/buff.go:84 CTA found: swapping weapon and casting Battle Command / Battle Orders action/buff.go:48 Buffing...

I observed full stop at arcane sanctuary, uninformatively:

Sorc got to waypoint - arcane sanctuary - teleported 1 step away, performed this on a battlefield: (In a location away from safe waypoint zone)

INFO action/waypoint.go:99 Traversing areas to reach destination {"areas": [74]} DEBUG internal/bot.go:85 Loading screen detected, waiting until loading screen is gone DEBUG internal/bot.go:92 Load completed, continuing execution DEBUG action/buff.go:84 CTA found: swapping weapon and casting Battle Command / Battle Orders DEBUG action/buff.go:48 Buffing... DEBUG health/belt_manager.go:37 Using HealingPotion potion [Column: 2]. HP: 84 MP: 229 DEBUG action/buff.go:84 CTA found: swapping weapon and casting Battle Command / Battle Orders DEBUG action/buff.go:48 Buffing...

and after that freezed in 1 spot with a full stop, ...not moving further. I waited for about 1 minute then terminated program...manually. No errors where given. INFO internal/supervisor.go:32 Shutting down NOW.

Just witnessed also this: (but more carefully):

1st run in the game, sorc, correctly loaded in waypoint, gave herself a BO with CTA, aaaanddd instead of switching to teleport and proceed to the destination, she FREEZED in 1 spot (just like in arcane previously), unable to select and switch to teleport skill, - (attacking skill just showing melee attack) :( After Bo, sorc put a mouse cursor slightly away from waypoint, made a click, walked on foot to the cursor position, and FREEZED there with sending "w" spam.

I terminated manually and I got this "spam" in a debug window while where doing it:

"C:\Users...........>wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww^W^W^W^W^W^Wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww" (program got stuck pressing "w" with keyboard sending command to switch a slot from BO(2nd) to 1st(MAIN) ?? )

Program by some reason after bo got stuck in sending with keyboard the line is written above...

This is floating problem again....:( Sometimes she goes okay, and sometimes she's getting into this situation...with "freezing after bo" behaviour...with the incorrect keyboard sends...

On a good side - I have never seen her getting stick with recasting frozen armour in 1 spot in a location any more... :) But now we are with this situation...:)

I'm stooping observation and using "3df89d9" at this point...please...send fixes? <3

Also, when character "reboes" at waypoint when goes with a next "script", It casting only Battle orders for example - Ignoring to cast a Battle command or vice versa... (At first run of the game character is correctly always Casting both BO and BC, but in next runs - in some runs (in the same game) it casts both skills, and in some,- only 1 of 2 skills available...). I suppose it might be somehow be connected with the "character state detection" ...I think it's better to force it to recast both skills (BO and BC) no matter if they are ON or OFF at the time of the cast at the start of the every run....Also casting system should be calculated and work from the lowest roll possible on the call to arms weapon :)

hectorgimenez commented 12 months ago

Also, when character "reboes" at waypoint when goes with a next "script", It casting only Battle orders for example - Ignoring to cast a Battle command or vice versa... (At first run of the game character is correctly always Casting both BO and BC, but in next runs - in some runs (in the same game) it casts both skills, and in some,- only 1 of 2 skills available...). I suppose it might be somehow be connected with the "character state detection" ...I think it's better to force it to recast both skills (BO and BC) no matter if they are ON or OFF at the time of the cast at the start of the every run....Also casting system should be calculated and work from the lowest roll possible on the call to arms weapon :)

I have the feeling this is related to the skill selection speed, maybe it's too fast, I added an small delay, so hopefully it will help.

I hope the teleport problem is fixed now also, could you check with the latest changes if the situation is better AND is rebuffing when buffs are down (and not stuck rebuffing forever)? As said, difficult for me to test since I don't have CTA right now.

RobotGaston commented 12 months ago

Thank you. I Put(https://github.com/hectorgimenez/koolo/commit/ffa26e12ad79cc69c1e28d92c8bdf4c85cdf0d35) ffa26e1 on a test now.

Tested for a while.

Nope. unfortunately CTA behaviour is not fixed :(

Problems are stayed the same...: -spam with "C:\ ..............>wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww") When trying to cast a BO BC. at the start of the run. =(Character is sticking in a state and being unable to switch to the 2nd slot to be able to cast BO and BC - spamming "wwwwwwwwwww" constantly...)

-Not casting BO BC at the start of the run (Pindleskin - casting BO in the middle of the fight when reached the pindle and during the fight with him, not at the start of the run instead..)

-Also character "doublebuffs" in the first run at the start of the game. (Casting BO+BC then Frozen Armour , then casting BO+BC for the second time, and only that moving further)

-I Understand it is impossible to make a changes based on descriptions, you've gotta see it yourself. If you need a CTA ,-message me, we'll think of something... ( I'll give you mine :) (softcore/hardcore? game name/passwrd and time you are available to receive it, If You'd like to :) )

Thank you again. Much appreciated everything.

hectorgimenez commented 12 months ago

Do you have discord? maybe we can talk there on how we can test this.

RobotGaston commented 12 months ago

Yes, I Do have a discord, :) Where should I join?

and

testing (https://github.com/hectorgimenez/koolo/commit/2176149f66a567930751daa479f1ff3d09514a1f) 2176149

now :) Thank you for changes.

okay. It is better now.

Character giving BO+BC at the start of the game. In The 1st run. In the same game on the 2nd run (Pindle) - character is not giving BO+BC after she enters in red portal. Neither she gives a BO+BC in the middle of the fight now which is good. (Possible here is we having a correct behaviour as the previous buffs - BC+BO+FrozenArmour are still on the character are active and correctly detected).

On the 1st run of the game , during the "buffing" at the waypoint character is feeding a health potion to the merc, while mercenary is at full health on the battlefield:

DEBUG action/buff.go:87 CTA found: swapping weapon and casting Battle Command / Battle Orders DEBUG action/buff.go:51 Buffing... DEBUG health/belt_manager.go:37 Using HealingPotion potion [Column: 2]. HP: 84 MP: 230 ((<<<<<<---------This line....Health is full.)) DEBUG action/buff.go:87 CTA found: swapping weapon and casting Battle Command / Battle Orders ((<<<<--CTA found 2 times.....)) DEBUG action/buff.go:51 Buffing... (Buffing where giving a 2nd time)

-and now , sometimes, character can get stick on chugging health potions during teleportation :

Character got to wp. Gave self buffs. Drank a HP while at full health. Started teleporting. Got stick drinking HP's while at full health until the belt is empty:

DEBUG internal/bot.go:92 Load completed, continuing execution DEBUG action/buff.go:87 CTA found: swapping weapon and casting Battle Command / Battle Orders DEBUG action/buff.go:51 Buffing... DEBUG health/belt_manager.go:37 Using HealingPotion potion [Column: 2]. HP: 84 MP: 230 DEBUG action/buff.go:87 CTA found: swapping weapon and casting Battle Command / Battle Orders DEBUG action/buff.go:51 Buffing... DEBUG health/belt_manager.go:37 Using HealingPotion potion [Column: 2]. HP: 84 MP: 340 DEBUG health/belt_manager.go:37 Using HealingPotion potion [Column: 2]. HP: 68 MP: 344 DEBUG health/belt_manager.go:37 Using HealingPotion potion [Column: 2]. HP: 79 MP: 332(character actually is at FULL health here but still hp is drank ) DEBUG health/belt_manager.go:37 Using HealingPotion potion [Column: 1]. HP: 84 MP: 335(character actually is at FULL health here but still hp is drank ) DEBUG health/belt_manager.go:37 Using HealingPotion potion [Column: 1]. HP: 84 MP: 332(character actually is at FULL health here still hp is drank ) DEBUG health/belt_manager.go:37 Using HealingPotion potion [Column: 1]. HP: 84 MP: 332 (character actually is at FULL health here still hp is drank )

...ending up reaching the boss fight with an empty belt.

Character is getting incorrect health self state now (or merc's health) drinking HP's while actually is at full health (might be happening time to time and only during teleportation.). I think during the battles the character can correctly monitor his health/mana state at the same time...