Menu

#625 Dice deck

None
closed-accepted
nobody
None
5
2013-05-02
2012-11-07
No

Adds an option to use a deck of dice rolls instead of the normal dice.
Also adds an option to use dice with modified odds to make the rolls more even.

DOTO:
Add an option for the amount of dice decks to use.
Add option to reshuffle dice deck when a number of cards are left.
The modified dice rolls need a greater effect on the results.
Add option for flat dice distribution(results = rand(10)+2).

This is a protocol change.

Discussion

  • Micah Bunting

    Micah Bunting - 2012-11-13

    Added option to use multiple dice decks (each one 36 cards).
    Added option to remove an amount of cards from the dice deck.
    Changed the dice deck option to a check box.
    Removed an option from the previous patch that I decided I didn't like (was not implemented very well anyway).
    Perhaps flat odds could be added later, but it think it removes an element from the game.

     
  • Micah Bunting

    Micah Bunting - 2012-11-19

    Cleaned up mode_turn by creating a dice roll function.

     
  • Micah Bunting

    Micah Bunting - 2012-11-19
     
  • Roland Clobus

    Roland Clobus - 2013-04-16

    Hello Micah,

    I've reviewed this patch (dice_deck_vrs_3.patch).
    The code looks good.

    As always I have some questions regarding the code:

    • roll_dice could return void instead of boolean, because is always returns true.
    • When the deck is shuffled, perhaps it would be nice if a message is sent to the players
    • The procotol change is left as a TODO (common/game.c), but that can be done when the patch is committed
    • Could you use gint/guint instead if int/uint? (I know the are essentially the same, but the remaining code uses the glib datatypes)

    Attached you'll find an updated version that does not result in compiler warnings and that is matched the current svn version (I had made some gint->guint changes in the meantime).

    But for me the most important question is this:
    What does the patch do?

    This is my analysis:
    Statistically, it will not change any of the odds of specific number in the long run (after e.g. 1 million rolls, the distribution will be similar to the current dice rolls).
    Only in the short term, it will change something. When num_removed_cards is zero, it will even mean that the 36th roll can be guessed by the players in advance. Thus it will change the odds of each individual roll until the deck is shuffled again.

    This patch can add a feeling of 'fairness' to the game, because the dice distribution will match the triangle shape very closely.

    If you meant to reduce the aspect of chance in the game, I would suggest an extension to this code, to have each player be dealt 2 or 3 cards from the dice deck, and to let a player select from these cards the actual roll.

    With kind regards,
    Roland Clobus

    PS: Regarding the flat dice option: I would suggest rand(12)+1 with 1 meaning 7. That will match rolling a D12 die.

     
  • Micah Bunting

    Micah Bunting - 2013-04-16

    The goal of the cards is to implement the Catan event cards variant from the Traders and Barbarians expansion, omitting the events on each card. With this expansion, 5 cards are removed before each year. The end of the year is when the deck runs out and is reshuffled. Removing 5 cards prevents people from counting cards to know what will roll last.

    I agree that in the long run, the odds will be the same, but most games don't last long enough to require the deck to be shuffled 3 times. The last game I played, 12's rolled about 5 times where statistically it should have rolled only once or twice. In my opinion, If I win a game based solely on the dice favoring my numbers, I do not consider it victory.

    I do like the idea that 2 dice cards are dealt out at the beginning of the game allowing a choice of the 3 dice cards to use. This would add more strategy into the game by adding a choice to play a high producing number, or a seven to have someone discard half their hand. I will test this out using the board game. If I like it, then I will work on it in a separate patch.

    On this note, can we have two branches of the source code? This would allow protocol changes to be applied to the unstable branch, while the non protocol changes will be applied to the both the trunk and unstable branch. This way a patch can be created using a patch that is waiting for a protocol change. I know this does add more maintenance, because two branches will need to be maintained, but I think the benefits are worth it.

    Using a D12+1 for the flat dice option is a good idea. The robber will be rolled on both a 7 and 1. This will have the odds of the robber be 1/6, which is the same odds as the normal rules. This however removes high and low production hexes which I feel is an important part of the game, however some will like this option.

    I will work on the points you brought up, but lately things have been quite busy. Unless a protocol change is about to take place, it will be lower on my list of priority.

     
  • Micah Bunting

    Micah Bunting - 2013-04-30

    I've fixed the following hits:

    • roll_dice returns void.
    • When the deck is shuffled, it gives a message is to the players.
    • gint/guint is used instead of int/uint to match existing code.
    • Fixed a bug that prevented the deck to shuffle if num_removed_dice = 0

    Left for commit:

    • Change the protocol version in /server/turn.c and common/game.c
     
  • Roland Clobus

    Roland Clobus - 2013-04-30

    Ok, excellent patch.

    Here is my review with just minor points. If the changes you made are trivial, go ahead and commit :-)

    • server/server.c: some new lines that 2x a semicolon at the end
    • server/turn.c: why do you use a for-loop combined with a break instead of a while (card >= 0) ?
    • common/game.h: Could you use 'use_dice_deck' instead of 'dice_deck'? (Similar to use_pirate)
    • common/gtk/game-rules.c: Add the new rules in an 'if (show_all_rules)', otherwise the rules will be shown in the 'Create a Public Game' dialog in the client.
    • common/gtk/game-rules.c: Perhaps you could use a default of 2 decks and 5 cards to remove instead of 1 and 0? (in params_new) (Note that this will trigger messages in the client at the moment. After the patch is applied, I'll take a look to run V15 at the metaserver without bothering the V14 clients)
    • common/gtk/game-rules.c: I would suggest the following textual changes (A tooltip contains a full sentence without a full stop):
      "Dice deck" -> "Use dice deck"
      "Use dice deck instead of dice" -> "Use a deck of 36 dice cards instead of real dice"
      "Dice decks" -> "Number of dice decks"
      "Number of dice decks" -> "The number of dice decks (of 36 cards each)"
      "Removed dice cards" -> "Number of removed dice cards" (This might be a bit long, but I think it is better to have a longer and more clear label.
      "Number of dice cards removed after shuffling" -> "The number of dice cards that are removed after shuffling the deck"

    See README.server_protocol_version for the steps required to increment the protocol.

     
  • Micah Bunting

    Micah Bunting - 2013-05-01

    Fixed patched and committed in svn rev 1910.

     
  • Micah Bunting

    Micah Bunting - 2013-05-01

    I would change the status of this ticket, but I don't seem to have the permissions for it.

     
  • Roland Clobus

    Roland Clobus - 2013-05-02

    I've modified the user rights. Please try again.

     
  • Micah Bunting

    Micah Bunting - 2013-05-02
    • status: open --> closed-accepted
    • Group: -->
     

Log in to post a comment.