Can we have a random number generator?

a mechanical ***k?

Just look at it.

3 Likes

44 (forty-four)

Bingo!

1 Like

There’s no 406 on bingo cards. What is wrong with you?!

That’s weird. Mine does:


Here’s another fun one we can all play!

1 Like

That Bingo board looks like it’s from Malkovich’s head.

2 Likes

I think it would be complex to implement this in a way that was hard for the user to game.

You’d need to mark any edits to the post directly, as well as make it clear whether a user had simply deleted their original post and just re-written another one. I think that this would make a complex request.

One simple solution I guess is simply to make all those posts uneditable and undeleteable. But again this requires more changes than simply a macro.

Another, non-technical (and probably impracticable) solution would be to copy the way the old street lotteries (numbers rackets) used to work. A player could pick a stock index, and then the next day that would result in whatever the cent value of that stock closed at. So if in my post yesterday I picked “APPL”, that would result in a value today of “7” (closing price was 132.17).

It’s pretty ungainly, but I kind of like the time-delayed nature of it :wink:

The solution to this problem is fairly simple, you just need a pseudo random number generator, that uses the original post creation time as seed:

That’s my implementation of a javascript module that does something similar, adding a syntax for dice would be trivial.

Using a PRNG you don’t need to lock a player’s edits.

The main characteristic of this implementation of a pseudo random number generator ( PRNG ) is that numbers are pregenerated in an array using a seed.

If you use the same seed, you’ll get the same sequence of numbers every time.

From the top of my head, that has another two use cases:

Say you are playing Endless Sea (or another roguelike), and a player tries to cheat the random number generator saving just before a skill check (or closing the program), to reload the game until it’s possible to pass a check with a 1% chance of happening.

Using a PRNG you can prevent that, because after every load, the PRNG will give you the same number sequence. That is, unless the player decides to take another action that causes a PRNG number to be provided before the check, and even then, it mitigates the effect of that kind of cheat, because the player does not know how many times he has to cause a check before it is possible to succeed on the check he wants.

The other use case, is to make the seed transparent to the player, in order to allow them to share it:

That is used in Dwarf Fortress to share pregenerated worlds, and in The Binding of Isaach Rebirth, allowing players to share a procedurally generated dungeon with other players. (Say you want to play the same map that Northernlion is playing on youtube).

PS: If you use the same seeds I provide on Usage you’ll get the same numbers I did.

2 Likes

Sixteen!

Sounds interesting, maybe the random seed could be tied to the post number so edits and updates don’t mess with the results.

1 Like

One caveat, it’s better to use the post’s Date (minutes and seconds included), if it were the post’s number, the first player would always get the same roll and so on :smiley:

1 Like

I was thinking more like the ID number in the database, I don’t know what this looks like under the hood but each post and thread probably have a unique ID and they could be good static seeds. Time is good too though and more traditional.

1 Like

To avoid fussing with posts, just make a rule. Any post with a random number in it which is subsequently edited causes that roll to critically fail. Or something like that.

2 Likes

I don’t understand how this isn’t equally-likely to be gamed.

Say we’re playing a BBS game. @patrace asks everyone to make a damage roll. I roll mine, and see that I would lose it. Now I delete my post, and wait for some other sucker to roll. Either they get my poor roll (if the engine doesn’t maintain state and just uses the number of rolls in the thread), or they get a random roll. In either case, I now post after that guy, and now I have a brand-new roll.

It’s even worse if the seed is transparent: I simply download your library, work out ahead of time what the results will be, and delay my post accordingly.

It still seems like you would need extra modifications in Discourse to prevent cheating (prevent deletion of posts, etc.).

Thinking on it, perhaps the very simplest way to implement this while eliminating cheating would be instead to simply code it as a bot.

I post:

Damage: {roll:3d6}

(or whatever)

The bot replies with the result:

SamSam damage roll result: 11.

Now it’s worthless deleting or editing my post because I can’t delete the bot’s posts. Everyone will see that I made a damage roll and got an 11.

The nicest thing about this is that it doesn’t depend on changing Discourse at all. It’s just a reply bot.

4 Likes

That’s interesting. I was thinking it might be used by a GM to prove the rolls are legit. The bot idea is good too.

1 Like

Brilliant. Why didn’t I think of that?

Discourse shows deleted posts, it would be a tad suspicious if a user had a bunch of deleted posts, wouldn’t it?

About “timing” your roll down to the millisencond, all I can say is “good luck” Date.now() method returns the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC

I do dig the reply bot idea tho :slight_smile:

From what I had understood of your proposal, each thread would have one seed, and then each “roll” below it was an individual get(). I guess then that each post has its own independent seed instead? That would solve the foresight problem, yes.