r/kotor•
uwadmin12

Solving Rakatan Temple Catacomb Puzzle

I have a habit of ignoring datapad, which in K1 has negligible consequences since one can get most things right through trial and error. The one thing that I could not figure out through trial and error is this frigging puzzle, so I wrote some code to solve it instead ;). I was able to eliminate repetition movements (i.e. moving back and forth between two tiles) for the computation, but I'm sure it could be optimized further.

Temple Catacomb Puzzle is undoubtedly the most difficult puzzle in the game where you need to flip the colour of all tiles on a 3 by 3 grid. You are only allowed to move vertically, and horizontally (not diagonally, for now). Each time you touch upon a tile, the colour of the tile and its surrounding tiles are flipped. For our purpose, I'll label the tiles from coordinate (0,0) to (2,2), which represents the bottom left and upper right tile, respectively. This means the 'H' path suggested on the Data Pad leads to 2 unique paths:

  1. (0, 0)->(0, 1)->(0, 2)->(0, 1)->(1, 1)->(2, 1)->(2, 2)->(2, 1)->(2, 0)
  2. (0, 0)->(0, 1)->(0, 2)->(0, 1)->(1, 1)->(2, 1)->(2, 0)->(2, 1)->(2, 2)

Surprisingly, if we limit the number of steps to 12, then these 2 paths are the only valid and unique ones, which require 9 steps. If we limit the number of steps to 16, then we get 166 unique paths to solve the puzzle! Below are a few examples (13 steps):

  1. (0, 0)->(0, 1)->(1, 1)->(0, 1)->(0, 2)->(1, 2)->(2, 2)->(2, 1)->(1, 1)->(1, 2)->(1, 1)->(2, 1)->(2, 0)
  2. (0, 0)->(0, 1)->(1, 1)->(2, 1)->(2, 0)->(2, 1)->(2, 2)->(1, 2)->(0, 2)->(1, 2)->(1, 1)->(0, 1)->(1, 1)
  3. (0, 0)->(0, 1)->(0, 2)->(0, 1)->(0, 0)->(1, 0)->(2, 0)->(2, 1)->(2, 2)->(2, 1)->(1, 1)->(1, 0)->(0, 0)

If we set step limit to 17, then there are 8887 unique paths!!! Below are a couple of examples:

  1. (0, 0)->(0, 1)->(1, 1)->(0, 1)->(0, 0)->(1, 0)->(0, 0)->(0, 1)->(1, 1)->(0, 1)->(0, 2)->(1, 2)->(2, 2)->(1, 2)->(1, 1)->(1, 0)->(2, 0)
  2. (0, 0)->(0, 1)->(1, 1)->(0, 1)->(0, 2)->(1, 2)->(1, 1)->(2, 1)->(1, 1)->(1, 2)->(1, 1)->(2, 1)->(2, 0)->(2, 1)->(1, 1)->(2, 1)->(2, 2)

If we introduce diagonal movement, however, there are 33 unique paths that only requires 9 steps. One example of such paths is: (0, 0)->(0, 1)->(0, 2)->(1, 1)->(0, 1)->(1, 1)->(2, 2)->(1, 1)->(2, 0). The number of viable solutions explodes as the step limit increases, and there should be an infinite number of solutions to such a puzzle.

Moral of the story: always read datapads, don't waste half an hour on this code and another half an hour on this post like myself!!

Posted Jul 15, 2019, 5:45 PM UTC

718
ShemLHK-47•

The letter "H" is your friend. 😉

5
uwadmin12OPCalo Nord•

Too true!

1
OutsideJuice•

just walk in an H like the datapad says lol

3
uwadmin12OPCalo Nord•

Yup, figured that out on my second playthrough when I actually read the datapads.

2
OutsideJuice•

<3

1
asdf1234asfg1234Bastila Shan•

I just google all the puzzles

2
uwadmin12OPCalo Nord•

Wanted to avoid spoilers u know.

1
[deleted]•

I saw a chart somewhere. I’ll see if I can find it.

2
uwadmin12OPCalo Nord•

Dew it!

2
[deleted]•

Could not find a simple picture, but I found a video that shows you how to do it with no spoilers. https://m.youtube.com/watch?v=yPBCtVZKdpo

2
uwadmin12OPCalo Nord•

Gotcha

1
RevanReborn365:infinite-empire:Lord of the Infinite Empire•

Thing is the game doesn't allow you to finish the puzzle unless you have the datapad, so even with this code you have to pick it up to begin with.

2
uwadmin12OPCalo Nord•

Is that right? Anyways yeah I picked up all the datapads but never bothered reading'em until replays.

1
RevanReborn365:infinite-empire:Lord of the Infinite Empire•

Yes, I had played it through several times, and remembered that the pattern was an "H" but when I tried it it wouldn't work and I went and got the datapad and it worked.

2
Voeglein•

I hate this puzzle so much. I already do not have a clue how to solve it efficiently (instead, I just trial and error for 5 minutes) but even if I did, the controls of the game are just not meant for that kind of puzzle. Your movement controls aren't precise enough, and you cannot issue a command to move to a specific point.

The times I walked onto a tile I didn't want to just because I couldn't do a proper 180 turn was mildly annoying and undoubtedly one of the worst experiences with the game. Then again, that only serves to show how much I liked the game overall, when such a little thing turned out to be the worst part of it all.

2
uwadmin12OPCalo Nord•

Yeah I feel ya. Are you playing on XBox or Mobile? If you're on PC you could try holding down 'B' while walking on the puzzle, that'll change your movement from run to walk and give you a more precise control.

1
Voeglein•

It was on PC. Will probably forget this by the time I play the game the next time, as I always ignore tge "walk" mode because I hate it.

1
uwadmin12OPCalo Nord•

Lol I don't blame you. Its pretty useless most of the time.

2