In which Weather Factory invents the 3rd Dimension
Hi all! This is Hannah, Weather Factory’s resident UI focused Unity developer, here to give you some fresh info on the freshest BOOK OF HOURS tech out of Weather Factory’s R&D department. This post is gonna be about some of the technical “how does this actually work” of our current prototype.
A whole new dimension?!
The more astute of you may have noticed our universe recently turned 3D. Incredible! This is because, to deliver a truly authentic book based experience, we’ve invented a third dimension. You’re all very welcome.
While Cultist Simulator looked kinda 3D, with cards visibly moving higher when you picked them up, the entire game happened on the top of a table. It’s a distinctly flat, two dimensional table; you can move cards up and down, or left and right on it. You can’t move up and down on the table, and the cards are all infinitely thin, and therefore likely to give you papercuts.
BOOK OF HOURS has had a third dimension since square one, but mechanically, you could make the case it’s actually still 2D. Or rather, it’s a bunch of 2D interfaces, scattered around a 3D world.
Not too dissimilar from how some early 3D games such as DOOM didn’t have 3D models for enemies – rather it had a bunch of 2D sprites, scattered around a 3D world. DOOM is still flat pixel art, much like Megaman games, but you’d be hard pressed to describe it as a 2D game.
Consider the occult desk where everything happens in Cultist. In BOOK OF HOURS, we retain the desk, but we add special sideways desks (or “shelves”, as I’m told they’re called). But really, when you break it down, we have a whole load of desks, only some of them have different rules as to how you can stack items on them.
On Her Majesty’s Secret Surface
All these desk variations are internally known as “Surfaces”. A surface is defined as “a thing you can put other things on”, and has some basic behaviour around this, such as detecting where on the Surface the mouse is pointing, or stopping you from placing items off the edge of the Surface. Whenever you’re holding a Book or Card, the game will detect which Surface you’re probably trying to put it on, and will let the Surface decide where upon it your item goes – or if that item is even allowed on.
Tables and Shelves are both special kinds of Surface (and actually, right now the basic unmodified Surface isn’t used anywhere in the game). Tables are Surfaces that snap items to a grid. They let you stack Items on top of any other items already on the Table. When you grab an Item off the Table, the Table will check if that Item is lying under any other Items, and if so, make the upper Item drop down, and the removed Item does a jolly little swish to the side to escape.
Shelves are another variation of Surfaces. They forbid you from placing anything but Books upon them (for now). They tell Books to spin around when on a shelf, so their pages can face the wall. They tell Books to lean on each other, and when placed together they should part the existing books like they were an old powerful man and the other books were a salty body of water.
But again, these two dimensional shelves and tables exist in a three dimensional world. And how do you get from one to another? I quite like the tactile feel of dragging the table around in Cultist Simulator, and I kinda wanted to make it so if you dragged your way off the edge of the Table, you found yourself facing the Shelves, but there’s a slight problem with that.
How do you drag a book to a Shelf, while also dragging your way off the Table? This is a messy question, where the correct answer so far has been “give up and make the camera side scroll instead”. So now you can side scroll off the edge of the table, and in front of a bookshelf. From the shelves, you can side scroll back to your table, over to the otherside, and face a bunch of shelves.
This is a highly technical diagram showing how the camera works. Basically, think of the camera as sitting on a Minecraft minecart. Moving your mouse to the edge of the screen pushes the cart in that direction. At the edge of your table is an upward slope – if you climb it a bit and give up, your camera snaps back to the edge of the table. If you go far enough, you fall back down on the other side, facing the shelves.
Gee Fuchsia! How Come Your Mom Lets You Have Two Bookshelves?
The camera system as it stands actually stems from a visit to a lovely library in Oxford that both myself and Alexis had the absolute pleasure of visiting: the Old Merton. Anyone who’s been seeing the gifs I sporadically post to Twitter may be used to the bookshelf being right in front of the table, with both visible at the same time. But it turns out that’s not how bookshelves tend to coexist with desks. It took a trip to the Merton for me to notice the shelves in my own room were actually not right in front of me. In front of me is where I put my window, in a feeble attempt to get some Vitamin D.
Given what real actual legit libraries do, it seemed only fair to bring that real legitness to BOOK OF HOURS. Alexis and I agreed that “two shelves is better than one”, which in turn spawned the camera system as it stands, which in itself drove me to start thinking of the game as “a bunch of 2D tables in a 3D world”. Which in turn has highlighted that I’ve told you this entire story backwards.
It’s an… uhm… narrative trick thing.
“2D thing in a 3D world” has shown itself to be a repeated theme in all kinds of decisions I’ve had to go through for BOOK OF HOURS. It’s even managed to squeeze its way into discussions around shaders and art direction, but that’s straying into territories I’d rather cover in another post.
3 comments on In which Weather Factory invents the 3rd Dimension
I don’t trust you or your creepy newfangled third dimension, stay away from me and my children.
Even though moving your mouse to screen regions to switch surfaces feels natural, please be sure to add quick-switch hotkeys for advanced players!
Drag based element-switching is nice but it quickly slows down seasoned players from manipulating game objects.
A good example is mouse-wheel vs. number keys in games like Half Life. Players start playing with scrolling through their item list but quickly learn to jump to what they need.