ARG:Brain Drain: Difference between revisions

From Heartbound Wiki
w>Hirace
(Adding categories)
 
m (1 revision imported: Importing ARG pages)
 

Latest revision as of 14:52, 5 October 2024

This page contains spoilers about the Heartbound ARG. If you want to solve the puzzle yourself, avoid reading this article.

Brain Drain is the first puzzle of Chapter 6 of the ARG and was found by solving Another Place. That led us to the page https://www.gopiratesoftware.com/games/Heartbound/CORE_DUMP/. The page has that name because we have dumped OScar's core to here.

The source code of the page has these comments:

<!-- Chapter 6 - Brain Drain -->

<!-- ++++++++++[>+>+++>+++++++>++++++++++<<<<-]>>>++++++.>+++++++++++..----.<<++.>>++++++++++++.---------------.-------.+++++++++++++++++++.<<.>>+++++.----------.++++++.<<+++++++.>>+.-----------------.<<-------.>>-.+++++++++++.-.---------.<<.>>+++++++++++++++.-----.<<.>>--.--------.<<++++++++++++++.<++++++++++.>>>------------.++++++++++++++++++++++.++++++.<<-------.>>+.-----------------.<<-------.>>++.++++++++.-.---------.<<.>>+++++++++++++++.-----..<<.>>---------.-----.+++++++++++++++++.<<.>>++.------------.+.++++++++++.<<.>>+.-----------.++++.--------.<<++++++++++++++.<++++++++++.++++++++++.>>---.<--------------.>>++++++++++++++++++.--------.-.<<+++++++.>>++++++.<<-------.>>--------.-------.+++++++++++++++.<<.>>+++++.----------.++++++.<<.>>-------------.+++++++++++++.---.++.<<.>>------------.+.++++.<<.>>------------.++++++.------.++++++++.+++++.<<++++++++++++++.<++++++++++.>>++++++++++++++++.>+.++++++.<<--------------.>++++++++++.--.>-------.<<.>>---.--.+++..<<.>>+.<++++.<.>++++.---.<.>>++++++++++++.<+++++++++.>----.<<.>---.---.++.------.<++++++++++++++.<++++++++++.++++++++++.>+++++++++++++++++++++++++++.>>-.<<<++++++++++++++++++++++.>>>+++.--------.-.<<<+++++++.>>>++++++.<<<++++++++++++++++++++++++++++++++.>>--.+++++.-------.>------.<++++++.--.<<++++++++++++++++++++++++++++++++.>>----.>.+++++++++++.-----.<+++++++.+.+++++.-------.<<++++++++++++++.++++++++++.>>--------------.>-----.++++++.<<<+++++++++++++++++++++++++++++.>>>+.<++++++++++++.<<++++++++++++++++++++++++++++++++.>>----.>----------.++++++.<++++.----.+++.>+++++++.<<<++++++++++++++++++++++++++++++++.>>++.-----.++++++++.+++.-------.-.<<++++++++++++++.++++++++++.++++++++++.>++++.--------.++++++++.++.+++.+++++++.>-----.<------------------------.+++++++++++.++++.--------.-------. -->

We have some data written only using the characters:

+ - < > [ ] .

How to interpret the data

The chapter's title, Brain Drain, is a hint to the name of the language used to write the data: Brainfuck, which is an esoteric programming language. Esoteric languages (or esolangs, for short) are intentionally designed to be weird rather than functional, normally they are intended to be "joke" programming languages. Brainfuck is one of the most famous esolangs.

This language was first developed by Urban Müller back in 1993, with the goal of having the smallest possible compiler for it. Brainfuck is a tape-based programming language, which basically means that it works with a one-dimensional array of data. That is a table with just a single row and an arbitrary number of columns. The columns are numbered from zero and each cell begins with the value of zero:

cell number: 0 1 2 3 4 5 6 7 8 9 10 11 12
value: 0 0 0 0 0 0 0 0 0 0 0 0 0

Brainfuck always beging at Cell #0, and then it moves from cell to cell (the current position is called "pointer"). The value of the cell is increased or decreased, and its value can be outputted as text. In order to convert a number to text, it is used an ASCII table, which is a list of which number corresponds to which character. These are all Brainfuck commands and what they do (the colored cell background represents the current pointer's position):

Command Function
> Move pointer to the next cell
< Move pointer to the previous cell
+ Increse the value of the current cell by one
- Decrease the value of the current cell by one
[ Jump to the next ] if the value of the current cell is zero
] Jump to the previous [, if the value of the current cell IS NOT zero
. Output the value from the current cell as an ASCII character
, Input the value of an ASCII character into the cell

If that looks like an over-complicated way to output a text, that is because it actually is. This is an esoteric language, after all, that is exactly the idea.

Outputting the text

We are going to show here the first few steps of the code interpretation, so the idea behind can get clear. Doing everything would get too long and repetitive, but we are going to give the full result later. This is how we interpret the Brainfuck code of our puzzle:

Command Explanation Cell value Output
++++++++++ Icrease value of the current cell by 10 (now Cell #0 = 10) 10 0 0 0 0
[ Jump to the next ] command if the value of the current cell (Cell #0) is zero 10 0 0 0 0
> Move to the next cell (Cell #1) 10 0 0 0 0
+ Increase value of the cell by 1 10 1 0 0 0
> Move to the next cell (Cell #2) 10 1 0 0 0
+++ Increase its value by 3 10 1 3 0 0
> Move to the next cell (Cell #3) 10 1 3 0 0
+++++++ Increase its value by 7 10 1 3 7 0
> Move to the next cell (Cell #4) 10 1 3 7 0
++++++++++ Increase its value by 10 10 1 3 7 10
<<<< Move back by 4 cells (returns to Cell #0) 10 1 3 7 10
- Decrease its value by 1 (now Cell #0 = 9) 9 1 3 7 10
] Jump to the previous [ command if the value of the current cell is not zero 9 1 3 7 10
This creates a loop of 10 cycles, repeating the previous operations on the corresponding cells. At the end of the loop the values of the first four cells should be: Cell = {0; 10; 30; 70; 100} and the pointer at Cell #0. 0 10 30 70 100
>>> Move right by 3 cells (Cell #3) 0 10 30 70 100
++++++ Increase its value by 6 0 10 30 76 100
. Output the ASCII character corresponding to the value on the current cell (76 = L) 0 10 30 76 100 L
> Move right by 1 cell (Cell #4) 0 10 30 76 100
+++++++++++ Increase its value by 11 0 10 30 76 111
.. Output its corresponding ASCII character twice (111 = o) 0 10 30 76 111 oo
---- Decrease its value by 4 0 10 30 76 107
. Output its ASCII character (107 = k) 0 10 30 76 107 k
<< Move left by 2 cells (Cell #2) 0 10 30 76 107
++ Increase its value by 2 0 10 32 76 107
. Output its ASCII character (32 = blank space) 0 10 32 76 107 (space)
And so on... From there, it is quite straightfoward: move the pointer to a cell, change its value, output the corresponding character from the ASCII table.

The most complicated part is the loop at the beginning, made by the commands [ and ]. Technically it would be possible to just set the cells to their intended values, however, the loop saves a lot of commands. Cell #0 was used only to keep track of how many times the initial loop needed to run. The Cells #1 to #4 are initially set to {10; 30; 70; 100} because those values are close to specific ASCII ranges:

  • 70 and 100 are respectively uppercase and lowercase characters.
  • 30 is close to blank space (ASCII = 32) and punctuation.
  • 10 is close to control characters (notably the line feed, ASCII = 10, which is used to designate a line break).

It is possible to use an online Brainfuck interpreter to quickly output the entire text. While it is true that we could just have linked an interpreter from the beginning and went with it, we decided that it would add more value to the explanation to actually show what is going behind the scenes with the solution, rather than just throwing the solution and not telling how one arrives at it.

After we interpret the entire code we have, we obtain the following text output:

Look what you've done to me.�You've gone too far this time.�(I won't let you hurt him again.2You can kill me if you like.<FIt\wonctƒchange£anything±»YouØveøalready�failed&0:MEMORY_ALPHA

Notice that there are some characters that the browser cannot display, those characters are intentional. Back on the previous step, we dumped OScar's core, and he does not seem to be happy with it. Those "glitched" characters mean that OScar is glitching and angry. At the end of his words, we get a clue: MEMORY_ALPHA. That is the next page where we need to go: https://www.gopiratesoftware.com/games/Heartbound/CORE_DUMP/MEMORY_ALPHA/.

This leads us to the next step of the ARG: Forest Through The Trees.