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

Refactor move.go, interact_entrance.go, interact_object.go #658

Closed
wants to merge 14 commits into from

Conversation

elb91
Copy link
Contributor

@elb91 elb91 commented Feb 3, 2025

  • New Spirals (EntranceSpiral , ObjectSpiral) using description (.desc) linked to .txt files in d2go .

  • Simplified and cleaned Action Move.go EnsureAreaAsync() no longer required, removed redundant movement and clicks that doesnt belong there. Prevent an issue with harem/palace cellar (similar area) where there is 2 entrance leading to next area. We pick the nearest.

  • Multiple isCompletedFn checks for different objects wich allow to remove EnsureAreaAsync() .
    For portals PlayerUnit.States.HasState(state.JustPortaled) this is first thing that confirms we interacted with portal, after we check for OpenMenus.LoadingScreen then finally we check if we reached area. Removed hardcoded portal destinations since we have them accessible from memory object.PortalData.DestArea

interact_entrance.go :
Now all entrances are compatible with koolo. It was failing with multiple tal rasha tombs, halls of vaughts and possibly more that i am unaware of. Enhanced using implementation in d2go for Entrances rather then Adjacentlvl coordinates only. Since Adjacentlvl and entrance share exact coordinates (100%) we can link it to unittype5 (entrance) then get the description from lvlwrap.txt wich contains precious information related to its size, direction( left, right, bottom) etc. We still need UnitType 2 here because sometimes entrances like ancient tunnel is both (unittype 2 the trap, unittype 5 to enter area)

Simplified runs using red portals : we can directly do action.InteractObject(portal, nil) and provide no completion check. On a next update it will be possible to simply do MoveToArea(area.Tristam) for exemple.

cleaned tp_actions.go and added a check if we stand next to waypoint before creating portal. Its hard for bot to hover portal due to waypoint being bigger then the portal hitbox. We simply move away from it before making portal.

extra:
Cow lvl:
Configurable option to kill rakanishu( or skip) this speeds up run especially for mosaic who needs to build stack before killing anything. It will go directly in tristam if disabled. Also added a little offset from wirt corpse to move after picking up leg to prevent bot struggling with gold piles

elb91 added 2 commits February 3, 2025 10:59
- New Spirals (EntranceSpiral , ObjectSpiral) using description (.desc) linked to .txt files in d2go .

- Simplified and cleaned Action Move.go
 EnsureAreaAsync() no longer required,  removed redundant movement and clicks that doesnt belong there. Prevent an issue with harem/palace cellar (similar area) where there is 2 entrance leading to next area. We pick the nearest.

Multiple isCompletedFn checks for different objects wich allow to remove EnsureAreaAsync() .
For portals PlayerUnit.States.HasState(state.JustPortaled)  this is first thing that confirms we interacted with portal, after we check for OpenMenus.LoadingScreen  then finally we check if we reached area.
Removed hardcoded  portal destinations since we have them accessible from memory  object.PortalData.DestArea

interact_entrance.go :
Now all entrances are compatible with koolo.  It was failing with multiple tal rasha tombs, halls of vaughts and possibly more that i am unaware of.
Enhanced using implementation in d2go for Entrances rather then Adjacentlvl coordinates only. Since Adjacentlvl and entrance share exact coordinates (100%) we can link it to unittype5 (entrance) then get the description from lvlwrap.txt  wich contains precious information related to its size,  direction( left, right, bottom) etc.
We still need UnitType 2 here because sometimes entrances like ancient tunnel is both (unittype 2 the trap, unittype 5 to enter area)

Simplified runs using red portals : we can directly do action.InteractObject(portal, nil)  and provide no completion check.  On a next update it will be possible to simply do MoveToArea(area.Tristam) for exemple.

cleaned tp_actions.go  and added a check if we stand next to waypoint before creating portal.  Its hard for bot to hover portal due to waypoint being bigger then the portal hitbox. We simply move away from it before making portal.

Cow lvl: Configurable option to kill rakanishu( or skip) this speeds up run especially for mosaic who needs to build stack before killing anything. It will go directly in tristam if disabled.
Also added a little offset from wirt corpse to move after picking up leg to prevent bot struggling with gold piles
If we're in range but can't interact, try clicking once to get closer. Sometimes pathfinder end up at an angle where it cant hover the entrance

also increased radius to 4 findNearbyWalkablePosition . 3 isnt enough sometimes to find a walkable position
@elb91 elb91 marked this pull request as draft February 4, 2025 23:33
@elb91 elb91 marked this pull request as ready for review February 6, 2025 21:49
@davidfvsilva
Copy link
Contributor

davidfvsilva commented Feb 11, 2025

I found a bug with this refactor: I've been testing it.
When you moveToArea in an adjacent level, the bot proceeds to the area BUT he might not have that closest entrance as the destination, and can go ALL THE WAY to the other end of the map to another zone entrance.

Try to go from Frigid Highlands to Bloody Foothills for testing @elobo91
Another test case would be to go from Lower Kurast to Flayer Jungle

@davidfvsilva
Copy link
Contributor

I also found an issue with entrances that have animations, like the Kurast temples. Most entrances seem to be fine, including the sewers entrances.

@elb91
Copy link
Contributor Author

elb91 commented Feb 12, 2025

I also found an issue with entrances that have animations, like the Kurast temples. Most entrances seem to be fine, including the sewers entrances.

Ok i will take a look at both these case. Looks like will have to check for object mode operating ( wait) then interact with the entrance for these special case . Thanks for testing !

@elb91 elb91 marked this pull request as draft February 15, 2025 11:44
@elb91
Copy link
Contributor Author

elb91 commented Feb 15, 2025

Reconverting to draft since this pr will highly depend on new pathfinder changes

@elb91
Copy link
Contributor Author

elb91 commented Feb 21, 2025

Closed for rework when AquaRush is done with new pathfinder

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.

2 participants