EFHIII / balatro-calculator

A tool for calculating the score of a hand in Balatro
MIT License
86 stars 12 forks source link

Queen Rank Location #25

Closed Lawgikill closed 8 months ago

Lawgikill commented 8 months ago

Description of the bug Why do queens always appear all the way on the left even though as a rank, they are supposed to go in between Kings and Jacks? Even if you have Aces or Kings in hand, a Queen will always appear all the way on the left.

EFHIII commented 8 months ago

This is intentional. The point is so that Shoot the Moon (when it is present) triggers before steel cards

Lawgikill commented 8 months ago

But wouldn't the presence of Shoot the Moon + "Optimize Hand" move Queens over to the left? You don't seem to arbitrarily re-order things "in case something is there" if it isn't. This looks like the only case where you do?

EFHIII commented 8 months ago

"Optimize hand" only optimizes the cards played and the order of the cards played. The cards in-hand aren't optimized because it would be too computationally intensive, but there's only a few things that have to be considered so the ordering shown should always be optimal despite only doing a basic sorting.

Lawgikill commented 8 months ago

You say that... but I know that's not the case. Take what you do for Raised Fist Joker as an example. Cards in hand are ordered accordingly.

Lawgikill commented 8 months ago

I mean, I know that Raised Fist doesn't generally care the order of cards in hand. I just notice specifically that you order the cards in hand because of the presence of Raised Fist. That's all I'm saying about the Queens in hand. It's only there and ordered differently for the presence of Shoot the Moon. Wouldn't it be easy to do something like: if Shoot the Moon then Queens on left?

EFHIII commented 8 months ago

Raised fist specifically is a special case that's handled in the sorting because raised fist is, similar to Shoot the Moon, something that you want it to trigger before steel cards or Baron. It's still just a sort though handled in a completely different part of the code than the main optimizer engine.

Here's where it checks for Raised Fist, and the lines that follow will (when Raised Fist is present and active) change the sorting to accommodate Raised Fist. https://github.com/EFHIII/balatro-calculator/blob/7608a0785f69e0dd848af5c246784940a93b5b0a/main.js#L667

EFHIII commented 8 months ago

Wouldn't it be easy to do something like: if Shoot the Moon then Queens on left?

It would be possible, but not the most straightforward because of how it's handled as an edge case. It's definitely not a bug though.

Lawgikill commented 8 months ago

Yea, totally fair. Not a big deal either way, just something I noticed was odd.