Boulder Dash Forum Forum Index Boulder Dash Forum
The only Boulder Dash discussion board in English language!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cave scanning order effects or "Safely touch fireflies!
Goto page Previous  1, 2, 3, 4, 5
 
Post new topic   Reply to topic    Boulder Dash Forum Forum Index -> Tools, Fanstuff
View previous topic :: View next topic  
Author Message
Dustin
Member


Joined: 23 Sep 2007
Posts: 471
Location: Erlangen, Germany

PostPosted: Sat Oct 03, 2020 9:35 pm    Post subject: Reply with quote

Episode 26 - cave 21 analysis
As I've already prepared some pics anyway, I've decided to first analyze the
caves of the third video. After that, I'll try to approach the topic in a
systematic way, analyzing how exactly the BD engine works and how some of
its properties can be used for cavescanning order tricks!
So let's continue with video 3!
https://www.youtube.com/watch?v=wsodCJ2xUHM&t=62s
Cave 21 ("Pandora's Box") starts, of course, at 0:00. Here's the map:


What do we see?
A fire- and a butterfly are trapped inside small "bottles" and they can
obviously only be released together. Rockford is, of course, very much
interested in the butterfly's treasures, but there's a catch in form of a voodoo
that the firefly will directly head to when it's released. So what to do?
Rockford switches sides so he releases the flies from the left side, and he does
so exactly when the flies are ready to go out. Why is he taking that much of a
risk? And why is the firefly going back into the bottle while the butterfly comes
out?

How does it work?
1. Why doesn't Rockford just release the flies without thinking or any
specific timing?

This question should be easy to answer for the cavescanning-order-fan! Very Happy
The firefly is located above the butterfly, which means it is scanned first every
frame. So the firefly will usually come out first and directly kill the voodoo
before Rockford even has a chance to make diamonds! This means, as always,
that Rockford needs a trick! Very Happy

2. Why does the butterfly come out first in the video, in spite of what we
just discussed?

Here's the trick: Rockford waits until both flies are ready to come out...

...and only now digs the dirt to release the flies! Where's the difference? Let's check the cavescanning order:
1. The firefly is scanned before Rockford, so the dirt is still there and the
firefly can't come out! (Instead, it makes a right turn without moving.)
2. Now it's Rockford's turn, who digs the dirt.
3. The butterfly is scanned after Rockford, so the dirt is gone and the fly
is free to move out of its bottle!

Voilá - we tricked the cavescanning order so the butterfly came out first!

3. Why doesn't the firefly follow the butterfly out but moves back into its
bottle?

To answer this, let's analyze one more frame from the last picture:
1. The firefly is first again. It would still like to come out, but this time, it's
blocked by the butterfly! Enerved, it makes another 90 degree turn and now
faces into the bottle.
2. Rockford's turn. He has to escape the butterfly, of course.
3. The butterfly moves right.
I failed to prepare one more picture, but you can imagine that next frame, the
firefly would have space to come out, but it has already turned by 180
degrees and faces into the bottle again!
For a fly to make a 180-degree-turn, it must be blocked (from three sides)
for at least two frames
, and the firefly was first blocked by the dirt, then by
the butterfly, which was just enough to make it move back into the bottle! Very Happy

4. Finally, why did Rockford have to switch sides? Couldn't he have done
the exact same thing from his starting position?

I would like to leave this final question to you! It shouldn't be too hard to
answer if you remember our rules about how Rockford may or may not touch
flies... Wink

In the next cave, we'll finally see slime for the first time! The cavescanning
order rule we'll approach there might even be useful for the original
Boulderdash 2, cave E! See you then! Bye
_________________
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
Back to top
View user's profile Send private message
Dustin
Member


Joined: 23 Sep 2007
Posts: 471
Location: Erlangen, Germany

PostPosted: Sun Oct 11, 2020 7:39 pm    Post subject: Reply with quote

Episode 27 - Cave 22 analysis
https://www.youtube.com/watch?v=wsodCJ2xUHM&t=62s
Cave 22 ("Crosshair") starts at 0:23. Here's the map:


What do we see?
This one is really short, even for a mini cave! Very Happy Rockford is caught between two fireflies, but the main cavescanning order issue is the slime, whose permeability is 0 so that everything falls through it immediately. Still, Rockford is able to collect the diamond before it falls through the bottom piece of slime and gets lost. How is this possible?

How does it work?
First of all, let's clarify one slight difference between a boulder falling through a magic wall and a boulder falling through slime in terms of the way the BD engines are programmed:

Boulder falling through magic wall:
When a falling boulder is scanned and detects a piece of (active) magic wall below it, it falls through it and, at the same time, converts into a falling diamond.
Before:
B
M
S
After:
S
M
D
where B=falling boulder, S=Space, M=Magic Wall (active), D=falling diamond.
Note that the magic wall itself is a passive element, i.e. it does nothing when it's scanned - it's just skipped when the cave is scanned! (Other passive elements are space, dirt, wall, titanium wall, and voodoo.)

Boulder falling through slime:
When a piece of slime is scanned, then first of all the engine generates a random number to find out whether this piece of slime shall be active in this frame. If it is (and only then), the slime checks whether a (non-falling!) boulder or diamond lies on it and whether there's empty space under the slime. If both are true, then the slime swallows the boulder/diamond and, at the same time, spits it out again and, last but not least, makes a falling boulder out of it.
Before:
B
~
S
After:
S
~
B'
where B=Boulder, S=Space, B'=falling boulder and ~ slime.
Note that, other than the magic wall, the slime is an active element and does the swallowing itself. If a boulder is scanned and detects slime under it, nothing happens!

So let's keep these two things in mind:
Rule #1: The boulder-falls-through-slime-thing is done when the slime is scanned, not when the boulder is scanned.
Rule #2: Slime can only swallow a normal boulder, not a falling one.

So, back to the cave, more precisely to the moment where the diamond falls beside Rockford:

Frame 0:

Cavescanning order (interesting are the diamond, the middle and bottom piece of slime, and Rockford):
1. The diamond is scanned. It detects the slime below it, but according to rule #1, nothing happens.
2. Now the slime. According to rule #1 again, it swallows the diamond and converts it into a falling diamond.
3. Rockford's turn. The diamond is beside him, but it's in falling state, which means it cannot be collected!
4. The bottom piece of slime. According to rule #2, it can not swallow the diamond because it's still a falling one! (So, in fact, this clever rule prevents a diamond/boulder from being swallowed several times within one frame!)

Frame 1:

Oops, here I made a mistake - there's still a (falling) diamond to Rockford's left! Exclamation
Cavescanning order:
1. The middle piece of slime has become irrelevant now.
2. The falling diamond is next It notes that there's no empty space below it, so it cannot fall. (It cannot fall through the slime either, because of rule #1!) So it becomes a normal, non-falling diamond (which makes the typical diamond sound!).
3. Rockford's turn. As the diamond has just become non-falling, he can finally collect it! And that's just in time, because...
4. ...the bottom piece of slime was just about to swallow the diamond! Now, however, there's nothing left to be swallowed, so the slime makes a grumpy face and does nothing Very Happy

Frame 2:


So we have the diamond! But what about the fireflies...?!

Frame 3:

Looks threatening? Well, we've seen a lot of fireflies trying to catch our hero already in this threat, so I'll leave this little exercise to you: why can Rockford survive this? The cavescanning order is decisive again, of course! Very Happy

And there's something else you might want to figure out as an exercise: why couldn't Rockford move left at the beginning (instead of right) and do the same thing? Just ignore the fireflies for this! Between frames 0-2 above, there's a tiny difference with a big effect if Rockford stands at the left side of the diamond!

So here's a conclusion that also goes if the slime permeability is not 0:
If Rockford wants to collect a diamond that lies on slime and could be swallowed soon, his chances are slightly better if he approaches from the right side than from the left side!

In the next episode, we'll see how a growing wall wants to spoil Rockford's fun converting boulders into diamonds! Will it succeed or can our hero trick the wall? Of course, we know the answer, but let's see how it works in detail again! Seeya! Bye
_________________
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
Back to top
View user's profile Send private message
Dustin
Member


Joined: 23 Sep 2007
Posts: 471
Location: Erlangen, Germany

PostPosted: Fri Oct 16, 2020 7:44 pm    Post subject: Reply with quote

Episode 28 - cave 23 analysis
https://www.youtube.com/watch?v=wsodCJ2xUHM&t=62s
Cave 23 ("Marplot") starts at 0:32. Here's the map:


What do we see?
Rockford wants to push boulders through a magic wall, but there's a catch: An annoying growing wall wants to block the very space where the diamond should appear! So Rockford does some preparations and arranges everything in a way that all four boulders can convert before the growing wall can block the magic wall. How exactly is this done?

How does it work?
The decisive point is that Rockford must free the space under the magic wall exactly before the first boulder converts, so there's no time for the growing wall to interrupt the action. To achieve this, Rockford must first make the boulders fall and then qucikly move down to free the dirt below the magic wall. This already demands some trickery to gain enough time because normally, Rockford could not be under the magic wall in time before the boulders fall through! This explains why everything is prepared exactly in this way, and the help of the diamond is also strictly necessary to gain enough time!
Now let's focus on the cavescanning order business! Rockford snaps the dirt under the magic wall in this situation:
Frame 0

So one frame later, we have the following picture:
Frame 1:

Cavescanning order:
1. All four boulders are scanned before the growing wall, which means that the bottom one, falling through the magic wall, can convert into a diamond.
2. The magic wall is a passive element, so its scanning is irrelevant.
3. The growing wall is next, but it's blocked by the new diamond.
4. Next is Rockford, who must not yet snap the diamond, for reasone we will see soon!
Frame 2:

1. The boulders keep falling.
2. The growing wall cannot block the way because it's still blocked by the diamond (which is why Rockford couldn't snap it yet!)
3. Rockford's turn. The diamond is still needed to block the gwall, so Rockford just waits again!
Frame 3:
I just see that I haven't prepared more pics, but you can imagine that now the situation is analogous to frame 0, so now it's time to snap the diamond and make space for the next one!
So basically, that's the rhythm - wait two frames, snap, wait two frames, snap... this way and only this way, the growing wall can not block the way until the last diamond is collected!

In the next episode, we'll see the by far biggest cave so far, and it shows a real gauntlet where Rockford has to use the cavescanning order to escape fire-and butterflies in super-narrow tunnels!
_________________
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
Back to top
View user's profile Send private message
Dustin
Member


Joined: 23 Sep 2007
Posts: 471
Location: Erlangen, Germany

PostPosted: Fri Oct 23, 2020 6:09 pm    Post subject: Reply with quote

Episode 29 - cave 24 analysis
https://www.youtube.com/watch?v=wsodCJ2xUHM&t=62s
Cave 24 ("Multiple Choice") starts at 1:00.
No map this time, it's too big for a picture! Very Happy

What do we see?
There's a lot of dodging-fireflies-and-butterflies-in-very-narrow-space-stuff
going on again! Rockford gets the choice between two different tunnels, only
one of them can be passed in one piece. And even this becomes trickier and
trickier every time...

How does it work?
Well, it's obviously not possible for Rockford to completely avoid touching flies
here! But if you pause the video at any point, you can see Rockford touching
flies only from their top or left side, and we've already learned that this is OK
because Rockford is scanned before the fly. As we've analysed quite a few
similar situations before - see, for example, episode 10 - I will just give some
pics showing how each tunnel is done and leave it to you to make a detailed
analysis if you want to!
Just remember the rules which are important here:
1. Each frame, the cave is scanned row-by-row from top to bottom, each row
from left to right.
2. If a fire- or butterfly is scanned, it first makes an explosion check (i.e. it
explodes if it touches Rockford), and then it moves one step. After moving, it
does not make another explosion check!
3. If Rockford is scanned, he never makes explosion checks; he just does
what the player wishes.

Tunnel 1:

green=Rockford's path, white square=fly's spinning area

Tunnel 2:


Tunnel 3:


Tunnel 4:

The green dot means "stop for one frame". It's strictly necessary to do so, as
you will see when you make a frame-by-frame analysis!

Tunnel 5 - the final - is basically the same as tunnel 4, where instead of
stopping, Rockford usus the frame to snap the diamond!

Hope you have fun analysing - I had a lot of fun working everything out, and
also proving that the wrong tunnels are indeed impossible to pass!

In the next episode, we'll see a very simple cave - until the outbox location is
revealed... Laughing
_________________
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
Back to top
View user's profile Send private message
Dustin
Member


Joined: 23 Sep 2007
Posts: 471
Location: Erlangen, Germany

PostPosted: Sun Oct 25, 2020 11:14 pm    Post subject: Reply with quote

Episode 30 - cave 25 analysis
https://www.youtube.com/watch?v=wsodCJ2xUHM&t=62s
Cave 25 ("Reality Shock") starts at 1:38. Here's the map:


What do we see?
This cave looks quite simple at first sight... until the exit location is revealed!
To get access to it, Rockford first crushes the firefly, which looks like a
dangerous mission, and then the butterfly in a way that it destroys the wall
blocking the exit. How do both explosions work? And why can't Rockford crush
the butterfly first, which would be a lot easier?

How does it work?
There are three cavescanning order related questions one might ask, so let's
check them one by one:

Question 1: How is the firefly crushed?
This is done in two steps. First, Rockford traps the firefly in a loop:

Here, the firefly is scanned first and moves down. Then it's Rockford's turn
who moves up.

Now, Rockford is scanned first. He must not move left or down, because then
the firefly would make a positive explosion check afterwards. If Rockford
moves up, he would free the boulder too early because the firefly is not in a
good position to get crushed. So Rockford's only option is to wait! The firefly
makes a negative explosion check and moves right.

Now Rockford is scanned first again and he's free to escape by moving left.

In the second step, Rockford re-approaches the scene and frees the boulder
when the firefly is in a better position to get crushed. I just see I haven't
prepared any pics for this, but as we've seen a lot of Rockford-vs.-firefly-
scenarios anyway, you might want to make a frame-by-frame-analysis by
yourself again! Very Happy

Question 2: How is the butterfly crushed?
In order to free the exit, the butterfly must be crushed by a diamond while
the diamond is still at the top row of the cave! This only works because of a
kind of non-intuitive property of the BD engine (see below).

Rockford had to wait for the butterfly to touch him! Now, Rockford is luckily
scanned before the fly and moves left, while the butterfly does not move, as it
cannot make a left turn immediately. The diamond does not yet start moving,
because it was scanned before Rockford moved out of the way!

Now the diamond is scanned first. It detects enough empty space so it
decides that it can fall sideways from the bottom diamond. So it moves left
and changes its state into "falling"! That's the engine property I
mentioned before - the diamond becomes "falling" before it actually starts
"falling" (i.e. moving downwards)! After the diamond, the butterfly is scanned
and moves up, into the diamond's way. Rockford knows what will happen
next, so he moves away quickly!

Now, everything becomes clear - the "falling" diamond crushes the butterfly!

Question 3: Why can't the flies be crushed in reverse order?
It would be a lot easier to crush the butterfly to blast the wall, so why not do
this? Well, the problem is that the firefly cannot be used to free the exit. The
different moving patterns of fire- and butterfly mean that only the butterfly
can be used to free the exit, so the firefly must be crushed first!

In the next episode, we will see something entirely new: an open border
effect!
_________________
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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Boulder Dash Forum Forum Index -> Tools, Fanstuff All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4, 5
Page 5 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group