What does it actually look like to pilot a ship and dodge attacks in a 4-dimensional world?
I built Fourworld.js, a zero-dependency 4D Game Engine from scratch that renders real-time 3D cross-sections of 4D spaces, along with HYPERION 4D, a playable 4D space shooter built on top of it. Instead of faking 4D effects with shaders, every mesh, rotation, physics calculation, and movement is computed in true 4D space (X, Y, Z, W).
๐ฎ Play Live Demo in Browser (No Install)
๐ Play Now: https://korokorokun2006-web.github.io/4D-GameEngine-Fourworld.js/
(Shift along the 4th dimension W-axis to dodge incoming enemy attacks that are impossible to avoid in 3D!)
๐ฅ Gameplay & Code Links
YouTube Video: https://youtu.be/xWTLS6cz6TA
GitHub Repository: https://github.com/korokorokun2006-web/4D-GameEngine-Fourworld.js
๐ง How It Works
Fourworld.js computes geometry, rotations via 6-plane 4D matrices and double-quaternions, real-time hyperplane slicing, and 4D physics (such as 4D OBB SAT collisions) directly in true 4D space (X, Y, Z, W) using pure JavaScript and native WebGL 1.0/2.0 without any external dependencies.
๐ Try It & Feedback
The browser game and MIT-licensed source code are available online. Stars and feedback on GitHub are appreciated to support further development.
Top comments (1)
Thanks for checking out Fourworld.js! ๐
If you want to jump straight into the live browser demo (HYPERION 4D), you can play it right here without installing anything:
๐korokorokun2006-web.github.io/4D-G...
Quick tip: Use the mouse wheel (or R / F keys) to shift along the 4th dimension (W-axis) when enemy attacks look unavoidable in 3D spaceโyou will literally step around them in 4D!
For fellow graphics and engine devs: the trickiest part was building a Zero-GC real-time hyperplane slicer and 4D OBB SAT collision detection in pure JavaScript without any external math libraries.
If you have any questions about the 4D math (SO(4) double-quaternions, hyperplane slicing) or ideas for 4D gameplay mechanics, drop a comment belowโI'd love to discuss! ๐