Anyway, back to the game...
I've always found the concept of 4D space fascinating, and wanted to explore it in an interactive way. The only other games I could find that did this were simplistic browser applets or dry mathy concept demos. My driving goal for this is to make 4D accessible and, hopefully, fun. I myself have no idea how this game will eventually play or look like in full motion, but I REALLY want to find out.
I chose a simple ball-rolling gameplay mechanic because it's familiar, not too complicated, and puts the emphasis on deftly traversing the world. Even just visualizing 4D space is hard, to say nothing of navigating it, so I want that to be the primary focus of the game. Most of the player skill involved will likely be manipulating the 4D "camera" to obtain a desired 3D view of the world, enabling the player to roll their glome to the goal.
The 4D camera is confusing, so I'll try to clarify. In 3D space, we have the standard axes X, Y, and Z. a combination of distances along these axes can locate any point in 3D space. In 4D, we add an additional axis, W. Now to identify any point, we require a 4-element vector. These are thankfully provided by most 3D frameworks, thanks to the use of homogeneous coordinates in 3D rendering. That's where luck runs out though, as I had to write my own 5x5 matrix class to handle 4D transforms, as well as figure out how to do a 4D cross product, which was a bit of an adventure in itself.
When visualizing 4D objects, there are a number of approaches:
![](http://members.gamedev.net/JPatrick/visualizations.gif)
The first 2 techniques are analogous to the techniques used for 3D cameras to generate a 2D image. Perspective in particular is great for that because our brains are adapted to interpret perspective-projected 2D images into 3D information. However, this completely breaks down in 4D, since we can't rely on any kind of built-in neural circuitry to do it for us. For this reason, I've chosen to use simple cross-sections. This will allow the player to more easily interpret at least a portion of the game world, instead of being overwhelmed with trying to disentangle twice-projected objects.
Basically, the 4D camera is a 3D hyperplane (or realm) that bisects the 4D world. Where 4D objects intersect with this realm, they generate 3-Dimensional cross-sections (or slices as I refer to them in the code). Slices then populate a dynamically generated 3D scene that is presented to the player with a traditional perspective camera. Generating these slices was actually an interesting process that I'll detail later.
This basic foundation is already complete, and my test program can generate a sea of randomly generated sliced tesseracts:
![](http://members.gamedev.net/JPatrick/tesseracts.png)
I generate so many mainly as a performance indicator, especially for gauging performance on the 360, which as most XNA users can tell you, leaves a bit to be desired with regards to floating point. Even so, I think i managed to get decent numbers, and I'll discuss that later as well.
Still, just cross-sections won't be enough to communicate to the player information about the extra dimension. For this I will attempt to use other forms of feedback, both visual and otherwise. Another perk of the abstract marble roller gameplay concept is that I'm free to use things like the color and shading of an object to communicate information, rather than being constrained by trying to reproduce "real" objects. For example, the shaders I'm using for lighting actually compute 4D light. This means that if two surfaces appear parallel in the view realm, but are shaded differently, then they are sloped differently along the W axis. I plan to try and set traps for the player in this way, so that they have to be careful to observe the full nature of the objects they're rolling across. Another idea is to make the character "afraid of heights" so that the controller rumbles when the player gets close to an edge, extradimensional or otherwise.
So that's the general overview of what I'm doing. This first entry feels a bit scattered, cause I wasn't quite sure where to start, but I suppose that's the price for waiting so long. I have more specific topics in mind for future entries though, some of which might be useful to other XNA devs.