Random seeds in classic BD games

Everything about the various Boulder Dash tools, and other stuff created by the fans.

Moderator: Admin

User avatar
Dustin
Member
Posts: 589
Joined: Sun Sep 23, 2007 1:15 am
Location: Erlangen, Germany

Post by Dustin »

BD2-E and the RNG

In BD2-E, there's an interesting effect concerning the slime: If Rockford gets crushed in a way that the explosion destroys 3 slimes, then some boulders/diamonds will never fall through the slime afterwards! Most probably everyone failed this way at least one in their BD career, and perhaps you also wondered why this is happening! However, if Rockford gets crushed at the left border, so that only 2 slimes explode, such an effect does not occur. Now, based on Arno's RNG analysis, I think I've found the reason!

Arno, perhaps we can make a puzzle out of it? I'm absolutely sure you'll love the solution, especially if you figure it out for yourself! Just check the map carefully, perhaps counting something is not a bad idea, and then I'm sure you'll be as stunned as I was today! :D
Boulder Dash X Rock, Paper, Scissors:
ROCKFORD collects DIAMOND, digs DIRT
DIAMOND outvalues DIRT & BOULDER
DIRT carries BOULDER, blocks FIREFLY
BOULDER kills FIREFLY & ROCKFORD
FIREFLY kills ROCKFORD, guards DIAMOND
User avatar
Dustin
Member
Posts: 589
Joined: Sun Sep 23, 2007 1:15 am
Location: Erlangen, Germany

Post by Dustin »

At Krissz's site, we've already discussed the solution, so here it is, and it could be an idea for very interesting slime caves as well:

In BD2-E, there are 4*19=76 slimes at the start. If 3 get destroyed, then 73 remain, which exactly matches Arno's 73-cycle of the RNG discussed above! Funny coincidence! :D

Every time the cavescanner scans a piece of slime, it calculates a new random number (more precisely: a set of 2 numbers) to decide whether the slime is active for this frame. This is done even if the slime can't swallow anything currently! This means that with exactly 73 slimes in the cave, each slime always gets the same seed2 value (in the long run). Also the seed1 value (which decides about the slime being active or not) then isn't completely random anymore (as deeply analyzed by Arno above). So each slime only gets a few different ssed1 values, and if none of them make the slime active, then it will never be!

As the exact cycle length of the C64 RNG (for the whole seed1/seed2 pair) is 949=73*13 (source: Nesdori), similar effects should also be possible with exactly 13 slimes in the cave.

Do caves using this effect already exist? I don't remember any, but I also don't know every fangame by far. If someone knows/ has made such a cave, it would be very interesting to see it! :D
Boulder Dash X Rock, Paper, Scissors:
ROCKFORD collects DIAMOND, digs DIRT
DIAMOND outvalues DIRT & BOULDER
DIRT carries BOULDER, blocks FIREFLY
BOULDER kills FIREFLY & ROCKFORD
FIREFLY kills ROCKFORD, guards DIAMOND
User avatar
Arno
Site Admin
Posts: 2826
Joined: Sat Mar 17, 2007 2:26 pm
Location: netherlands
Contact:

Post by Arno »

Dustin wrote:... So each slime only gets a few different ssed1 values, and if none of them make the slime active, then it will never be!
Excellent research again! :D
I remember I have seen such effect before, but not in BD2 cave E, but just when I designed a cave in the CKit that some pieces of slime refused to let a boulder/diamond through, while all other slimes did that very fast.
Very cool that we now know the explanation, and indeed a nice source for new cave ideas! :D
User avatar
Dustin
Member
Posts: 589
Joined: Sun Sep 23, 2007 1:15 am
Location: Erlangen, Germany

Post by Dustin »

There's another funny thing which might fit into this topic, namely that 12 is the "low diamond seed" and 14 is the "high diamond seed"!

What I mean by this is that in any BD1/2 caves where seed 12 is used, there are remarkably few diamonds, and many diamonds with seed 14.

Let's go through all the caves where seeds 12 and/or 14 occur:

Boulder Dash 1, cave A
Random Seeds: 10 11 12 13 14
Diamonds available: 18 20 15 23 26

Boulder Dash 2, cave A
Random Seeds: 11 12 13 14 15
Diamonds available: 6 5 6 12 7

Boulder Dash 2, cave F
Random Seeds: 10 11 12 13 14
Diamonds available: 35 47 39 39 49

Boulder Dash 2, cave G
Random Seeds: 10 11 15 13 14
Diamonds available: 12 18 15 18 19

Boulder Dash 2, cave K
Random Seeds: 10 11 12 13 15
Diamonds available: 26 28 22 25 28

Boulder Dash 2, cave L
Random Seeds: 12 8 7 9 11
Diamonds available: 35 36 33 37 34

Boulder Dash 2, cave P
Random Seeds: 10 11 12 13 14
Diamonds available: 41 45 38 34 42

We can see that in the caves with low diamond densities (<30 diamonds), the orange values are always smallest and the green values biggest!

Of course, a BD scientist also has to consider the counter-examples, and in the caves with high diamond density (>30 diamonds), both seeds, 12 and 14, can lose their top/flop positions! :D

Also when I create 5-level caves for the Dustin's BD series, I sometimes get confronted with that phanomen. If I intend to use seed 12 with a low diamond density, I automatically have in my head that there're not a lot of diamonds to await! :D

One more interesting note: In BD2-G, we clearly see that seed 12, which "belonged" into level 3, was replaced by 15. I'm pretty sure the reason is this very topic! If you change the seed of this cave to 12, there're only 6(!) diamonds available, which is only half the amount of level 1, which has the least diamonds of all levels! I guess the creators didn't like the cave with so few diamonds so they just skipped the seed! :D
Boulder Dash X Rock, Paper, Scissors:
ROCKFORD collects DIAMOND, digs DIRT
DIAMOND outvalues DIRT & BOULDER
DIRT carries BOULDER, blocks FIREFLY
BOULDER kills FIREFLY & ROCKFORD
FIREFLY kills ROCKFORD, guards DIAMOND
User avatar
Arno
Site Admin
Posts: 2826
Joined: Sat Mar 17, 2007 2:26 pm
Location: netherlands
Contact:

Post by Arno »

Dustin wrote:There's another funny thing which might fit into this topic, namely that 12 is the "low diamond seed" and 14 is the "high diamond seed"!
Very well spotted! :D
Probably related to that within the Fill schema, diamonds are usually placed for the lower random numbers. Apparently, for seed 12, low numbers occur less frequently than high numbers...
User avatar
Dustin
Member
Posts: 589
Joined: Sun Sep 23, 2007 1:15 am
Location: Erlangen, Germany

Post by Dustin »

Thx Arno! It kept striking me during 20 episodes of Dustin's BD 5-level cave designing! :D

Yes indeed, random diamonds in BD1/2 are always related to low random numbers. The densities used for the caves mentioned above are:

BD1-A: SPACE 60 BOULDER 50 DIAMOND 9
BD2-A: BOULDER 50 DIAMOND 5
BD2-F: BOULDER 220 DIAMOND 80
BD2-G: SPACE 120 BOULDER 50 FIREFLY 15 DIAMOND 9
BD2-K: DIAMOND 15
BD2-L: BOULDER 90 DIAMOND 20
BD2-P: SPACE 189 BOULDER 179 DIAMOND 19

We see that diamonds are always placed at the lowest random values. This means that, as you said already, with seed 12 the RNG produces few low random numbers, and with seed 14 many of them!
Boulder Dash X Rock, Paper, Scissors:
ROCKFORD collects DIAMOND, digs DIRT
DIAMOND outvalues DIRT & BOULDER
DIRT carries BOULDER, blocks FIREFLY
BOULDER kills FIREFLY & ROCKFORD
FIREFLY kills ROCKFORD, guards DIAMOND
Post Reply