Hacker News new | ask | show | jobs
by gliese1337 4314 days ago
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.

2 comments

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.