Recreating Genshin's Rigged Dice Roll in Unity (Deterministic Dice)

  Рет қаралды 5,354

ReForge Mode - Unity Tutorials

ReForge Mode - Unity Tutorials

Күн бұрын

Пікірлер: 48
@ReForgeMode
@ReForgeMode Жыл бұрын
Wanna watch this episode earlier? Head over to my Patreon page! www.patreon.com/posts/78779407 This is really my biggest project so far in this channel. It took about two weeks to get it to work in Unity and another two for editing and publishing. I hope you guys enjoy it!
@Juslin7989
@Juslin7989 Жыл бұрын
Very nice video. GITCG server approved
@ReForgeMode
@ReForgeMode Жыл бұрын
Haha. Thank you! 😄😄
@MountainisFullofDragons
@MountainisFullofDragons 7 ай бұрын
thank you. this is literally what ive been searching. it took me over 3 hours to find your vid that solved the exact mechanic for dice that im looking for
@ReForgeMode
@ReForgeMode 7 ай бұрын
Happy to help! I've always wanted to make videos like these! 😄😄
@MountainisFullofDragons
@MountainisFullofDragons 7 ай бұрын
@@ReForgeMode how did you get the dice to appear from offscreen to on screen? Did you place dice above the main camera?
@ReForgeMode
@ReForgeMode 7 ай бұрын
@@MountainisFullofDragons Right, so the Camera is looking directly at the "table" down below. Because the camera field of vision forms a cone, some dice may look to go offscreen as it falls down. I did share this project publicly on Github if you want to check out the full setup. Link is in the description.
@MountainisFullofDragons
@MountainisFullofDragons 7 ай бұрын
@@ReForgeMode ah i see, thank you. i think im just gonna move my dice higher up, but everything else has been done the way i wanted it. The important part was rigging the dice for some scripted events I was attempting to do. thanks again man!
@ReForgeMode
@ReForgeMode 7 ай бұрын
@@MountainisFullofDragons No problem! 😄😄
@yugiohk574
@yugiohk574 Жыл бұрын
I took another approach that for my game was easier (also didn't know about the physics simulation but anyway...) The dice is thrown with random forces and rotation, but I dont use any kind of physics detection of which face landed or something like that, instead I lerp between the current rotation to the desired face rotation very quickly, as in my game the dice just bounces of the walls in a high speed, you can barely notice that the dice sometimes rotates backwards and it works just fine haha
@ReForgeMode
@ReForgeMode Жыл бұрын
Hmmm, very interesting! I wonder if there is some degree of uncertainty when the game lags a bit though... I will try to test it myself when I have the time.
@Ferenc-Racz
@Ferenc-Racz Жыл бұрын
Finally a dev who really understand the game dev, not just know the framework. :) Subscribed now. :) Thank you for the video.
@ReForgeMode
@ReForgeMode Жыл бұрын
Haha, thank you! 😄😄
@ngefy
@ngefy Жыл бұрын
Great video! Really useful information.
@ReForgeMode
@ReForgeMode Жыл бұрын
Thank you! Glad I could help!
@nancywinner
@nancywinner Жыл бұрын
Some artifacts (specifically the full set elementals) also guarantee dice rolls. I've gotten full hydro dice rolls with that & jade chamber. I always wondered how it guarentees a roll despite the actual roll looking random, so thanks!
@ReForgeMode
@ReForgeMode Жыл бұрын
Oh yeah! I forgot the artifacts because I rarely played artifacts, haha 😄😄
@Nikinuito
@Nikinuito Жыл бұрын
Amazing tutorial, well explained, entertaining and easy to follow.
@ReForgeMode
@ReForgeMode Жыл бұрын
Thank you so much 😄😄
@ArksideGames
@ArksideGames 28 күн бұрын
🤯🤯Incredible, Subbed
@ReForgeMode
@ReForgeMode 26 күн бұрын
Thank you for the kind words!
@tianqigao869
@tianqigao869 Жыл бұрын
awesome tutorial! you are so smart!
@ReForgeMode
@ReForgeMode Жыл бұрын
Thank you! Cheers!
@sirixb
@sirixb Жыл бұрын
Amaizing video thanks!
@ReForgeMode
@ReForgeMode Жыл бұрын
Thank you! Glad I could help!
@sbu102
@sbu102 8 ай бұрын
Great video, thanks
@ReForgeMode
@ReForgeMode 8 ай бұрын
Glad you like it! 😄😄
@iiropeltonen
@iiropeltonen Жыл бұрын
Great technique!
@ReForgeMode
@ReForgeMode Жыл бұрын
Haha, thanks ☺️
@ArielekGames
@ArielekGames Жыл бұрын
The new ECS physics in Unity are actually deterministic and you could use them for this case 😉 Note: Just not cross platform deterministic, it will yield different results depending on the target platform thanks to inconsistent hardware float implementation (ex. two x64 computers will have identical results with the same setup, but they will be different from the same simulation on android, ios or even web).
@ReForgeMode
@ReForgeMode Жыл бұрын
Oof, I haven't learned ECS yet 😂😂 I am actually waiting for them to complete it first. Who knows when they'll remake it again hehe~ But good to know for future projects
@catpyjamas
@catpyjamas 2 ай бұрын
My question is, how do you know when you have multiple dice? For instance, I have 3 dice. But then I have 4 dice. Four will be different, because they will bump into each other more. Does that mean I have to have separate sets of scriptable object recordings for each potential number of dice?
@ReForgeMode
@ReForgeMode 2 ай бұрын
No, it doesn't matter how many dice you throw because it's always the same two dice throw simulation. If they do bounce, they will always bounce the second time. You will only need to adjust the Scriptable Object if you're using a different-sided dice.
@danielebassano7635
@danielebassano7635 Жыл бұрын
Hi, any ideas where can I find the from-to rotation matrix for a 10 sided dice?
@ReForgeMode
@ReForgeMode Жыл бұрын
Well, I mostly write the six sided dice manually without any calculation. I just rotate the dice and find the rotation after for every face.
@danielebassano7635
@danielebassano7635 Жыл бұрын
@@ReForgeMode Thank you very much, I think I'll do the same.
@ReForgeMode
@ReForgeMode Жыл бұрын
Good luck! Do share your project if you finished it! I would like to see what you make of it! ☺️☺️
@Digildon
@Digildon 9 ай бұрын
Cool
@kureysalp
@kureysalp Жыл бұрын
Only Physics2D have simulationMode. How did you use it?
@ReForgeMode
@ReForgeMode Жыл бұрын
No, 3D rigidbody also has Physics.Simulate and Physics.SimulationMode. For the implementation, check out my github repo in the description of the video!
@kureysalp
@kureysalp Жыл бұрын
@@ReForgeMode I got it now, I am using 2021.3 so only Physics2D have that. For who are using 2021.3, you can disable auto simulation, apply force and torque, get the result, rotate the dice, enable auto simulation and apply same force again.
@ReForgeMode
@ReForgeMode Жыл бұрын
@@kureysalp Oh, so it's a new addition? Great! Never used Simulate before, so this news to me. Glad you managed to get it working!
@sirixb
@sirixb Жыл бұрын
@@kureysalp Hi could you help me to achieve this? in Unity 2021.3
@barangursoy5660
@barangursoy5660 6 ай бұрын
I did the same logic for a 6 sided dice, but whenever in the rotation matrix there is a 270 degrees on X axis, it just gives a wrong rotation result and I don't get the result I want, is this related to gimbal lock, or am I doing something wrong? Thank you for your help and the video!
@barangursoy5660
@barangursoy5660 6 ай бұрын
Normally, from 4 to 1 it should be (270, 0, 0) in (x,y,z) format right? But it doesn't work, when I tried (90,90,90) for no reason, it worked and I'm always getting 1 whenever the simulation result is 4, how is this working, I'm really confused, why 270,0,0 didn't work?
@ReForgeMode
@ReForgeMode 6 ай бұрын
Hmmm... Assuming 1 is at the top, I think a rotation in X means you are rotating the dice upside down, so it's either 3, 1, 4, 6, depending on your dice layout. I'm not sure why it doesn't work, though. It should give the same result if you enter the value into the ScriptableObject. I think I would try to check the dice layout first, and then try to see if the rotation should be -180 < x < 180. So instead of 270, you can just use -90.
@barangursoy5660
@barangursoy5660 6 ай бұрын
@@ReForgeMode Thank you for your response, -90 didn't work as well but I solved it, I'm writing this so if anyone else faces with the same problem, here is my not so well thought 😅solution: I removed the whole rotation matrix, my dice had 2 on the top as default, and rotation from 2 to all other faces were correct, I solved my problem by this logic: whenever a face other than 2 came, I first rotate them to 2 (default rotation of my dice) then rotate it again with only default rotation's rotation matrix to other numbers, it works perfectly, thank you so much for your quick response and your brilliant solution + video 🤗
@ReForgeMode
@ReForgeMode 6 ай бұрын
@@barangursoy5660 Glad you figure it out! Let me know if you need any other help! 😄😄
FREE Lipsync plugin that EVERYONE should use!
16:23
ReForge Mode - Unity Tutorials
Рет қаралды 10 М.
How to OPTIMIZE VRoid Model PROPERLY (with proper data!)
7:48
ReForge Mode - Unity Tutorials
Рет қаралды 6 М.
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
FREE Lipsync Tools for Unity! - UniLipSync
6:36
ReForge Mode - Unity Tutorials
Рет қаралды 12 М.
10 Things You NEED to Be Doing in Unity
11:40
Tarodev
Рет қаралды 137 М.
SHE BASICALLY SAID “HE IS MINE“ 😭
5:14
Jimmy Chen Gaming
Рет қаралды 28 М.
Generating A Hex Map With Fog Of War in Unity
20:27
Game Dev Guide
Рет қаралды 55 М.
Create Baldur's Gate Style Dice in Unity
19:02
git-amend
Рет қаралды 6 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,6 МЛН
Is it time to leave Unity game engine?
14:37
ReForge Mode - Unity Tutorials
Рет қаралды 4,3 М.
This FREE Hana Tool Alternative is Getting an Upgrade! (NEB 2.0)
5:43
ReForge Mode - Unity Tutorials
Рет қаралды 3,7 М.