Potsize if everyone calls

Coding-related discussion: OpenPPL (Poker Programming Language) and internal OpenHoldem-script
Post Reply
ncm77
Top Kicker
Top Kicker
Posts: 53
Joined: Wed Nov 01, 2017 2:04 am

Potsize if everyone calls

Post by ncm77 »

Suppose there are multiple raises and calls when it's your turn to act. Is there a formula to calculate what the potsize will be at the end of the round if everyone remaining in the hand calls?
Alex
Site Admin
Site Admin
Posts: 2953
Joined: Sun Mar 26, 2017 5:58 pm

Re: Potsize if everyone calls

Post by Alex »

ncm77 wrote: Wed Feb 17, 2021 3:03 am Suppose there are multiple raises and calls when it's your turn to act. Is there a formula to calculate what the potsize will be at the end of the round if everyone remaining in the hand calls?
no such ready-to-use function.
Calculating first orbit is easy, with StillToAct and AmountToCall.
But if you want to consider potential callers in the second orbit, would be more complicated i guess
User avatar
froggy
Botter for life
Botter for life
Posts: 1124
Joined: Thu Jan 31, 2019 12:56 am

Re: Potsize if everyone calls

Post by froggy »

Step 1. strip down all the calls and raises to get the initial potsize before any calls or raises
Step 2. get the largest bet on the table
Step 3. get the number of players still to act + 1 (the last raiser) and multiply the largest bet on the table. Add that to the initial potsize for total potsize if everyone were to call.

Step 1.

##f$InitialPotSize##
[ PotSize - ((userchair != 0 ? currentbet0 : 0)/bblind) - ((userchair != 1 ? currentbet1 : 0)/bblind) - ((userchair != 2 ? currentbet2 : 0)/bblind) - ((userchair != 3 ? currentbet3 : 0)/bblind) - ((userchair != 4 ? currentbet4 : 0)/bblind) - ((userchair != 5 ? currentbet5 : 0)/bblind) - ((userchair != 6 ? currentbet6 : 0)/bblind) - ((userchair != 7 ? currentbet7 : 0)/bblind) - ((userchair != 8 ? currentbet8 : 0)/bblind) - ((userchair != 9 ? currentbet9 : 0)/bblind) ]

Step 2.

##f$BetsizeOfLastRaiser##
lastraiserchair = 0 ? currentbet0 :
lastraiserchair = 1 ? currentbet1 :
lastraiserchair = 2 ? currentbet2 :
lastraiserchair = 3 ? currentbet3 :
lastraiserchair = 4 ? currentbet4 :
lastraiserchair = 5 ? currentbet5 :
lastraiserchair = 6 ? currentbet6 :
lastraiserchair = 7 ? currentbet7 :
lastraiserchair = 8 ? currentbet8 :
lastraiserchair = 9 ? currentbet9 : 0

Steo 3.

##f$PotSizeIfEveryoneCalls##
f$InitialPotSize + ((CallsSinceLastRaise + StillToAct + 1) * f$BetsizeOfLastRaiser)


This doesn't account for your intentions to raise and it doesn't take into account the stacksizes of your opponents.
“Life is not always a matter of holding good cards, but sometimes, playing a poor hand well.” ― Jack London
ncm77
Top Kicker
Top Kicker
Posts: 53
Joined: Wed Nov 01, 2017 2:04 am

Re: Potsize if everyone calls

Post by ncm77 »

froggy wrote: Wed Feb 17, 2021 3:14 pm Step 1. strip down all the calls and raises to get the initial potsize before any calls or raises
Step 2. get the largest bet on the table
Step 3. get the number of players still to act + 1 (the last raiser) and multiply the largest bet on the table. Add that to the initial potsize for total potsize if everyone were to call.

Step 1.

##f$InitialPotSize##
[ PotSize - ((userchair != 0 ? currentbet0 : 0)/bblind) - ((userchair != 1 ? currentbet1 : 0)/bblind) - ((userchair != 2 ? currentbet2 : 0)/bblind) - ((userchair != 3 ? currentbet3 : 0)/bblind) - ((userchair != 4 ? currentbet4 : 0)/bblind) - ((userchair != 5 ? currentbet5 : 0)/bblind) - ((userchair != 6 ? currentbet6 : 0)/bblind) - ((userchair != 7 ? currentbet7 : 0)/bblind) - ((userchair != 8 ? currentbet8 : 0)/bblind) - ((userchair != 9 ? currentbet9 : 0)/bblind) ]

Step 2.

##f$BetsizeOfLastRaiser##
lastraiserchair = 0 ? currentbet0 :
lastraiserchair = 1 ? currentbet1 :
lastraiserchair = 2 ? currentbet2 :
lastraiserchair = 3 ? currentbet3 :
lastraiserchair = 4 ? currentbet4 :
lastraiserchair = 5 ? currentbet5 :
lastraiserchair = 6 ? currentbet6 :
lastraiserchair = 7 ? currentbet7 :
lastraiserchair = 8 ? currentbet8 :
lastraiserchair = 9 ? currentbet9 : 0

Steo 3.

##f$PotSizeIfEveryoneCalls##
f$InitialPotSize + ((CallsSinceLastRaise + StillToAct + 1) * f$BetsizeOfLastRaiser)


This doesn't account for your intentions to raise and it doesn't take into account the stacksizes of your opponents.
This didn't give the correct amount in the following situation, the correct answer would be (20*4)+1+.5=81.5 not 203.

********* Players **************************************************************
2021-02-17 18:54:05 - Chair 5 Player5 SAP- 30.00 970.00
2021-02-17 18:54:05 - Chair 6 Player6 SAP- 30.00 970.00
2021-02-17 18:54:05 - Chair 7 ---- 0.00 0.00
2021-02-17 18:54:05 - Chair 8 ---- 0.00 0.00
2021-02-17 18:54:05 - Chair 9 ---- 0.00 0.00
2021-02-17 18:54:05 - Chair 0 Player0 SAPD 75.00 925.00
2021-02-17 18:54:05 - Chair 1 Player1 SA-- 5.00 995.00
2021-02-17 18:54:05 - Chair 2 Player2 SAP- 200.00 800.00
2021-02-17 18:54:05 - Chair 3 Player3 SA-- 0.00 1000.00
2021-02-17 18:54:05 - Chair 4 Player4 SA-- 10.00 990.00
********* Basic Info ***********************************************************
2021-02-17 18:54:05 - Version: 14.0.0.0
2021-02-17 18:54:05 - Handnumber: 1
2021-02-17 18:54:05 - Chairs: 10
2021-02-17 18:54:05 - Userchair: 5
2021-02-17 18:54:05 - Holecards: AdKs
2021-02-17 18:54:05 - Community: ..........
2021-02-17 18:54:05 - Handrank: 10
2021-02-17 18:54:05 - Hand: hcard
2021-02-17 18:54:05 - My balance: 970.00
2021-02-17 18:54:05 - My currentbet: 30.00
2021-02-17 18:54:05 - To call: 170.00
2021-02-17 18:54:05 - Pot: 350.00
2021-02-17 18:54:05 - Big blind: 10.00
2021-02-17 18:54:05 - Big bet (FL): 20.00
2021-02-17 18:54:05 - f$betsize: 0.00
2021-02-17 18:54:05 - Formulas: FCK..
2021-02-17 18:54:05 - Buttons: FC.RA
2021-02-17 18:54:05 - Best action: f$call
2021-02-17 18:54:05 - Action taken: f$call
********* Autoplayer Trace *****************************************************
f$preflop = -1000010.000 [Line 1/306]
f$MTT_SNGpreflop = -1000010.000 [Line 1/638]
f$PotSizeIfEveryoneCalls = 203.000 [Line 1/752]
f$InitialPotSize = 3.000 [Line 1/597]
PotSize = 35.000 [Line 2/119]
bblind = 10.000
pot = 350.000
SidePot = 0.000 [Line 2/135]
SidePotInDollars = 0.000 [Line 2/131]
EffectivePotSizeInDollars = 350.000 [Line 11/415]
potcommon = 0.000
EffectiveBetsizeInDollars0 = 75.000 [Line 1/365]
currentbet0 = 75.000
MyTotalMoney = 1000.000 [Line 1/127]
balance = 970.000
currentbet = 30.000
EffectiveBetsizeInDollars1 = 5.000 [Line 1/369]
currentbet1 = 5.000
MyTotalMoney = 1000.000 [cached]
EffectiveBetsizeInDollars2 = 200.000 [Line 1/373]
currentbet2 = 200.000
EffectiveBetsizeInDollars3 = 0.000 [Line 1/377]
currentbet3 = 0.000
EffectiveBetsizeInDollars4 = 10.000 [Line 1/381]
currentbet4 = 10.000
EffectiveBetsizeInDollars5 = 30.000 [Line 1/385]
currentbet5 = 30.000
EffectiveBetsizeInDollars6 = 30.000 [Line 1/389]
currentbet6 = 30.000
EffectiveBetsizeInDollars7 = 0.000 [Line 1/393]
currentbet7 = 0.000
EffectiveBetsizeInDollars8 = 0.000 [Line 1/397]
currentbet8 = 0.000
EffectiveBetsizeInDollars9 = 0.000 [Line 1/401]
currentbet9 = 0.000
userchair = 5.000
userchair = 5.000
userchair = 5.000
userchair = 5.000
userchair = 5.000
userchair = 5.000
userchair = 5.000
userchair = 5.000
userchair = 5.000
userchair = 5.000
CallsSinceLastRaise = 0.000 [Line 2/218]
PlayersRaisingOrColdCallingTheLastRaise = 1.000 [Line 12/76]
currentbet_lastraiserchair = 200.000
Others = 1.000 [Line 1/75]
AlwaysTrue = 1.000 [Line 1/78]
true = 1.000
PlayersRaisingOrColdCallingTheLastRaise = 1.000 [cached]
StillToAct = 0.000 [Line 1/140]
BotsActionsOnThisRoundIncludingChecks = 1.000 [Line 5/178]
IsPreflop = 1.000 [cached]
BotsActionsOnThisRoundIncludingChecksAdapted = 1.000 [Line 7/196]
sitename$openholdem = 1.000
HINT_Counting_Only_Autoplayer_Actions_Not_Manual_User_Actions = 0.000 [Line 1/377]
false = 0.000
didchec = 0.000
didcall = 0.000
didbetsize = 1.000
didrais = 0.000
ActionCounterCorrectionForUpdateInProgress = 0.000 [Line 7/163]
me_re_MemUpdateOfOpenPPLMemorySymbolsInProgress = 0.000
Others = 1.000 [cached]
BotsActionsOnThisRoundIncludingChecksAdapted = 1.000 [cached]
HINT_StillToAct_Is_Only_Valid_On_First_Orbit = 0.000 [Line 1/346]
f$BetsizeOfLastRaiser = 200.000 [Line 3/370]
lastraiserchair = 2.000
Call = -1000010.000 [Line 1/113]
f$beep = 0.000 [Line 2/2]
empty_expression__false__zero__when_others_fold_force = 0.000
f$allin = 0.000 [Line 2/2]
f$betpot_1_1 = 0.000 [Line 3/12]
f$betpot_3_4 = 0.000 [Line 3/16]
f$betpot_2_3 = 0.000 [Line 3/20]
f$betpot_1_2 = 0.000 [Line 3/24]
f$betpot_1_3 = 0.000 [Line 3/28]
f$betpot_1_4 = 0.000 [Line 3/32]
f$betsize = 0.000 [Line 6/39]
f$raise = 0.000 [Line 2/2]
f$call = 1.000 [cached]
f$check = 1.000 [cached]
f$allin = 0.000 [cached]
f$betsize = 0.000 [cached]
UpdateMemorySymbolsAfterAutoplayerAction = 0.000 [Line 69/225]
Raises = 2.000 [Line 3/189]
OpenPPLHistorySymbolsAlreadyUpdatedThisHeartbeatAfterAutoplayerAction = 0.000 [Line 13/244]
me_re_heartbeatID = 0.049
randomheartbeat = 0.585
GameStateChangedSinceLastAutoplayerAction = 1.000 [Line 5/249]
dealerchair = 0.000
me_re_MemOldGameStateDealerChair = 0.000
me_re_MemOldGameStateCurrentBet = 0.000
me_re_MemRaises = 0.000
RaisesSinceLastPlay = 2.000 [Line 2/259]
BotsActionsOnThisRoundIncludingChecks = 1.000 [cached]
RaisesSinceLastPlayOnOurSecondAction = 2.000 [Line 7/172]
nopponentstruelyraising = 2.000
Checks = 0.000 [Line 3/148]
Calls = 2.000 [Line 4/143]
OpenPPLHistorySymbolsAlreadyUpdatedThisHeartbeatAfterAutoplayerAction = 0.000 [cached]
GameStateChangedSinceLastAutoplayerAction = 1.000 [cached]
me_re_MemCalls = 1.000
CallsSinceLastPlay = 1.000 [Line 2/214]
nopponentscalling = 1.000
Bets = 0.000 [Line 2/84]
CalculateBotsLastPreflopActionForUpdateAfterAutoplayerAction = -1000010.000 [Line 34/105]
PrevActionWasAllin = 0.000 [Line 2/62]
prevaction = 1.000
Call = -1000010.000 [cached]
IsFlop = 0.000 [Line 1/75]
betround = 1.000
flop = 2.000
IsTurn = 0.000 [Line 1/78]
turn = 3.000
Raises = 2.000 [cached]
IsFlop = 0.000 [cached]
IsTurn = 0.000 [cached]
me_re_MemStartingStackSize = 100.000
me_re_MemStartingChips = 1000.000
me_re_MemStartingStackSize = 100.000
me_re_MemMaxOpponentStackSize = 100.000
me_re_MemMinOpponentStackSize = 100.000
CreateHeartbeatIDAfterAutoplayerAction = 0.000 [Line 4/229]
randomheartbeat = 0.585
me_st_heartbeatID_randomheartbeat = 0.000
RememberCurrentGameStateAfterAutoplayeraction = 0.000 [Line 10/267]
me_st_MemOldGameStateCurrentBet_currentbet = 0.000
me_st_MemOldGameStatePotSize_pot = 0.000
me_st_MemOldGameStateBetround_betround = 0.000
me_st_MemOldGameStateDealerChair_0 = 0.000
me_st_MemOldGameStateDealerChair__dealerchair = 0.000
f$raise = 0.000 [cached]
f$fold = 1.000 [cached]
ncm77
Top Kicker
Top Kicker
Posts: 53
Joined: Wed Nov 01, 2017 2:04 am

Re: Potsize if everyone calls

Post by ncm77 »

I think the following types of code may work to solve this issue:
##f$ActivPlayer_0##
[0|(((opponentsplayingbits & (1 << 0)) && (balance0 > 0 || currentbet0 > 0) && !(userchair==0)) ? 1 << 0 : 0)]

I saw this code on another thread. It will return a non-zero number for an active opponent who hasn't folded. How would that code look using "WHEN","RETURN","FORCE", etc instead of the && type symbols?
Post Reply