I mainly studied the rotation of the die when it moved around in a small space e.g. in a 2x2 or 2x3 circle, and then tried to design puzzles around those ideas. When designing the puzzles, I also tried to make the way to obtain the numbers non-obvious but also extremely simple, based on the ideas I had studied previously, and made the grids small so the player could only move around in those small spaces, guiding them towards the eventual solution.
I basically stored 6 numbers in an array, one corresponding to each colour, and each position in the array corresponding to a face, and whenever the player moved I modified the elements of the array such that they reflected the new rotation. I don't know if this is the best way to do it, but that is what I went with during the jam. Then to find out what number to print, just access the number at the position in the array corresponding to the bottom face.
Now that I think of it, I think it might be possible to get the rotation of the cube as a quaternion, and check against a list of rotations to see which face is face down, but that's just an idea, not sure whether it would work.
Thank you! I thought of a similar system, but then I got side-tracked when I realized the face-down number could have 4 different rotations depending on the cube's state (0 degrees, 90, 180, and 270), and that led to the project's doom. In hindsight, I should've gone for the simple implementation for the jam and then expanded it if necessary.
Anyway, thanks for your time, and once more, good job on the jam!
It would work. I implemented dice rotation and face identification with Unity quaternions. The only characteristic each number (1-6) has is it's side normal. No tricky unwrapping and no careful permutation consideration necessary.
When I want to get a face A (e.g. face (0, -1, 0)), I [temp-]rotate all normals with the current quaternion, dot product all with a A and look which one equals 1