ITR13 / BuckshotRouletteMods

A mod that improves the AI of the dealer in Buckshot Roulette
12 stars 1 forks source link

Makes the dealer more deadly. #13

Closed ballardrog closed 3 months ago

ballardrog commented 4 months ago

At a high level, this change has two parts:

There are also some bugfixes sprinkled in, some of which are for new cases that are only explored with the new search and some of which are for pre-existing bugs. The most notable is a fix for the interaction of inverters and magnifying glasses, which should fix issues https://github.com/ITR13/BuckshotRouletteMods/issues/9 and https://github.com/ITR13/BuckshotRouletteMods/issues/10.

Explanation of the new Result logic

The dealer's priorities are, in order:

The assumed priorities for the player are, in order:

These priorities come from the heuristic that if the player makes it to the next round they're probably going to win, because going first with a fresh set of items is a big advantage. Notably, health advantage and item advantage only matter if nobody dies, (or if the dealer dies in a double-or-nothing round) so those are zeroed out in the cases where someone dies, to make the comparison logic correct.

Notable new behaviors exhibited by the dealer

ITR13 commented 4 months ago

Ooo, nice, I'll have to check through it this weekend.

He takes medicine at 1 health in situations where he's more than 50% likely to die otherwise.

The original game doesn't check if the dealer has died after taking medicine, so it kind of bugs out if you did this. Have you fixed that as part of this?

ballardrog commented 4 months ago

Thanks! Yeah, I added checks for the dealer dying after taking expired medicine and for regrowing the barrel after the dealer shoots himself after using a handsaw. Getting the animations working was a little hacky, so there's a pan back to the table between his health going down and you winning the round, but other than that it works.

Yanninay commented 4 months ago

I give you a standing ovation, my friend. Great job, also thanks for solving the issues I posted!

ITR13 commented 4 months ago

Looks good @ballardrog, just reply to the reviews above if you have any comments. I'll test it a bit locally before I merge it.

ballardrog commented 4 months ago

Thanks for reviewing! This ended up being a larger change than I was expecting it to be.

Yanninay commented 3 months ago

@ballardrog, I apologize for distracting you, but could you please check something else. I downloaded the patched mod from your Github page for the sake of interest and tried playing around

Dealer item set: 1) 2 hand saws 2) Spoiled medicine 3) Handcuffs 4) Beer 5) Cigarettes

Didn't have time to film this, but the dealer did the following:

  1. The two remaining rounds are absolutely not blanks, he knows it 2- He says one of his phrases that means I'll be dead soon (He already knows for sure he's won)
  2. He uses a spoiled medicine (His health is already maximum), but he gets lucky and one life is not lost
  3. He smokes cigarettes (His number of lives is still maximum)
  4. He shoots at me using both hand saws and kills me

Of course it didn't cost him any life and looked like a way to troll me, but it's really weird)

ballardrog commented 3 months ago

@PyJSBiba Thanks for bringing it up. It's a side-effect of zeroing out the item valuations in the cases where someone dies. I'd rationalized it as being fine because technically it doesn't matter whether he uses items or not in that case, but it is kind of weird behavior and if it's enough for literally the first other person to try it out to comment on then it's probably worth fixing. I have an idea for a fix but I might not have time to implement it for a couple days.

ITR13 commented 3 months ago

Finally got around to testing it, looks good! Had one point where it said the "player is likely to die" message twice in a row, but that's minor and can be fixed later. Having it not do "weird" stuff can be fixed easily by just adding the depth of the result to result (just start it at 0 and increase it by 1 at the bottom of the recursive function), then prefer the one with less depth.