Тёмный

TIME REWIND mechanic for every objects in Godot! 

MrElipteach
Подписаться 10 тыс.
Просмотров 7 тыс.
50% 1

I show you how to create a time rewind mechanic with Godot, working for whatever object type! Such a mechanic is seen in Prince of Persia, Braid or my own game Dashpong!
🎓 Learn how to make JUICY games 👇
www.udemy.com/course/learn-ho...
See the mechanic in action in my latest Dashpong devlog
👉 • Going BACK IN TIME? He...
🔗 Sources github.com/MrEliptik/godot_ex...
🔗 Player input method: • How to Make a Replay S...
🎮 GAMES
~~~~~~~~~~~~
🎮 Prince of Persia: Sand of time
🎮 Braid
🎮 Dashpong: s.team/a/1729250/
🎶 MUSIC
~~~~~~~~~~~~
🎵 HolzinaRAPS - Pastries behind the glass
🎵 Ketsa - Bring the swing
👤 SOCIALS
~~~~~~~~~~~~
💰 One time donation: ko-fi.com/mreliptik
💰 Support me on Patreon: / mreliptik
🟣 Join us on Discord: / discord
🔴 Twitch: / mreliptik
🐤 Twitter: / mreliptik
🎥 TikTok: / mreliptik
🖼️ Instagram: / mreliptik
🔗All links: bento.me/mreliptik
🔖 CHAPTERS
~~~~~~~~~~~~
00:00 - What we are going to do
00:36 - Other method
00:47 - My approach
01:13 - KinematicBody2D
03:45 - KinematicBody2D demo
04:06 - RigidBody2D
05:24 - Final demo
05:32 - Godot course discount!
05:43 - Outro👉

Игры

Опубликовано:

 

10 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 31   
@mrelipteach
@mrelipteach Год назад
I hope you liked this tutorial! If you want to see it in action, checkout my latest Dashpong devlog: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-6senbbMsi8M.html
@kevinbreen4510
@kevinbreen4510 Год назад
Thanks for sharing! Looking forward to giving this a try in the future.
@DayMoniakkEdits
@DayMoniakkEdits Год назад
If you're using Godot 4 "Engine.iterations_per_second" is now "Engine.physics_ticks_per_second"
@ZNTHX
@ZNTHX 10 месяцев назад
Thanks bro
@maurizio9810
@maurizio9810 3 месяца назад
my man
@mikielek8657
@mikielek8657 Год назад
This was wonderful !! I will try it Also u had a really nice and fluent presentation style, keep it up!
@mrelipteach
@mrelipteach Год назад
Glad you found it useful! Thanks a lot :)
@kotarou8530
@kotarou8530 Год назад
thank you, helped me a lot :)
@mrelipteach
@mrelipteach Год назад
Glad to hear that!
@_gamma.
@_gamma. Год назад
Nice tutorial! I can also see how it would be useful with 4.0’s movie feature for recording replays, like Towerfall
@mrelipteach
@mrelipteach Год назад
Yeah it could be a good solution to do offline replays saved as videos. I've tried to capture the viewport every frame to do video replay but unfortunately it's too slow for now, and it affects performance while in game...
@hassangolshan3295
@hassangolshan3295 7 месяцев назад
Hi, thanks for your tutorial. How do you think runtime-instantiated objects should get handled in time rewind? Same problem for runtime-destroyed objects. In your sample demo, all the objects are in the scene from the beginning to the end. What if there are many objects being instantiated/destroyed during the game (like bullets, particles, and so on)?
@mrelipteach
@mrelipteach 7 месяцев назад
I do exactly that in my game Dashpong as paddle are created by the players and destroyed after some time. These objects save their positon and rotation just like the others. To know when to create/destroy them during rewind/replay, you need to compare to a reference. For that, I save values in a global script and when it's time to rewind/replay, I compare the object's value count to this global count. If the object has less values, it means it has to be destroyed/created. To know if it's created or destroyed, I save a boolean for the fame of creation/destruction. You can probably find other ways to do it, like having a unique frame ID that is available globally so you can easily compare when objects are created/destroyed.
@thiscris-qj7ce
@thiscris-qj7ce 6 месяцев назад
I appreciate that you are responding to comments a year after the video was posted. I had the same question while watching.
@chaoscifer1483
@chaoscifer1483 Год назад
Very nice approach. Thank you. I think that we could have some issues if we use the same replay files across in different machines, since Godot's physics is not deterministic.
@mrelipteach
@mrelipteach Год назад
How would that be a problem? The idea with this technique is that you save all the values and move every object manually, deactivating physics and thus not being affected by the non determinisc nature of Godot's physics
@chaoscifer1483
@chaoscifer1483 Год назад
@@mrelipteach I believe (not affirming) that without a fixed point math for the amount that we're moving objects we'll have a high probability of generate slightly different floats in different hardwares and operational systems. edit here: I think that the probability is even bigger when we multiply floats and use deltatime within _process()
@mrelipteach
@mrelipteach Год назад
@@chaoscifer1483 It's possible yes but if you care about having exactly the same result, you should use fixed point. Most people won't care about that, because the potential difference is ultra tiny
@SnakeEngine
@SnakeEngine 9 месяцев назад
@@mrelipteach The difference can be life or death. The bullet either hits you or not in an edge case. I think you don't understand what an instable system is.
@christiankoch9516
@christiankoch9516 Год назад
Hello, I did something similar in Unity some time ago, but when trying to rewind Animations in Unity I realised that the Animator component of unity was not fit for this kind of implementation. I was wondering if you know if the Animation components of Godot are a bit more cooperative in resepect to rewinding animations (3D), particularly repeated rewinding while recording new data between rewinds. Unitys Animator simply deletes the old animator states once new data is stored
@mrelipteach
@mrelipteach Год назад
I don't know if this is exactly what you want but you can play any animation backwards using play_backwards() docs.godotengine.org/en/stable/classes/class_animationplayer.html#class-animationplayer-method-play-backwards
@christiankoch9516
@christiankoch9516 Год назад
@@mrelipteach Thanks for the reply, I will have a look once I get home from work, but it looks promising
@ro-ce8vg
@ro-ce8vg Год назад
I am new to Godot, but are you not preallocating the array of positions/vel/rotations? I would think that for multiple physics objects, preallocating the array could have serious performance implications. edit: realized that you still only have to allocate the array once regardless, so maybe not as important. i guess if i was concerned about performance, this would be a good place to use GDNative
@mrelipteach
@mrelipteach Год назад
You should optimize only if there's a need for it. In this case, I didn't see any performance hit.
@GoggleMan1
@GoggleMan1 12 дней назад
where is the code? 😭😭😭😭
@mrelipteach
@mrelipteach 10 дней назад
In the 3.x branch on Github github.com/MrEliptik/godot_experiments/tree/3.x/2D/rewind_mechanic
@GoggleMan1
@GoggleMan1 10 дней назад
@@mrelipteach thank you
@SnakeEngine
@SnakeEngine 9 месяцев назад
Yeah that's the easy part everyone knows about since you assume a static life-time of objects. But how would you handle a time rewind in a dynamic scene where objects get created and destroyed?
@mrelipteach
@mrelipteach 9 месяцев назад
It's a 6 mins tutorial, I can't go into great details. I've done a more complex implementation in my game Dashpong because it has to support dynamically created objects (paddles). The idea is to have something to comapre to, so I added a global rewind counter. Then it's about comparing the amount of values a paddle has in its rewind array and you know it needs to be created or deleted.
@vikramthewrench
@vikramthewrench Год назад
Engine.rewind(0.5,0,0)
@mrelipteach
@mrelipteach Год назад
That would be nice!
Далее
Stop "learning" gamedev right now
17:00
Просмотров 7 тыс.
10+2 AWESOME ADDONS for GODOT 4
8:36
Просмотров 128 тыс.
Хотите поиграть в такую?😄
00:16
Просмотров 189 тыс.
Make your games JUICIER with these 5 rules
10:45
Просмотров 7 тыс.
BETTER 2D visuals in 7 EASY TIPS
10:38
Просмотров 62 тыс.
GODOT TUTORIAL: Shockwave shader for noobs
15:48
Просмотров 49 тыс.
I recreated Balatro's effects in Godot
8:04
Просмотров 25 тыс.
Making a Jump You Can Actually Use In Godot
3:36
Просмотров 74 тыс.
How to Make a Good 2D Camera
11:38
Просмотров 390 тыс.
Optimizing my Game so it Runs on a Potato
19:02
Просмотров 472 тыс.
Godot Debugging Techniques EVERY Dev Should Know
16:23
NOT STOPPING TIL NEW WORLD RECORD
11:22:52
Просмотров 2,3 млн