this post was submitted on 19 Jan 2024
43 points (97.8% liked)

Game Development

3444 readers
1 users here now

Welcome to the game development community! This is a place to talk about and post anything related to the field of game development.

Community Wiki

founded 1 year ago
MODERATORS
top 10 comments
sorted by: hot top controversial new old
[–] [email protected] 19 points 10 months ago (2 children)

7 is the most random number, because when you ask someone to choose a random number between 1 and 10, most people choose 7.

Whenever you need a random number in your code, don’t use rand() or a similar function. Use 7. It’s faster, and it’s the choice of the people.

[–] [email protected] 12 points 10 months ago* (last edited 10 months ago) (1 children)

This seems like you're introducing selection bias. Do you really want laypersons to influence your code? You should poll a representative sample of coders for a random number, and use the mode of that.

Here, I'll start you off: 7

[–] [email protected] 3 points 10 months ago

I’m good with that. My current number of upvotes is the most random number, which I also find acceptable.

[–] [email protected] 4 points 10 months ago

// guaranteed to be random

[–] [email protected] 2 points 10 months ago (1 children)

That's a very long list of different techniques with examples, very cool!

Though I wonder, is there some connection to image processing, high dynamic range?

Or audio compression, the kind which brings out the kick in the mix, not the kind which saves disk space?

The similarity I see between all three fields is, they try to bring down extreme values, outliers, to level the field, while still retaining characteristics.

[–] [email protected] 2 points 10 months ago (1 children)

I'm guessing you're referring to the colors of noise?

[–] [email protected] 2 points 10 months ago

I didn't know about that [under this name], so thanks for bringing it up. But no, I meant something slightly different.

Colors of noise describes how to generate different distributions. What I meant was how to transform distributions.

Many of the examples in the article start with a random number distribution, and then transform it to reduce discrepancy.

This reminded me of audio/video signal processing. For example, one can take a picture and transform it to reduce discrepancy (so that neither very bright parts nor very dark parts overshoot). Or you can take an audio sample and transform it to reduce discrepancy in loudness.

So the idea was that maybe techniques of either field (RNG, audio, video) could be applied to both other fields.

[–] [email protected] 2 points 10 months ago (1 children)

This is cool! Is it your blog?

[–] [email protected] 6 points 10 months ago* (last edited 10 months ago)

Nah not mine, just one I found and thought was pretty cool. Added the source to my rss reader and probably gonna post more from them in the future

[–] [email protected] 1 points 10 months ago

I found this article also very interesting: https://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/

It focusses more or less on one sequence but provides use cases and in-depth knowledge