ctm / mb2-doc

Mb2, poker software
https://devctm.com
7 stars 2 forks source link

Allow Players to see structure #439

Closed ctm closed 4 months ago

ctm commented 4 years ago

Add some sort of UI to display information about the structure.

This is one I've know about for a long time but never created an issue for. However, since it was explicitly requested, it now has an issue.

framistat: Cliff: It would be useful to be able to see the game setup after the tournament has started, both for spectators, and for players (how long is the break, when is the break, what is the next game, ...?).

I don't see doing this before I do Ring Games (#88), because tournaments are currently playable (although far from optimal), but ring games aren't playable at all and I'd like to have them both for business reasons and for FARGO.

ctm commented 6 months ago

I just bumped this to high priority and added the chore tag, because if I am willing to do a crappy job on the UI, it is more of a chore than a feature, but at least it will allow people to know what they're choosing to set up or joining.

The one thing that kind of complicates this is that logically I'd like the url to include the id number of the structure coming from the database, but currently structures don't come out of the database; they're fetched from a HashMap using their "short_name". For expediency, we can use a route that uses the short-name for now and worry about backpatching the id in later.

ctm commented 6 months ago

I created a structure-439 branch and added a StructureId enum that can either take a string or a number and added a route for /structure/tournament/:structure_id.

However, the structures are known by the server, not the client, so one way or the other we need to make a request from the client to the server for the info.

Up until now, all requests have been made through a Web Socket, but I think this (and other requests, like hand histories) should be done through an API, which requires some new boilerplate (e.g., a new /api route for actix-web and the use of fetch and futures within the client). None of that is hard, per-se, but it does mean I need to make some choices that I hadn't anticipated making and it means I'm not even going to have a poor proof-of-concept ready for this evening's game.

ctm commented 6 months ago

I made a bunch of choices and now have both an API end-point and a UI end-point for tournament structures, with the UI calling the API. I don't yet have HTML in the UI, nor do I have a way for a new window with the structure to be created, but the former is just grunt work and the latter is trivial if I don't send the lobby session id.

Since all structures are currently public, there's no need to pass the lobby session id. However, if we want to do so, I think it's just a matter of having the structure window check to see if it has a parent. If so, wait for the message that will have the session id and if not, consider itself anonymous.

ctm commented 6 months ago

I've done the grunt work for many of the structure fields, but dealing with level names is a PITA, so right now the end of the rebuy, re-entry and lammer levels aren't generated. An even bigger PITA are rounds, and I didn't get to those, either. The page is also unstyled, which makes it even more garish than normal (yipes!).

However, event creation, upcoming events and running events all have circle-i small icons that can be clicked to get a link to the structure sheet. This is all in structure-439. I'm not deploying today, but I'll probably deploy tomorrow.

ctm commented 6 months ago

Here's what I'd like to get done before deploying today:

ctm commented 5 months ago

I'm going to move my disclaimer verbiage from the structure template to the Players' Manual and then link to it, the I'll deploy. The styling is essentially non-existent and it's not smart enough to recognize repeating games, like we get in TOC and MONTE and it still doesn't dump the levels at all, but it does allow us to peer inside a structure template now and even allowed me to find a bug in my CART -> HORSE structure.

ctm commented 5 months ago

I'm deploying now, with a version that completely omits level info. There's enough time that I could probably get some of the easier level dumps in place before another deploy, but I'm going to take a break of an undetermined length, first.

ctm commented 5 months ago

We played with the new code yesterday, and I'm glad I pushed it out in time for us to do it, because the name of the game that is announced to the players is currently much longer: "No-Limit Double Board Bomb Pot Texas Hold’em (High only)" vs. "No-Limit Texas Hold’em (High only)", but when two boards are dealt it's kind of obvious that we're playing double board.

So, that brings up two issues:

Looking through the GameKeeper code, it looks like there's also:

And that also brings up the fact that a game doesn't actually have an ante, unless both Options allows the use of an ante and there is an Ante in the Stakes.

So, I think having a single all-details-included long description of the game that is to be played is undesirable. Instead we'll need to check for consistency throughout the structure and just say something like "In this event, the Sevens Rule in California Lowball is (or is not) enforced", assuming it is indeed the same throughout. However, when people are allowed to build their own structures, we'll then either need to make the builder enforce consistency or be able to somehow identify mixes of obscure things like the Sevens Rule (e.g., on Levels 1, 8 and 10, the Sevens Rule is enforced; everywhere else, it's not"). And of course the status of the Sevens Rule should never be mentioned if there are no games to which it could apply (and the only game to which it can apply is California Lowball).

Oy!

ctm commented 5 months ago

I've added level info for the common simple levels. I am probably going to take a break from working on this issue for a while. It was meant to be a one-day hack-and-slash feature so the winner would have more insight as to what is available. That functionality is now mostly present (albeit ugly), but it took way more than a day. OTOH, there are some things I went out of my way to do "right" and although I've cut some corners, I'm pretty happy with my growth as a Rust programmer.

ctm commented 5 months ago

As of my deploy yesterday, there are only 22 structures (out of 285) that mb2 can't produce levels for, and I've updated my checkboxes above to list them all. The only non-WSOP-Style ones are:

and both eight game mixes are the same other than the starting chips. I think if I add enough smarts for mb2 to do the levels for any of the WSOP-Style Dealer's Choice structures, we get all the other ones, for free and I already wrote down notes as to how I think I can do that. Unfortunately, I'm not programming for a little while as I concentrate on the business side of things.

ctm commented 5 months ago

We're down from 22 that we can't produce levels for to only four, and there those four are, for all practical purposes, just two different structures, each having two exceedingly similar instances.

Specifically, barge_eight_game_mix and eight_game_mix_20k are essentially the same, and both have two different fixed-limit stakes. The "normal" ones and the lowball ones.

wsop_2023_73_mixed_big_bet and wsop_2024_77_mixed_big_bet are essentially the same, and they both have two different no-limit stakes. The "normal" ones and the ones for No-limit Five Card Draw and No-Limit Deuce-to-Seven.

My guess is I'll just leave those "four" unhandled for a while, although currently the mixed big bet templates get incorrect levels (#1407) and so I need to stop that from happening, because no-information is better than incorrect-information.

ctm commented 5 months ago

Although there's still more to do, it can be done later, so I'm stripping the high priority label.

ctm commented 4 months ago

I added support for the two eight_game_mix and two mixed_big_bet structures. The output is super ugly, but it's better than nothing. In fact, it allowed me to see subtle problems with those structures, which I cleaned up.

Deploying now.

ctm commented 4 months ago

After sleeping on it, I believe I've done enough to close this issue, since all the information about a tournament is now available before and during the tournament. I have, however, created a couple new issues in this area (#1439 and #1440). Hail Hydra!