Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+1)

Awesome game! Congratulations on featuring in the video.

If I may ask, how did you figure out which number should be/was at the bottom depending on the die's rotation? I wanted to do that but gave up halfway through. Dealing with rotations makes me want to tear my hair out.

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.

(+1)

Woah, talk about a quick reply! However, I meant more in the technical sense. There's got to be a way to write a function that takes the die's global rotation and spits out which number is at the bottom, but I couldn't for the life of me write it.

(1 edit)

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.

(+1)

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!

I answered in the comment above: https://itch.io/post/6346372

(1 edit) (+1)

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

(+1)

Thanks, that was quite informative.