Hello Guest

Stake Chance Bug

  • 8 Replies
  • 5297 Views
*

cynik

  • **
  • 9
  • +0/-0
    • View Profile
Stake Chance Bug
« on: February 16, 2019, 02:25:39 pm »
I'm using a script that always makes bets on 0.01% chance.
For some reason on Stake, and maybe any other site that has a result size that's not a exponent of 10, there is a bug that changes the chance from 0.01% to 0% after the first win.
There is no instance of setting the chance value apart of the initial one in the script.
I looked at the DiceBot's code and I'm not exactly sure if the problem lies in DiceSite.cs or PD.cs.
But I think it might have something to do with there still being instances of hard coded values in PD.cs, instead of referring to the value in the maxRoll variable.
And these hard coded values didn't change after Stake.cs inherits from PD.cs

*

Seuntjie

  • *****
  • 366
  • +12/-2
    • View Profile
Re: Stake Chance Bug
« Reply #1 on: February 16, 2019, 02:28:30 pm »
Are you using 3.3.24 or newer?

*

cynik

  • **
  • 9
  • +0/-0
    • View Profile
Re: Stake Chance Bug
« Reply #2 on: February 16, 2019, 02:41:17 pm »
I'm using 3.3.24.1

*

Seuntjie

  • *****
  • 366
  • +12/-2
    • View Profile
Re: Stake Chance Bug
« Reply #3 on: February 16, 2019, 04:30:52 pm »
Can you post a screenshot of the bug please? I tested with 3.3.24.1 and it worked correctly for me.

*

cynik

  • **
  • 9
  • +0/-0
    • View Profile
Re: Stake Chance Bug
« Reply #4 on: February 16, 2019, 06:29:39 pm »
I've attached a screenshot from a recent test of the bug.

And a update.
The bug could actually be that the chance changes from 0.01% to 0.00% when betting high.
I think it might have something to do with line 683 in PD.cs, which is
Chance = state.condition.ToLower() == "above" ? 99.99m - (decimal)state.target : (decimal)state.target
This part of the code doesn't change after Stake.cs inherits it from PD.cs
And 0.01% on high means the target is above 99.99, which I guess means state.target is equal to 99.99.
If that is the case, then that mean that chance ends up being 0.

*

Seuntjie

  • *****
  • 366
  • +12/-2
    • View Profile
Re: Stake Chance Bug
« Reply #5 on: February 16, 2019, 07:11:20 pm »
You're right, that is probably the reason. I'll take a look at fixing it, but unfortunately I don't have the time to try to reproduce the color bug that you mentioned. It might be related to this change but I'm not 100% sure it is. If I make a beta version available in the next few days, would you mind testing it and seeing if you can reproduce any of the issues?

Also, I'm still of the mind that stakes max roll being 100 instead of 99.99 is wrong and unfair to the player. It (secretly) raises the edge ever so slightly above the advertised 1%, which doesn't seem like a big deal but over thousands and thousands of bets, it becomes significant.

*

cynik

  • **
  • 9
  • +0/-0
    • View Profile
Re: Stake Chance Bug
« Reply #6 on: February 16, 2019, 08:49:47 pm »
I don't mind testing the beta. Of course, it'll only be on 0.01% chance.
I'll also try to figure out if I can found out where the problem lies.
At the mean time, could also you double check what the actual target values are when making bets?
If the target is the "last" losing result or the "first" winning result.
That way at the very least an external factor is eliminated.

And in regards to the house edge, what you're saying is true. But if I'm not mistaken technically it's still 1.0% house edge, when you round it to the down to 1 decimal, which means it isn't false advertisement.
Maybe if you brought up with Dan he might consider changing it, seeing as you're a trusted user on Stake.

*

cynik

  • **
  • 9
  • +0/-0
    • View Profile
Re: Stake Chance Bug
« Reply #7 on: February 17, 2019, 02:37:00 am »
Seuntjie, can you check if I understood the following correctly?
As I mentioned before, in the PD.cs there's the following in line 675 of PD.cs.

Chance = state.condition.ToLower() == "above" ? 99.99m - (decimal)state.target : (decimal)state.target

Assuming that target is the "last" losing result, that means that on Stake betting on 0.01% chance on high the target should be 99.99.
Which means that chance equals to 0.
The above mentioned line is inside the method ToBet() found in line 670 of PD.cs.
This method is then used in line 299 of PD.cs as follow.

Bet tmpbet = tmp.ToBet()

The object tmpbet is then used in line 301 of PD.cs as follow.

FinishedBet(tmpbet)

Within the FinishedBet() method there's the following in line 141 and line 142 of DiceSite.cs.

Parent.AddBet(newBet)
Parent.GetBetResult(balance, newBet)

I assume cDiceBot.cs is the Parent as it's the only other class with an AddBet() and a GetBetResult() method.
Within the both AddBet() and GetBetResult() method, and also some other methods, there's the following similar line which is used for determining if the bet is a win or a lose.

(((bool)bet.high ? (decimal)bet.Roll > (decimal)CurrentSite.maxRoll - (decimal)(bet.Chance) : (decimal)bet.Roll < (decimal)(bet.Chance)))

If we assumed as previously mentioned, then the chance in the above line equal to 0.
So if the maxRoll on Stake is 100 and I rolled a 100 for high, the lines could be seen as.

true ? 100 > 100 - 0 : 100 < 0

Which is false, meaning according to the code the bet is a lose when in reality the bet is a win.

*

Seuntjie

  • *****
  • 366
  • +12/-2
    • View Profile
Re: Stake Chance Bug
« Reply #8 on: February 17, 2019, 09:07:27 am »
Like I said, that is probably correct.