Skip to content

Conversation

@Typhi
Copy link
Collaborator

@Typhi Typhi commented Oct 10, 2024

Everything the bot needs to go after the Corrupt Heart

  • A toggle that enables basic chasing and pickup of the Act 4 keys
  • Knowledge of Heart, Spear, and Shield powers
  • Comparator for preferring defeating Spire Spear before Shield
  • Logging in run_history for key pickup
  • A strategy making use of all of those things - Observant Heartslayer (A copy of existing Watcher strat))

Also:

  • Added a slight health penalty on map pathing decision-making that include the Burning Elite
  • Logic for breaking out of a useless infinite

Notes:

(cherry picked from commit 3031093e62eb87399c940c136adeed7fe3b696b2)
(cherry picked from commit 68ca384e6097706b408553c0184492075253aebe)
(note: relies on a newer version of comm mod than what is currently in steam workshop)
(note: relies on a newer version of comm mod than what is currently in steam workshop)
… might be useful when hunting infinites later
@xaved88 xaved88 self-requested a review October 10, 2024 21:12
@xaved88 xaved88 self-assigned this Oct 10, 2024
Copy link
Owner

@xaved88 xaved88 left a comment

Choose a reason for hiding this comment

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

Very nice work! Really solid changes, and great test coverage!

I made a few comments - some are just small nit things to improve. There are two larger structural changes I propose, but I'm open to them not being handled in this PR.

if amount:
self.player.block += amount
self.trigger_block_effects()
self.player.block = min(self.player.block, 990) # lower than 999 to avoid flailing against Beat of Death
Copy link
Owner

Choose a reason for hiding this comment

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

for efficiencies sake we could put this at like 500?

Copy link
Collaborator Author

@Typhi Typhi Oct 15, 2024

Choose a reason for hiding this comment

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

I like the thought but think I'd like to err on the side of it being as close to technically correct as possible and rely on other systems for not wasting our time too much instead of building in (more) intentional errors for efficiency

return False

def handle(self, state: GameState) -> HandlerAction:
def handle(self, state: GameState, slay_heart: bool) -> HandlerAction:
Copy link
Owner

Choose a reason for hiding this comment

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

So, this works for now, but I think we may want to adjust the approach here.

  1. We're only telling it when it handles whether it should consider slaying the heart, but not on can_handle. So that means that we couldn't ever have a handler distinguish between whether or not it should be considered whether it's going for the heart or not. Ultimately, this means less reusable handlers.

  2. It will be kind of ugly having this exist in both methods can_handle and handle of the handlers. Perhaps injection via constructor when we're making the handlers would be nicer. (Something to consider, not saying we have to make that change).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed on not making further changes for now - there are bigger changes we'd want to make here.
Might make a suggestion for people to use latest release to avoid too many issues with us changing stuff all the time.

# just the first letter of the key is enough
keys = []
if "keys" not in self.game_state():
return ['Communication Mod out of date']
Copy link
Owner

Choose a reason for hiding this comment

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

Will this cause a nice readable error to show up in the STS Mod or logs? We should probably be logging it ourselves as well in the bottled_ai logs for more visibility.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It will not, and OK sounds good!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

After further discussion: I've removed the message from state.py and isolated that handling to logger.py

@Typhi
Copy link
Collaborator Author

Typhi commented Oct 16, 2024

Review comments sufficiently addressed, now waiting for Comm Mod changes to be merged and released before merging on our end.

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