Library of Babel 3d (beta)
This topic contains 59 replies, has 3 voices, and was last updated by Keiwan 3 months ago.
November 1, 2015 at 10:55 pm #2973
I’m creating this thread for keiwan.November 2, 2015 at 5:29 am #2992
Hello Jonathan and everyone else interested in the Library of Babel,
I’m Keiwan, 18, from Germany and like many other people I first heard about the Library of Babel and this website from that Vsauce video. I was immediately amazed by the whole idea so I went ahead and read through Borges’ story and the Theory part of this website in order to try and fully understand how you managed to create that algorithm.
However, since you haven’t released any of the actual source code yet and the Theory pages were – while being really helpful for the general understanding – not detailed enough for me to be able to directly see what your algorithm is exactly doing (and I still don’t know).
So, because I couldn’t just read your algortihm and because I like programming I quickly set myself the goal of recreating a functioning version of the library. But I also didn’t just want to end up with some bad version of this website that has less features because that would not benefit anyone. This is why I developed the idea of turning the library into 3D.
I started working on this project about a month ago and I am now proud to say that the first beta with all of the major features working (not necessarily fast, but working :D) is finished and you can download it from the link I will provide at the bottom of this post.
The algorithm I came up with is probably just a „poor man’s version” of your algorithm, but I want to state that my focus was not on making a really good or even better algorithm (because I knew that you wanted to release the source code someday eventually) but coming up with an algorithm that at least works (creates every possible page and is invertible/ has a functioning search but does not create any duplicate books). My algorithm is also based on a linear congruential generator which ensures that all possible pages are created (each around 260 000 times) and its inverted function which makes the library searchable.
When I was searching the internet for information on how to implement said things I even came across some of your posts and questions on stackoverflow concerning the same topics and problems I was faced with – this proved to me that I was on the right track!
But let’s now talk about the actual library:
When you start the 3D Library of Babel you spawn in a random room. The library is setup in a way that it is (theoretically) possible to reach every hexagon and therefore every possible page just by walking around the library. When you are in a room you can select one of the four walls, then one of the shelves on that wall and at last one of the books on that shelf. Then you are presented with the first page of the book you chose. You can of course also choose to view another page by typing the number into the input field on the bottom left.
As I said you can also search for any text that is shorter than or equal to 3200 characters. You can open up the search menu by pressing „M“ on your keyboard. The search also gives you the possibility to search for a page with the exact match or a page full of random characters that contains your string of text (just like on this site).
When you have found the position of your text you can also klick on the „GO“ button below the hexagon number which transports you to the hexagon and automatically opens up the page you searched for.
The walls are numbered counter clockwise and the shelf numbers go from the bottom (1) to the top (5). The book numbers can be counted from left to right on each shelf. (I’ll probably add a label with the wall and shelf number as well)
While walking through the 3d Library of Babel you should please keep in mind that this is just a Beta version so there are a couple of bugs that you will probably encounter. If you do, I would really appreciate it if you could let me know so that we improve this library together! (e.g. the books don’t have titles yet; the text on the sides of the books says Booktext on all of them – I will add the book titles at some point but for now I wanted to get this beta out as quickly as possible)
Little TIPS for a better experience:
You will find that pages might take a lot more time to load some walls compared to others. This is due to the way the algorithm works – as I said it is not the best. For faster loading times I recommend only taking books from the first wall directly on the right of your direction of spawn.
You can narrow down the position of the page when you search for a text in the settings (access through the search menu) by setting the maximum Value for the Wall/Shelf/Book/Page to be searched in. This might seem hard to understand if you are not familiar with the algorithm but let me just formulate it in a general way: The lower those numbers are the faster the search will be, but you will also have less variety in terms of the page’s position where you found your text. (Important side note: Every page can still be found no matter what those numbers are and the position of each page is also not affected by those numbers)
You can quit the game by pressing cmd + q or by jumping off into the hole in the middle of the hexagons. You know what happens when you die in the library… 😉 (VERY important side note: DO NOT attempt to go to the floor below by jumping into the hole in the hexagons, this will „break“ the library. Just use the staircases like a normal human being 🙂
Run: (hold) SHIFT
Look Around: Mouse
Select Wall/Shelf/Book: Left Mouse Klick
Deselect Wall/Shelf/Book: BACKSPACE
Close Book/Menu: ESCAPE
Search Menu: M
Quit: either: (cmd + esc) or (cmd + q) or jump off into the hole in the center of the hexagons.
Thank you very much for taking your time and reading through this text and maybe even for trying out my 3D version of the library. I really hope you enjoy it!
KeiwanNovember 2, 2015 at 3:47 pm #3005
Thank you, Keiwan! I’m really looking forward to trying this out! And I will have code online in a couple of months that hopefully can be integrated with your version!November 2, 2015 at 4:42 pm #3010
THAT’S AWESOME! DEFINITELY GOING TO DOWNLOAD!November 3, 2015 at 12:25 pm #3047
Tried it. It broke a few times. I can jump into the abyss, and trying to climb up from the first floor teleports me down into a stairless pit. I have also managed to somehow select an “inbetween” book or something and the game froze. The light was coming up at an angle and it was a bit odd.
Other than that, I think it’s a really cool idea.November 3, 2015 at 2:42 pm #3051
My computer can’t handle this much punishment, but I’ve opened one page and it looks good.
Good job.November 3, 2015 at 3:19 pm #3053
Thanks to all of you for trying out the 3D library, i really appreciate it!
Danegraphics: That’s what I meant when I said don’t change floors by jumping off into the hole of a hexagon and landing in a room below. The game doesn’t recognize that you went into another level and therefore you won’t be able to properly walk back up again. If you use the staircase nothing like this should happen. Also I’m not sure if your game actually froze or if it was just generating a page (this can take very long depending on which wall you chose to pick a book from). The same thing applies to the search – it might take 20-30 seconds (sometimes) to find a text or load a page but that doesn’t mean that the game froze.
I have actually now updated the Mac version so that the wall numbers are on the floor in front of the shelves. If you pick books only from wall number 1 it should not take long for them to load.
And the fact that some lights are coming from a weird angle is a Unity bug which probably occurs because there are so many lights in each room.November 3, 2015 at 11:27 pm #3059
Awesome work! I think it would be helpful to have some sort of loading indicator through. It’s easy for the player to assume that they did something wrong, or that the game is broken if it’s not giving any sort of response. Also, the text on the left side of the book in the search options menu is cut off for some reason.November 4, 2015 at 3:00 pm #3072
Yes, I totally agree with on that point! I will definitely add some sort of an indication to make sure the user knows that the library hasn’t crashed in the next update.
I today released an update to the library which gives it a major performance boost in terms of lag while walking through the library. (Generating and finding pages didn’t get faster – only the graphics performance)
Also the settings menu bug should be fixed now.November 19, 2015 at 5:45 pm #3347
While the library looks amazing, There is a noticable lack of sound, Like maybe you could make me able to hear footsteps?
When i first loaded it, I tought the sound wasnt working.November 19, 2015 at 6:31 pm #3348
Actually there already are footstep sounds implemented, I just muted them because they got on my nerves while testing. I am going to add a sound option (and also a music option if I find something that fits the atmosphere of the library) to the settings.
However, I’m pretty busy with uni right now so I can’t really say when I’ll have the time to update the library.
Thank you very much for your feedback!November 22, 2015 at 11:53 am #3393
Just updated the library with a loading indicator, sound, music and small bugfixes. (Some bugs are still left because they are pretty complex and I didn’t have that much time to find solutions)
Hope you enjoy!November 22, 2015 at 6:23 pm #3394
Thank you again, Keiwan!November 25, 2015 at 11:15 am #3425
I know you said you would be releasing the code in a couple of months for everybody to understand and use but could you maybe send me the file containing the implementation of the algorithm via E-Mail so I could make the 3D library compatible with your website? You don’t need to clean up the code or document it or anything, since I would only need to change a couple of parameters around and add bit shifting to my code so that the pages would be generated in the same positions as in this website.
If there are any other reasons why you wouldn’t want to release any parts of the code yet except for providing a full documentation and clean code to future users, I can respect that decision and will wait until the open source version is released 🙂November 25, 2015 at 2:05 pm #3426
I really like this music. What is it?