1. Announcing Mekorama on the Web!

    Now anyone can play levels from the forum online, with one click!

    Dismiss Notice
  2. Psst! If you're new here, welcome! Please visit these pages first for information about the forum and Mekorama:

    Welcome! ¡Bienvenido! Selamat datang! Добро пожаловать! Willkommen!
    and
    Everything you want to know about Mekorama

    Dismiss Notice

Bot Paths Claustrophobia research

Discussion in 'Game Behaviours' started by QuantumForce, Feb 18, 2017.

  1. QuantumForce

    QuantumForce Active Member

    Messages:
    37
    Levels:
    3
    Albums:
    1
    Likes Received:
    113
    Joined:
    Oct 19, 2016
    I've been trying to collect what is known about the low ceiling effect / claustrophobia.

    From the Introduction to Mekorama document:

    It would be nice to collect what is currently known about more complex case
    • If there are multiple exits, how are they chosen?
    • If the exits change while B is moving, does he recalculate?
    • How is the claustrophobic path related to autopilot?
     
  2. Frenzies

    Frenzies Administrator Staff Member

    Messages:
    355
    Levels:
    18
    Albums:
    5
    Likes Received:
    1,215
    Joined:
    Jun 15, 2016
    B sticks to his claustrophobic path, even if things are moved into its way or exits are changed, so it can be combined with autopilot. This can lead to some interesting tricks, as you can see in @cpw's Conquer series.
     
    QuantumForce likes this.
  3. QuantumForce

    QuantumForce Active Member

    Messages:
    37
    Levels:
    3
    Albums:
    1
    Likes Received:
    113
    Joined:
    Oct 19, 2016
    One thing I found is that B will go a maximum of 100 squares from the square tapped and then stop.

    If you tap on the first square in front of B, he will go three loops to the left. If you tab two blocks east of B ("skipping" the first loop), he will stop 2 spaces short of the end.
    1x136-Quantum_Force.png
     
    BangTe, Gepeto, cpw and 1 other person like this.
  4. cpw

    cpw Retired Moderator

    Messages:
    236
    Levels:
    65
    Albums:
    4
    Likes Received:
    880
    Joined:
    Jun 5, 2016
    @QuantumForce Yes, he also always stops in a claustrophobic loop after a certain number of cycles. It might have to do with the loop's size. It's also worth mentioning that the "exit" must be at the same level of the path -- so if B enters the loop by an ascending staircase, he would not see the sunken entrance as the exit. This gives a reliable loop setup where B would keep running without exiting the loop (as in the first tree loop of my Conquer). I figured this out because the behavior of B would change depending on the orientation of the exit -- N/E/S/W directions do affect his choice of exits. I think @explorer and @Scare Crow have done quite some experiments on the preference of exits.
     
    Scare Crow, Frenzies and QuantumForce like this.
  5. QuantumForce

    QuantumForce Active Member

    Messages:
    37
    Levels:
    3
    Albums:
    1
    Likes Received:
    113
    Joined:
    Oct 19, 2016
    @cpw Yeah, I did a 3x3 loop test (h/t @nGord) and he stops after 100 squares on that too.

    Screenshot_20170218-004242.png
     
    cpw likes this.
  6. Frenzies

    Frenzies Administrator Staff Member

    Messages:
    355
    Levels:
    18
    Albums:
    5
    Likes Received:
    1,215
    Joined:
    Jun 15, 2016
    Off topic, but is that screenshot from nGord? I see a few levels in the background :rolleyes:
     
    cpw likes this.
  7. QuantumForce

    QuantumForce Active Member

    Messages:
    37
    Levels:
    3
    Albums:
    1
    Likes Received:
    113
    Joined:
    Oct 19, 2016
    I think they're just tests of claustrophobia stuff, but maybe I should have asked him before sharing the image :oops:
     
  8. Gepeto

    Gepeto MekoStudio Architect Staff Member

    Messages:
    453
    Levels:
    48
    Albums:
    1
    Likes Received:
    2,504
    Joined:
    Jul 7, 2016
    Nice subject. Here is a test I have made long time ago (I had hard time to find it on my list... ;)). This is not phenomenal but only about the use of the claustrophobia effect indefinitely in a infinity loop. It happened that B stops after a while. I now know that it is after 100 blocks, thanks!
    [​IMG]
     
    QuantumForce likes this.
  9. Gepeto

    Gepeto MekoStudio Architect Staff Member

    Messages:
    453
    Levels:
    48
    Albums:
    1
    Likes Received:
    2,504
    Joined:
    Jul 7, 2016
    Another test I have just made: creating the path on the way. It appears that the claustrophobia effect does not work as soon as the path is not complete.
    [​IMG]
    I have expected that B would stop before the hole despite the ball fall when passing (precalculation) or at the end if the path is calculated on the way. But it just didn't start if there's a hole in the path...
     
    BangTe and QuantumForce like this.
  10. nGord

    nGord Standby Administrator, Retired Moderator Staff Member

    Messages:
    608
    Levels:
    7
    Albums:
    4
    Likes Received:
    2,827
    Joined:
    Jul 21, 2016
    Not true. If the block is a stair block or a cube block is indifferent as to whether B continues his running around under the low ceiling. What is relevant is whether the block is in the right direction according to B's decision making at forks in the path.
    Yes, we knew that.
    Yes, this is true whether it is a loop or a continuous path. The count starts after the block tapped though. Here (in the spoiler) is a test bed where you can count the steps. The second stone block is 100 tiles after the first one. So even if there is an exit to which normally B would go to under the Claustrophobia effect, his autopilot expires after 100 tiles. The same goes for the first grass block. Anything after the first brick block, though, always sends B to the first non-low ceiling block (even if less than 100 tiles).
    [​IMG]
     
    Makaroni likes this.
  11. cpw

    cpw Retired Moderator

    Messages:
    236
    Levels:
    65
    Albums:
    4
    Likes Received:
    880
    Joined:
    Jun 5, 2016
    Ah, what I meant was that the sunken entrance would override B's decision to exit the loop. That is, if the staircase is part of the loop itself such that B steps onto the staircase from a lower block, he would not exit no matter what direction it is. ;)
     
  12. cpw

    cpw Retired Moderator

    Messages:
    236
    Levels:
    65
    Albums:
    4
    Likes Received:
    880
    Joined:
    Jun 5, 2016
    Just to illustrate how I used the setup on the right to make sure B won't come out of the tree in Conquer I:
    [​IMG]
    In the left setup, B would exit the loop if he runs clockwise (but not counterclockwise). The right setup however doesn't cause him to exit in either directions. :rolleyes:
     
    Makaroni likes this.
  13. nGord

    nGord Standby Administrator, Retired Moderator Staff Member

    Messages:
    608
    Levels:
    7
    Albums:
    4
    Likes Received:
    2,827
    Joined:
    Jul 21, 2016
    Right, err, correct. But isn't that just because of the Inset Stair Antidote?

     
    QuantumForce likes this.
  14. cpw

    cpw Retired Moderator

    Messages:
    236
    Levels:
    65
    Albums:
    4
    Likes Received:
    880
    Joined:
    Jun 5, 2016
    I believe it has to do with the fact that under claustrophobia, B treats all the staircases as normal blocks and would keep running on blocks at the same elevation (hence ignoring the sunken grass block outside the loop). The grass block is therefore not considered as a "legit" exit as it is lower than the loop itself (although he was standing there before entering the loop). :rolleyes:
     
    QuantumForce likes this.
  15. QuantumForce

    QuantumForce Active Member

    Messages:
    37
    Levels:
    3
    Albums:
    1
    Likes Received:
    113
    Joined:
    Oct 19, 2016
    Can anyone explain the algorithm for choosing the path? There seems to be a preference for going straight, for turning south and east, and for going the shortest way to an open spot.

    The pathing seems more complicated than I expected. I was hoping for something simple like "breath first search for an open square, searching east-west directions first". However the "go straight" preference counters that hypothesis. Then again, I don't even understand the auto-pathing algorithm without complications from low ceilings.
     
    Last edited: Feb 20, 2017
  16. nGord

    nGord Standby Administrator, Retired Moderator Staff Member

    Messages:
    608
    Levels:
    7
    Albums:
    4
    Likes Received:
    2,827
    Joined:
    Jul 21, 2016
    I'm not sure this is all true. There is a general order of preference as follows: E>W>S>N. So if B is travelling North, and an option to go East is available, he'll take it. But if he's already travelling West, he will continue straight only because turning around on the spot to go back East is not an option and West is a higher priority than South or North.

    The shortest way to an exit is untrue. In fact, even if there are many paths to an exit, B can find himself either not going further than where tapped to or stuck in a counter-clockwise loop (going E, then N, then W, then S, then E again, etc.).

    I'm still working on a more comprehensive answer.

    EDIT: Sorry, clockwise loops are also possible. And in either loop case, the only criteria is that the loop does not have any entrances/exits from the E or W (unless in the case from the W there is a path to the E that is part of the loop at that same juncture).
     
    Last edited: Feb 21, 2017
    Makaroni, QuantumForce and cpw like this.
  17. QuantumForce

    QuantumForce Active Member

    Messages:
    37
    Levels:
    3
    Albums:
    1
    Likes Received:
    113
    Joined:
    Oct 19, 2016
    That's actually enough to explain everything I've seen. When low ceiling is clicked, first the normal auto-path algorithm calculates the path there. Then it searches the surrounding squares in EWSN order for the first valid move, disallowing the direction B came from. This is repeated until either
    1. A non-claustrophobic tile is discovered, in which case B follows this path
    2. The search reaches a dead end, in which case B stops at the square clicked
    3. 100 steps are reached, in which case B follows the path and then stops.
    I think this fits well with @cpw's explanation of the inset stair antidote. It's an extremely simple algorithm, so it just looks for "walkable block with two air above it" when deciding if a direction is valid. It doesn't have a proper idea for which direction stairs face, and it only looks on the same level as was clicked.
     
    Makaroni and nGord like this.
  18. cpw

    cpw Retired Moderator

    Messages:
    236
    Levels:
    65
    Albums:
    4
    Likes Received:
    880
    Joined:
    Jun 5, 2016
    Two more cards I made while playing around with multiple exits:
    [​IMG]
    In the above card, the N exit (a low-priority one) only becomes valid when the draggable S branch is moved to the left. This creates an exit that only works when the branch is "removed" (i.e. slid to the left such that the whole floor plan becomes one single zigzag path). This seems to suggest that the path is calculated on a per-juncture basis, and if you offer B a dead-end towards S while the exit is of the lowest priority (towards N), B would just prefer to stay under the ceiling instead of taking the N exit. What surprised me in this card, however, is that B is affected by the false exit to S (which actually has a ceiling) and would not exit to N if the S branch is not removed.

    [​IMG]
    This one is easier to explain and is basically a setup to show the order of exits B would choose. At first B can only come out if the ceiling is open at E (not even W is attractive enough for him). As he arrives at E, rotate the ceiling so that the open spot is W, and B would move to W. However if you rotate the ceiling opening to N or S, B would simply refuse to go there, which makes the Win only accessible from E or W. o_O

    Anyhow, although I do think that these patterns are probably too cryptic for a fun / popular puzzle, I figured it might be interesting for creators to at least know about them. :rolleyes:
     
  19. QuantumForce

    QuantumForce Active Member

    Messages:
    37
    Levels:
    3
    Albums:
    1
    Likes Received:
    113
    Joined:
    Oct 19, 2016
    Has anyone made levels yet using these? I'm a terrible level designer but I would love to play some, even if they are hard for people who haven't read this thread.

    @cpw I think that your second example would be a particularly nice mechanism for a puzzle.
     
    cpw likes this.
  20. cpw

    cpw Retired Moderator

    Messages:
    236
    Levels:
    65
    Albums:
    4
    Likes Received:
    880
    Joined:
    Jun 5, 2016
    @QuantumForce I was considering making one earlier, but shelved it for now as I think most players won't be interested in digging into those patterns. :eek::rolleyes:
     

Share This Page