Marc ten Bosch has been working on 4D puzzle-platformer Miegakure (Hide and Reveal) for eight years now. Over that time, many have dared to describe how the game works after playing around with early builds, but it’s tricky to do well without an accompanying visual demonstration.
The issue is one of translation: the game’s four-dimensional world operates differently to the 3D world we understand and see with our eyes. It’s difficult enough to comprehend upon seeing it in action yourself - describing it to others with words just doesn’t cut it.
But ten Bosch has now done us all a huge favor by creating 4D Toys, currently available to buy for iOS and PC. It’s an “interactive toy” that allows us all to explore the types of four-dimensional spaces that Miegakure’s puzzle gardens inhabit.
Rather than a world with puzzles to solve, 4D Toys offers individually enclosed stages which, at first, house a single 4D shape to mess around with. You’re invited to throw the shape around, rotate it, see how it not only travels between the three dimensions we know (x, y, and z), but also the fourth (w).
As the artwork that accompanies 4D Toys suggests, the play experience evokes a toddler experimenting with putting 3D objects through different shaped holes, figuring out which ones match and which don’t. You are, essentially, learning the rules of a new world and how they interact.
With Miegakure unavailable to play at present, 4D Toys serves as something to point interested players towards, it helping to alleviate the heavy lifting that words previously had to do. But 4D Toys isn’t really intended as a gateway towards understanding the otherworldly dimensions of ten Bosch’s larger project.
In fact, a lot of the 4D physics that drives 4D Toys won’t even feature in Miegakure. “Some of it might be there for decoration, but it won’t affect gameplay in any major way,” ten Bosch says. So what is 4D Toys, then? Well, it actually started off as a joke.
Abacus from 4D Toys
"Near the beginning of Miegakure's development, someone joked I should make a 4D physics engine. Then a few years ago I had gathered enough knowledge that it was a possibility. So I made one for fun, and kept working on it on the side."
“Near the beginning of Miegakure's development, someone joked I should make a 4D physics engine,” writes ten Bosch on the 4D Toys website. “Then a few years ago I had gathered enough knowledge that it was a possibility. So I made one for fun, and kept working on it on the side.”
Please note that ten Bosch says he created a 4D physics engine “for fun.” That particular detail is very telling of his character. Bear that in mind while trying to make sense of what a 4D physics engine is and how it works. In explaining it, ten Bosch starts by outlining that the purpose of a 3D physics engine is to simulate how objects collide, bounce, and roll around similarly to how they do in reality.
“A physics engine works by storing the position/orientation and velocity/angular velocity of each object,” ten Bosch says. “Forces (such as gravity) and collisions change the velocities of the objects, and the positions evolve according to these velocities.”
The point is that 3D physics engines work the way they do because we write rules for them that reflect our 3D understanding of the world. There is no gravity in a 3D physics engine, but it can simulate the effect with the right line of code, which is a generalization of one of the physical laws that govern our universe. Ten Bosch merely expands on this by taking the same generalized laws and adding a fourth spatial dimension to them. He literally started out with a 3D physics engine and increased the number dimensions of the basic components by one.
“Basically this means the positions of each object uses four numbers instead of three,” he explains. “Forces such as gravity apply to all 4D space because they are defined as vectors of four numbers instead of three. The way we store orientation and angular velocity needs to change as well. Objects have a 3D surface instead of a 2D surface, etc…”
"I took a branch of mathematics called Geometric Algebra, which is very adapted to working independently of dimension but often isn't used that way."
While ten Bosch goes through the process of creating a 4D physics engine as if it were simple, to pull it off he had to invent the mathematics that make it work. This meant ensuring the numbers add up so that forces are four-dimensional vectors and objects rotate around planes rather than axes.
“I took a branch of mathematics called Geometric Algebra, which is very adapted to working independently of dimension but often isn't used that way for historic reasons, and applied it to the case of simulating rigid bodies that spin and bounce in n-dimensions (I defined the math for any number of dimensions but only implemented the 4D case),” he says. “For example I needed a way to compute how any specific nD object spins when you push on it along a specific direction in nD, as well as how it reacts to friction in nD, how objects collide in nD, etc…”
If all this is going over your head, don’t fret, as the whole point of 4D Toys is to help us engage with the mathematics behind it through a less intimidating interface. You don’t really need to know how it works unless you’re planning on building your own 4D physics engine. And even if you are then you might want to hold your horses, as ten Bosch might release his own one day: “I might do that a few years down the road,” he says. “It's difficult to give something to other people to use because it needs to handle many more cases than I personally need.”
Ballpit from 4D Toys
"I use a method that takes a slice of the object, sort of like the higher dimensional version of an MRI, since it results in 3D shapes instead of 2D slices."
More easily digested for now is ten Bosch’s thinking behind how 4D Toys is presented - simplifying 4D as a concept while also allowing for undirected play. It’s explained in the game that each 4D toy is displayed from a 3D perspective. What this means is we only get to see a cross-section of the fourth dimension at any one time.
As you move each shape around in their enclosed 4D space they might disappear from sight as they fall out of the 3D slice we are able to see. However, a slider on the side of the screen allows us to find the shape again, as it lets us move the slice around the 4D world.
The reason ten Bosch presents fourth-dimensional space through a 3D cross-section is simple: that is how we perceive the universe, it’s what we’re used to. But he adds to this that there are, in fact, different ways to present 4D space for a 3D perspective.
“For example I use a method that takes a slice of the object, sort of like the higher dimensional version of an MRI, since it results in 3D shapes instead of 2D slices,” he says. “Another method is to project objects down, like the way our eyes project a 3D scene into the 2D surface of our retina.
Slider from 4D Toys
“I think in order to have objects that feel physical and can be touched the slice method works better, because it makes clear what you can touch: it's whatever the 3D slice goes through and hence what you as a player can directly see," he adds. "The projection method is not as clear because things may be far away and you have to explain that somehow."
Ten Bosch notes that you could also display multiple 3D slices to try to see more of the 4D objects. "I might still do something like that but it feels more advanced," he says. "At first I wanted to have the simplest possible system that gets the job done. I think it's easier to understand that way. This is a rule I try to apply in game design as well.”
You can see how ten Bosch has applied this approach to 4D Toys as you work your way through its individual play spaces. At first you toy with a single tesseract - the 4D equivalent of the 2D square and the 3D cube - then you get multiple tesseracts to see how they collide and bounce off each other. Following that there’s the hypersphere - 4D’s version of the 2D circle and 3D sphere - and then the 5cell - which follows the 2D triangle and 3D tetrahedron.
Between introducing each of these, ten Bosch combines the 4D shapes in new arrangements to create spins on classic games, such as 4D bowling and 4D dominoes. He even throws loads of hyperspheres together in what he deems a 4D ball pit. From there, he ups the complexity with elaborate mathematical models - a 4D abacus and 4D hopf fibration, and beyond that he has us think what a 4D city might look like.
A tesseract from 4D Toys
Originally, he didn’t want to put any restrictions on how the 4D physics could be played with, and he also wanted to add specific goals to achieve within that freedom. But every time he tried he realized that the restrictions were crucial to making 4D Toys work.
“Physics engines can generate very different behaviors from situations that are very similar, and therefore it's hard to predict what is going to happen in advance. So unless you restrict the system in some way it's going to be difficult to make puzzles or have specific goals,” ten Bosch says.
“For example, Breath of the Wild has physics-based puzzles but the situations are always restricted to very simple and predictable cases, such as a sphere in a cubic maze. Or sometimes the complicated physics don't add anything, such as stacking a few boxes on top of each other: you don't want players to have to fiddle with the exact positions of the boxes for a long time to achieve what they are trying to do.”
Hypersphere from 4D Toys
If it wasn’t the unpredictability of the 4D physics that steered 4D Toys this way it was the fact that what would better explain these 4D spaces was a bigger game experience, and he’s already creating that with Miegakure. With 4D Toys, ten Bosch only flirts with game design that takes 4D physics and objects into consideration, but it’s in Miegakure that he realizes it more fully.
“I am most excited about Miegakure as an example of a game that is used to explore an interesting concept that has actual grounding and use in the real world (in this case math and physics) as opposed to whatever a game designer came up with, like which special attack this character does,” he says. “I think nature is a much better designer that I could ever be. I gave a few talks on this subject, such as this one in collaboration with Jonathan Blow.”
Dominoes from 4D Toys
We have longer to wait still in order to see how game design that takes 4D into consideration plays out. ten Bosch says Miegakure is “very far along” at this point, with all the level design done all that’s left is to polish the graphics and make it look pretty. “It’s a big game though,” he adds, meaning that these finishing touches could take a while yet. In the meantime, he will keep adding new toys and features to 4D Toys.