Game definitely not random


Problems running or configuring the software, commands & options, compiling, different platforms, using the interface, documentation, etc.

Dungeon Dilettante

Posts: 1

Joined: Friday, 1st February 2013, 13:17

Post Friday, 1st February 2013, 13:48

Game definitely not random

Hi everyone :D
I've tried to search in the forum, but I just couldn't find anything, maybe because I'm not used to these things, or maybe because I'm not a really good english speaker and I just tried out the wrong words or whatever.
The point is, in the last week the game isn't as random as it was before. Every damn character I try (and I've sacrified a lot of characters, trust me :roll:), i finish up encountering the same uniques every time. Jessica is an overly attached girlfriend, she is always waiting for me on the third floor, always! She's not tough, but.. it's just not funny this way :( For two months, i've never encountered Ijyb, now he's everywhere. The same for Sigmund and Terence. What the hell is wrong?
Furthermore, the last five times I've played I found, on the first floor, a venom dagger. I mean, five times the same venom dagger?
I play the offline 0.11.2 tiles version. I've tryed to download it another time, but nothing changes.
Any ideas?

Dungeon Master

Posts: 1531

Joined: Saturday, 5th March 2011, 06:29

Post Friday, 1st February 2013, 14:04

Re: Game definitely not random

This is probably what is known as "clustering illusion".

The theory is that someone, somewhere, will get exactly the right RNG rolls for this to happen to them. That person will therefore post here or on the bug tracker because it appears that their RNG is broken.

The fact that exactly one person has posted this proves the theory.

Blades Runner

Posts: 546

Joined: Saturday, 7th May 2011, 02:43

Post Saturday, 2nd February 2013, 02:43

Re: Game definitely not random

To put it more mathematically: the set of randomly generated games/sequences of games includes strictly all possible 'themed' games/sequences of games .
If this was not true (-> the RNG wouldn't generate themed games/sequences of games), THEN there would be serious grounds for thinking the RNG was not random.

Unless you are getting the same unique on the same DL 50+ times in a row, we should avoid artificially constraining the RNG output.

Personally I'd like to have something like the Brogue seedscummer so we could setup themed runs / be able to compare multiple player's playing of the exact same game.
User avatar

Ziggurat Zagger

Posts: 5832

Joined: Thursday, 10th February 2011, 18:30

Post Saturday, 2nd February 2013, 06:21

Re: Game definitely not random

I cannot remember the last time I have entered a level containing only one early game unique; they always come in at least pairs, or in the case of the elf twins, triplets.
"Be aware that a lot of people on this forum, such as mageykun and XuaXua, have a habit of making things up." - minmay a.k.a. duvessa
Did I make a lame complaint? Check for Bingo!
Totally gracious CSDC Season 2 Division 4 Champeen!

Vestibule Violator

Posts: 1508

Joined: Monday, 21st November 2011, 07:40

Post Saturday, 2nd February 2013, 07:01

Re: Game definitely not random

XuaXua wrote:I cannot remember the last time I have entered a level containing only one early game unique; they always come in at least pairs, or in the case of the elf twins, triplets.


Your experience is much gentler than mine. For me they "come not single spies but in battalions." I seem to have a knack for getting Pikel, Sigmund, the Elf twins, and quite likely Jessica as well on a level. I think Crawl is trying to teach me to run away...
Usual account: pblur on kelbi

Ziggurat Zagger

Posts: 6393

Joined: Friday, 17th December 2010, 18:17

Post Sunday, 3rd February 2013, 02:51

Re: Game definitely not random

We should issue a Crawl Tavern Bingo card to all new forum members.

For this message the author Grimm has received thanks:
Airwolf
User avatar

Ziggurat Zagger

Posts: 5832

Joined: Thursday, 10th February 2011, 18:30

Post Sunday, 3rd February 2013, 04:00

Re: Game definitely not random

byrel wrote:
XuaXua wrote:I cannot remember the last time I have entered a level containing only one early game unique; they always come in at least pairs, or in the case of the elf twins, triplets.


Your experience is much gentler than mine. For me they "come not single spies but in battalions." I seem to have a knack for getting Pikel, Sigmund, the Elf twins, and quite likely Jessica as well on a level. I think Crawl is trying to teach me to run away...


I was trying to be gentle, but yes my experience is similar. That's 3.
"Be aware that a lot of people on this forum, such as mageykun and XuaXua, have a habit of making things up." - minmay a.k.a. duvessa
Did I make a lame complaint? Check for Bingo!
Totally gracious CSDC Season 2 Division 4 Champeen!

Vestibule Violator

Posts: 1508

Joined: Monday, 21st November 2011, 07:40

Post Sunday, 3rd February 2013, 08:19

Re: Game definitely not random

Grimm wrote:We should issue a Crawl Tavern Bingo card to all new forum members.

I'm assuming I gave someone "Quoting or referencing obscure foreign literature"? I hadn't noticed the Tavern Bingo thread before. Is there actually a canonical form? I think I may have to take this up. :twisted:
Usual account: pblur on kelbi
User avatar

Dungeon Master

Posts: 162

Joined: Sunday, 29th May 2011, 10:18

Post Saturday, 2nd March 2013, 22:16

Re: Game definitely not random

Hi,

I wrote the current version of the random number generator to replace Mersenne Twister because a player figured out how to predict the state. In general writing a random number generator is a very bad idea. If you doubt me look at java.lang.Random.

The generator is seeded from the system's pseudorandom number generator, combining that output with the current system time and process id.

The generator has a 160-bit internal state. This is a very large state. For those keeping score at home, there are approximately 2^190 atoms in the sun.

The design is based on combining JKISS, a non-cryptographic RNG, with an alternating step generator (ASG).

JKISS works by jamming together three different so-so RNGs: one linear congruential generator (LCG), a multiply-with-carry generator (MWC) and a xorshift generator. I have slightly modified JKISS to make it resistant to the types of cryptanalysis that a crawl player might attempt.

An ASG works by combining the output from two independent generators and alternatively advancing them based on the output of a third 'gate' generator. In this case, I use a 32-bit Galois Linear Feedback Shift Register as the gate and advance a xorshift generator or a MWC generator. The output of these generators is combined is with an LCG.

This generator passes L'Ecuyer's TestU01 Big Crush suite and Marsaglia's Diehard suite. Mersenne Twister fails two of the tests in this suite.

As others have said, crawl is pretty darn random.

For this message the author brendan has received thanks: 21
Confidence Interval, dpeg, Grimm, jejorda2, Napkin, nicolae, njvack, ohmi, Roderic, Utis and 11 more users
User avatar

Barkeep

Posts: 4434

Joined: Tuesday, 11th January 2011, 12:28

Post Monday, 4th March 2013, 15:34

Re: Game definitely not random

brendan wrote:I wrote the current version of the random number generator to replace Mersenne Twister because a player figured out how to predict the state.

Was this a party trick, or was it actually exploitable?
I am not a very good player. My mouth is a foul pit of LIES. KNOW THIS.
User avatar

Pandemonium Purger

Posts: 1315

Joined: Monday, 24th October 2011, 06:13

Post Monday, 4th March 2013, 17:33

Re: Game definitely not random

I'll decide all the numbers from now on. The first number is 60. PM me for the second, etc
seattle washington. friends for life. mods hate on me and devs ignore my posts. creater of exoelfs and dc:pt

For this message the author twelwe has received thanks:
Arrhythmia

Abyss Ambulator

Posts: 1196

Joined: Friday, 17th December 2010, 13:59

Location: Maryland, USA

Post Monday, 4th March 2013, 20:22

Re: Game definitely not random

njvack wrote:
brendan wrote:I wrote the current version of the random number generator to replace Mersenne Twister because a player figured out how to predict the state.

Was this a party trick, or was it actually exploitable?

Different game, but awesome story...

Some many months back, I read a thread on r.g.r.nethack about exploiting that game's RNG. On a Unix box, the seed for dungeon generation is the Unix time when the game is first launched (for generating the dungeon). It doesn't take much imagination to see how this could be abused. Anyhow, on one of the public Nethack servers, one player (call him Alan) who knew how this worked sent a message to a friend of his (Bob) telling him to start a game at a precise server time. Bob did so, and had a minor "oh shit" moment when Alan -- not logged onto the server and thus not observing the game -- started texting him with a description of the room he was in, and telling him things like "the gold pile in the corner is 14, and there's a secret door in the south wall 3 grids from the left". Once Bob had sufficiently freaked out, Alan advised him to quit the game for ethical reasons.

I may have some details wrong, but that's the gist of it.
You fall off the wall. You have a feeling of ineptitude.

Dungeon Master

Posts: 1531

Joined: Saturday, 5th March 2011, 06:29

Post Monday, 4th March 2013, 22:55

Re: Game definitely not random

There's a similar story to Stormfox's but involving online poker and shuffling algorithms: http://www.cigital.com/papers/download/developer_gambling.php

Clearly, such RNG abuse can be a lot more serious when it comes to gambling ;)
User avatar

Barkeep

Posts: 4434

Joined: Tuesday, 11th January 2011, 12:28

Post Tuesday, 5th March 2013, 15:53

Re: Game definitely not random

brendan wrote:I wrote the current version of the random number generator to replace Mersenne Twister because a player figured out how to predict the state. In general writing a random number generator is a very bad idea. If you doubt me look at java.lang.Random.

One other question: why a custom PRNG as opposed to /dev/urandom on unix and CryptGenRandom on Windows? I'm actually curious, not trying to be an ass.
I am not a very good player. My mouth is a foul pit of LIES. KNOW THIS.

Snake Sneak

Posts: 116

Joined: Monday, 14th March 2011, 11:14

Post Friday, 24th January 2020, 19:17

Re: Game definitely not random

I know that a truly random generator will still occasionally generate streaks of suspicious numbers. Stuff like that happens in nature too.

Today I lost a low-level Ogre abyssal knight. He was very wounded, only around 20 HP left, and cornered by a giant frog or something like that. Melee skill not particularly good yet and only around 13 EV. So I decided to use a wand of Paralysis instead. 41% chance to beat MR. I zapped it five times, and failed five times in a row. My ogre died. Odds of something like this happening are (1.0 - 0.41)^5 = 0.07. Do people frequently get results like that? I also remember a wand of Random Effects that just kept enchanting enemies with Invisibility of all things, something like 4 casts in a row.

I don't know how exactly the random number generator works, but wands I find tend to cluster in my games. I rarely get a good spread of various wands, rather it's typical I get 3-5 types of wands and they keep showing up for the most of the game. Anyone else experiencing this?

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.