4D Jenga by Tesseract
Remove pieces from a stack of hypercuboids until it falls over. Refresh the page to reset.
I did not implement a complete 4D physics engine. If you live in 4D-space, please do not assume that because a structure does not fall over according to my implementation, it will be stable if you build it.
| Link | https://github.com/penteract/penteract.github.io/tree/master/ld49 |
| Link | https://penteract.github.io/ld49/j4.html |
| Post-LD (shading + multiplayer) | https://penteract.github.io/postld49/j4.html |
| Original URL | https://ldjam.com/events/ludum-dare/49/4d-jenga |
Ratings
| Overall | 502th | 2.857⭐ | 23🧑⚖️ |
| Fun | 532th | 2.35⭐ | 22🧑⚖️ |
| Innovation | 16th | 4.238⭐ | 23🧑⚖️ |
| Theme | 95th | 4.095⭐ | 23🧑⚖️ |
| Graphics | 495th | 2.55⭐ | 22🧑⚖️ |
| Humor | 407th | 2⭐ | 17🧑⚖️ |
| Mood | 499th | 1.781⭐ | 18🧑⚖️ |
| Given | 24🗳️ | 8🗨️ |
- Find the boundary between layers where a layer rests on the one below (this is the 3D surface where they both have pieces).
- If the boundry is empty, the layer above isn't resting on anything, so it falls and give I an alert (the alert text may be wrong, now that I think about it).
- Otherwise, test whether the center of mass of the pieces above the boundary lies above the convex hull of the boundary.
- If the center of mass (projected down into 3d) is outside the convex hull, it falls and some triangle on the surface of the convex hull separates the convex hull from the center of mass - this defines a plane about which the pieces above can rotate (in 4d, things rotate about 2-dimensional planes, in the same way things rotate about 1d axes in 3d).
- I also assume that the tower can tilt a little, so if the center of mass is close enough to the convex hull of the boundary, it will fall.
Gf: I don't think that's how you play jenga.
Great concept, very mind-bending. After solving 3d tower on paper I managed to remove 2 tiles from each layer with some intuition on how to extend 2d case to the 3d case and I think this is the most pieces you can remove, but I don't really have a mathematical proof that this is optimal.