Hacker News new | ask | show | jobs
by metadept 4314 days ago
I was really hoping for a continuous (rather than discrete) fourth dimension. The concept is cool and looks to be well executed, but it's not very different from other alternate reality implementations such as the Dark World in Legend of Zelda.
4 comments

That would be really cool. The mathematics involved don't seem too difficult; you have to add another axis to your vectors, points, and transform matrices, and you can place and orient your models in 4D space, set up lights and a camera in 4D space, and project the camera's view into 3D space first then onto the 2D display. I think the hard part is creating the models and writing the rendering engine. Creating 4D models, rather than just putting 3D models into 4D space, would be hard to wrap your head around. And the tools, both for world creation and for rendering, are almost certainly limited to 3D so you'd have to write your own tools for everything. No more GPU acceleration, unless your 4D to 3D transformation creates models and textures on-the-fly to pass to the GPU.
This is something I've been working on as a side-project on and off for a while. It's complicated by the fact that every existing engine is built around the assumption that you only want to use 3 dimensions, not four, and not arbitrarily many, so I've been pretty much writing everything from scratch (and very limited GPU acceleration, as you said, because GPUs also assume 2 or 3D). So far, I'm punting on model building by just auto-generating 4D mazes with hypercubical cells, because maze-generation algorithms work in arbitrary dimensions.

For simplicity, my rendering engine is a dead-simple raytracer which doesn't even bother with reflections- just cast rays and record the first surface they run into. Handling rotations and projections is really easy, but there are two problems I have found:

1. It's just really frickin' slow. Raytracing just ain't fast enough, though I may be able to find some additional optimizations to make it better.

2. In terms of gameplay, navigating the space is really, really hard. It is so easy to get completely lost regarding which direction you're facing and what hyperplane you're on when you can make arbitrary rotations in all four dimensions. It might be something I could get used to, but so far I feel like it's practically necessary to have some mechanism that will snap you back into alignment with some set of gridlines.

One possible way of getting around that, stolen from machine learning, is to use colors to represent the fourth dimension, ie, make things darker (or change the hue/saturation) that are bigger in the fourth axis, and vice versa for smaller.
I would just avoid the rotation issue. Time works as a 4th dimension so if you have a charter that can flow backward or forward in time you can 'solve' 4d mazes without major issues. From a game-play perspective plenty of games have you vary limited control over time but you could make some vary interesting puzzles with full control.

EX: walls in the way. <Set bomb off> Walls gone but cave collapses. <walk though wall> <go back in time> <keep walking>.

Or simply let you flip times direction. Going vary slow or backward prevents changing things, but you get to move. So, you might be able to for example walk on water when moving backward in time etc.

That's pretty much the idea of Braid, an awesome indie game. It uses time manipulation in different ways to create mechanics in that vein. Recommended.

It's a different concept than true 4D though.

There are some simple games like that. 4d mazes, 4d tetris, 4d pong, etc. The problem is it's pretty impossible for people to wrap their mind around it, and it doesn't project very well on 2d screens. Research has shown that people don't get better at it with practice either.
I'm going to google around for this, but do you have any links to the research off hand? I'd be interested in seeing it.

My favorite 2048 variation was the 4D version. It was trippy but I felt like I got my head around that. I think it was because the game rules were so simple that instead of trying to visualize what was going on, my brain just accepted the patterns.

We already have 4-dimensional models; we just keep the 4th dimension separate and call it an animation path. In fact, Skyrim has 5-dimensional models: there are two versions of each walking animation, roughly "feminine" and "masculine," but each character actually uses a specific blend-point between the two. Similar analogies with facegen textures. All the pieces are there, they just need to be glued together right.
Can you clarify why having two animation paths makes 5 dimensions? Surely the dimension is time, you're just deforming the 3 spatial dimensions along two different paths as you progress uniformly along the 4th?
You could probably make something like Minecraft but out of hypercubes and besides turning in three dimensions you can also reorient your three dimensional subspace in the four dimensional world. As you mentioned, the interesting question is how you model objects - are our usual three dimensional things thin sheets in the fourth dimensions or do they have some interesting structure.
I believe there are some good libraries out there for handling quaternions. Can't remember the topic but there was a discussion here within the last 10 days about their application to a similar problem.
What would the 4th dimension coordinate of your models even represent, though? I'm having trouble wrapping my head around it.
It's naturally confusing, because a 4th spatial dimension isn't something we naturally experience. We can't really say what it represents because it's not real... it's not a model of reality.

We see in 2 dimensions and we infer the third from various cues. (The quote that we are "dimly aware of a fourth", which you may have heard, refers to time and is a different issue than a fourth spatial dimension.)

We have three dimensions, all orthogonal to each other. We can translate, rotate, and project things in between them.

So all we can do is apply those same principles and see what comes out - we shouldn't expect it to match anything recognizeable though.

Mathematically, they're identical to any other dimension. You can move a little bit into a fourth dimension just like moving a little bit left-to-right. Or you can rotate things around the fourth axis just like turning something clockwise. In the case of this game, he only shows a 2D projection of a 3D cross-section of a 4D world, so that might be adding to the confusion. What you see in the video is only 3D "slices" of a 4D object rotating.
One of the axes introduced by the fourth dimension. There are 3 in 3D, 6 in 4D. XYZ space has axes perpenicular to the planes xy, xz, yz. WXYZ space has axes perpendicular to the planes xy, xz, xw, yz, yw, zw.
No. There are only 4 axes in 4-dimensional space - every point is described as a 4d vector, i.e scalar positions along each axis: (x,y,z,w).

xy, xz, etc. are not planes in 4d space - they are 3d-hyperplanes, and perpendicular to them are planes, not axes. Imagine this: you have a 4d vector and you hold x and y constant. You still have 2 degrees of freedom: a plane, not a line.

Would something like an Oculus Rift VR help reduce the number of projections from being "4D->2D" to be "4D->3D"?
No, Oculus Rift's screens are still 2D surfaces.
Sure, but at least you get stereo vision and headtracking that makes it less obvious you're just looking at a flat screen showing a mono projection?
The game is actually completely continuous. The crazy deforming shape at the beginning of the trailer is a 3D slice of an object called a 120-Cell, which is a true 4D shape.
Isn't that addressed in the additional notes below the video?

    There are **infinitely** many 3D worlds stacked on top of 
    each other, even if in the Wall level the ground texture 
    makes it seem like there are only two.
Adanaxis is an open source space shooter game that lets you move in all 4 axis, or rotate continuously along any combination of axis. All models are 4 dimensional.

Needless to say, it is confusing to the point of unplayability past a certain point, but utterly fascinating.

You can grab a copy from your Ubuntu, Fedora, or Arch repos, and it is certainly worth trying to wrap your head around for an hour or two, if you are into that sort of thing.

Had a blast with this thanks to your recommendation!