Cube Royale is now a 4D game

Started by Legend, Apr 01, 2018, 02:19 PM

previous topic - next topic

0 Members and 1 Guest are viewing this topic.

Legend

Apr 01, 2018, 02:19 PM Last Edit: Apr 01, 2018, 02:22 PM by Legend
If you somehow missed my A 4D video game? thread then you probably need some backstory. A bit over a month ago I started thinking about how true 4D video games are possible since computers work the same regardless of the dimension they simulate. I've had the general idea for years but playing the prototype was truly world changing. Like I can literally think in 4 dimensions now because I've experienced it first hand.

I went back and forth on what would be the best way to turn the prototype into a full game and realised VizionEck Cube Royale and 4D was a match made in heaven. For starters the game is mostly finished so converting it to 4D would be much faster than starting development on a new game. Also VizionEck's geometry is a perfect fit for higher dimensions.


I mentioned this in the previous thread, but you just can't imagine how "voluminous" 4D space is. A sphere in a 3D game might take around 360 triangles to look smooth, but a 4D sphere would take around 3,370 4D triangles to look smooth. Computers are just not strong enough to render detailed 4D environments with triangles.

VizionEck Cube Royale is not made of triangles, it's made of cubes. By building a custom 4D rendering engine around the hypercube, VizionEck Cube Royale actually runs faster in 4D than it did in 3D. It's essentially a voxel engine now, similar to minecraft, but with 4D blocks.


Gameplay wise it's really really perfect too! Cube Royale uses target lock on instead of FPS controls, so this means that in 4D the player doesn't have to focus on camera controls. Again I mentioned this in the previous thread but rotations in 4D are crazy complex. In 2D games you can only rotate with one degree of freedom and in 3D games you can rotate with 3 degrees of freedom, but in 4D games you can rotate with 6 degrees of freedom. I mapped all these rotations to my keyboard for the prototype but it's overly complex and mapping it to the DS4 would be a nightmare. Thus 4D games shouldn't let you control the camera and Cube Royale doesn't let you control the camera so it worked perfectly.

The shields in Cube Royale are also pretty interesting. In the old 3D version you could only make 4 shield panels, while now you can make 6. This is because you have left, right, forward, backward, ana, and kata directions. Essentially you're vulnerable from more directions and defense becomes a lot more interesting.


Converting VizionEck Cube Royale to 4D was actually surprisingly easy. Since the cubes don't rotate I didn't have to deal with any 4D rotations and the rest was as easy as redefining the position variables as "Vector4" instead of "Vector3." (Technically the Unity Vector4 class is missing some Vector3 features so I needed to add them but that wasn't much work).

The graphics were/are the hardest part. As I said I switched the game from rasterization rendering to voxel rendering. Since it's my own custom engine now it's more or less "programmer art" at this stage but here is a screenshot to just give you a basic understanding of what it's like to see the game in 4D.



The flat outlines on the old cubes are now 3D outlines on hypercubes. This image shows one player directly in front of the camera and another off to the left kata side farther back. Visually it looks like that second player is farther away in the image but they are actually smaller too. This is a 2D picture of a 3D picture of a 4D world. Here is a cross eyed 3D version of the images to show you depth:





The grid like lines you see in the image are the grid like texture from the old 3D version. Yes with a 4D game, textures are 3D. The player cubes are solid black and obscure this grid because they are closer to the 4D camera. That is why the grid appears to stop in advance of hitting the white shapes in the 3D image. The grid has a different taper depending on where you look because there are multiple 4D walls visible in the screenshot. Parts with the grid more condensed are farther away from the 4D camera.

Lightning is currently not setup. I switched to a voxel engine which works great for hypercubes but less great for anything else. I might cheat and draw the lightning directly onto the 2D TV and not have it be true 4D bolts. Essentially lightning would be handled with a 3D texture just like how the vast majority of games handle lightning with a 2D texture. I'm still undecided.


Currently I'm not planning on supporting any 3D version of Cube Royale. I had to hack up a lot of code to make the switch to 4D and getting both to run within the same game would be a huge undertaking, delaying the game even further. Also as I learned with Cube Royale and Adventure, it's crucial to have the game feel like a synergetic whole. Having the 3D version would just distract from the 4D version.


I've joked that I should rename it to VizionEck Hypercube Royale but the logo is already finished and editing it would be a pain.

SWORDF1SH

I was believing this until I read "the game is mostly finished".

Legend

I was believing this until I read "the game is mostly finished".

Haha I really am making it 4D.

the-pi-guy