Editing Multiplayer RNG

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
[[Category:Research]]
[[Category:Projects]]
For a while now my friend Koz has been throwing around the idea of a peer-to-peer multiplayer card game. These games rely heavily on random numbers for things like drawing from card decks. Here's my idea for a protocol to accomplish that.
For a while now my friend Koz has been throwing around the idea of a peer-to-peer multiplayer card game. These games rely heavily on random numbers for things like drawing from card decks. Here's my idea for a protocol to accomplish that.


Line 47: Line 47:


This is a large number intended for seeding some per-turn number generator, such as picking multiple cards from a deck or calculating damage.
This is a large number intended for seeding some per-turn number generator, such as picking multiple cards from a deck or calculating damage.
== Best-effort generation ==
Bailing out if a player doesn't send a valid input ensures there's two outcomes: No seed, or a seed that each player agrees is fair. Having a fair seed is great, but having no seed is perhaps even worse than an unfair seed.
An interesting property of the protocol is that all player's inputs are generated independently of each other and shown to be independent. Instead of bailing out of generation it's possible to just continue but discard a player's input or lack thereof. This is identical to the player not participating in the generation in the first place.
The main challenge from this approach is convincing a player that they were fairly and necessarily left out of the generation process. A player who disconnects will probably agree it's fair to be cut out of the process. A player who temporarily loses connectively might grumble about fairness if they don't get a say in a roll. A player who keeps getting lag spikes when it's time generate a number and never getting a chance to participate may not.


== Prior work ==
== Prior work ==
Line 60: Line 53:
Instead of generating a large random number that's easy to pass from some source of entropy (like random bytes), it generates a smaller number. This requires using a random number generator to get a small number, salting the number to avoid guessing the hash (by generating a larger random number like we do), and then use addition as the mixing agent.
Instead of generating a large random number that's easy to pass from some source of entropy (like random bytes), it generates a smaller number. This requires using a random number generator to get a small number, salting the number to avoid guessing the hash (by generating a larger random number like we do), and then use addition as the mixing agent.


That seems trickier to implement.
This seems trickier to implement.
Please note that all contributions to JookWiki are considered to be released under the Creative Commons Zero (Public Domain) (see JookWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)