4 ms·
Way cool, saved for later so I can build my own! The one reaction I have to share is neither here nor there, but there's a sentence suggesting this is great fo
by dahart 11y ago
Way cool, saved for later so I can build my own!
The one reaction I have to share is neither here nor there, but there's a sentence suggesting this is great for games. The two problems you'll have applying something like this to games are 1- the bandwidth of this RNG is much slower than your laptop CPU. It'd pair very well with a game running on the Arduino you build the RNG with though. :) 2- I've done a lot of game programming, and came to the conclusion that I almost never wanted a random number stream. They cause repeats way too frequently. Every time I want "random" behavior in a game nowadays, I generally either pre-generate a set of behaviors randomly and then shuffle them (guaranteeing you see each behavior once before any repeats) or use an even uniform sampling in a cycle. It was a little surprising at first, but I definitely have a better appreciation now for why game mechanics with some repetition (or maybe "predictability" is a better word) are more fun than true technically 'random'.
- javajosh 11y agoI tend to believe "them" when "they" say that a modern CSPRNG can generate essentially infinite, random-looking noise from like a 256-bit seed-o-randomness. This device would be a great seed, on boot for example. It's also highly reliable because it simply cannot be hacked (although a truly paranoid person would also want to connect an analog oscilloscope and compare the output to what you see on your computer.)
- dahart 11y agoYes, true! Using this project for seeding a software generator is a great use, and that eliminates the point I made above about bandwidth. (As would pre-computing high-quality random number tables.)
- aaronharnly 11y agoI was confused by the "great for games" comment as well, but following the link shows that the author was thinking of simple hardware "games" such as this fortune teller consisting of LEDs and fairly simple circuitry. So I think the clock speed is more than fine for the application he had in mind... http://makezine.com/projects/electronics-fun-and-fundamentals-the-ching-thing/ http://makezine.com/projects/electronics-fun-and-fundamental...
- dahart 11y agoAh, in that case, my comment's nearly rude! Sorry, I had software video games in my head. :P I'm still gonna build it.
- hinkley 11y agoThere's a whole set of issues in UX where events are perceived in ways that are not entirely mathematically accurate, but cause the user to feel strongly about an application. One of my favorite is that a series of pauses that happen too close together are experienced as one giant pause for the whole duration. So you know how you hate it when your music player is on 'shuffle' and it plays the same song twice in a row? OP is saying people experience that it games too, and I think that's perfectly plausible. If I have a 10% chance of missing, there's a 1% chance of missing twice in a row. If I have a 25% chance of missing, there's a 1.5% chance of me missing 3 times in a row, and if I sit there for an hour with my finger on the trigger this is going to happen rather a lot. What I'm going to remember is that 'all the time' I just miss the same dude and he nearly kills me and I don't like this game.
- logn 11y agoMaybe also try taking your random number [0, 1] to a certain power. E.g., square the number. Or randomly choose a max and then iteratively choose a random value between [0, max] and optionally keep repeating. There's probably an elegant way to do that in hardware (but I'd have no idea).
- mistercow 11y agoWhat bothers me about the game thing is that the author seems to be implying that they can tell that a game is using a PRNG. At worst, a game is going to be using something like Mersenne Twister. While distinguishable from random noise through careful analysis, it's extremely unlikely that there are readily perceptible patterns in the output. And if you really do need unpredictable numbers for your game (e.g. online gambling, where good randomness is a security requirement), it's far more practical to use a CSPRNG, especially since one is built into your OS. The practical difference is negligible. If an attacker can predict /dev/urandom, we've all got much bigger problems.
- hinkley 11y agoI'm with you on 'shuffle is what people expect when they say random' but how do you keep the player from picking up on the patterns? One of my favorite bits of statistical math is the 2d6 phenomenon. That you can get a normal distribution simply by summing two random numbers together. If you want 1-10 but most of the numbers in the middle, do (random(1-10) + random(1-10))/2