therewillbecode / poker-maison

🂺 A Multiplayer Poker App Crafted with Haskell and React
309 stars 34 forks source link

User Folds Automatically Too Quickly #15

Closed unstableunicorn closed 4 years ago

unstableunicorn commented 4 years ago

I just tried to spin this up for a few mates to play however after I place big and small blind it would just auto fold the user who took more than about 1 seconds.

I've tried looking through the code but not sure what is going on or why it is timing out so quickly.

Player state becomes undefined then just folds the user and moves on.

IvanKonevJr commented 4 years ago

Affirmative, it is not good idea for 1 second delay

unstableunicorn commented 4 years ago

Thanks for the quick reply! Where can I increase the timeout in the code?

IvanKonevJr commented 4 years ago

@unstableunicorn found solution in server, in method runPlayerTimer add zero to threadDelay (3 * 10000000) -- 30 seconds

therewillbecode commented 4 years ago

Ok I will update this in the master branch. Shall we go with 30 seconds for timeouts? I guess this option should be easy to configure.

I wonder if it is overkill to have a default of 30 seconds but allow it to be overridden to no delay or a custom delay.

unstableunicorn commented 4 years ago

Thanks, I'm just compiling now.

I think it should be configurable by an admin user, or at a minimum a environmental variable. Possible the person who sets up table can use it?

unstableunicorn commented 4 years ago

So there is still a small problem now. After everyone has checked or called, it then waits that time out. Probably want to proceed straight away if table is ready for next card.

therewillbecode commented 4 years ago

So there is still a small problem now. After everyone has checked or called, it then waits that time out. Probably want to proceed straight away if table is ready for next card.

Ah that is by design. I was under the impression that this gave better UX as most poker software has a delay between stages. What are your thoughts?

therewillbecode commented 4 years ago

Thanks, I'm just compiling now.

I think it should be configurable by an admin user, or at a minimum a environmental variable. Possible the person who sets up table can use it?

So it sounds like you have a vision for the app whereby users could configure and set up their own tables. Interesting, I hadn't considered that.

The limitation is that they wouldn't really be able to change many of the settings so I am not sure how useful a feature that would be. They would be able to configure a timeout, the table name and the blind levels.

Perhaps password protected games between friends could be a good use case for setting up your own table?

IvanKonevJr commented 4 years ago

Perhaps password protected games between friends could be a good use case for setting up your own table?

Yes, it is a great feature, but not need password - connect to game by url, may be generate url with lobby id and copy-past to friends whatsup? user registration save as cookie and auto login then, it is most perfect UX because it is a friendly game, not banking =)

unstableunicorn commented 4 years ago

Ah that is by design. I was under the impression that this gave better UX as most poker software has a delay between stages. What are your thoughts?

I think you need to have 2 different times:

  1. Between each players turn
  2. After everyone has called/folded

The first one needs to be configurable some way(without rebuilding the software). I set it to 60 seconds but I though even 120 to allow time for more chatting while playing. The second one after 3 seconds is fine as by then most people are just waiting for the next card.

unstableunicorn commented 4 years ago

Yes, it is a great feature, but not need password - connect to game by url, may be generate url with lobby id and send it to friends?

I think this idea would work well, except private games you can not find from the lobby.

IvanKonevJr commented 4 years ago

Yes, it is a great feature, but not need password - connect to game by url, may be generate url with lobby id and send it to friends?

I think this idea would work well, except private games you can not find from the lobby.

Yes, but all need customized poker )))

therewillbecode commented 4 years ago

Ah that is by design. I was under the impression that this gave better UX as most poker software has a delay between stages. What are your thoughts?

I think you need to have 2 different times:

  1. Between each players turn
  2. After everyone has called/folded

The first one needs to be configurable some way(without rebuilding the software). I set it to 60 seconds but I though even 120 to allow time for more chatting while playing. The second one after 3 seconds is fine as by then most people are just waiting for the next card.

Thanks for the feedback.

For 2. Is 2 minutes not a long time to wait for the next hand if everyone folds, especially in a 1v1 game?

unstableunicorn commented 4 years ago

Very long time, I would have that at like 2 or 3 seconds as you are not waiting on anyone.

therewillbecode commented 4 years ago

Ok I have pushed a commit to master which increases the player timeout to 30 seconds. I also increased the stage pauses slightly.

So the next thing to do would be to take these timing settings through runtime configuration.

unstableunicorn commented 4 years ago

I haven't tested, but the commit looks similar to changes I made locally except I changed it to set the time via an environment variable.

If so, there is still the issue after everyone has called or is ready for the next card, it uses the same timer so you have to wait 30 seconds?

therewillbecode commented 4 years ago

For player timeouts the duration is now 30 seconds. This means when a player must act they have 30 seconds to act or be folded automatically so the game can continue.

The other changes are for the pauses between different game stages to enhance the user experience.

The new default pauses between game stages are set to 2 seconds between streets and 5 second pause on Showdown.

I am open to increasing these pauses as defaults for public games.

I think for private games it would make sense to allow the game creator to set them.