I hope you liked this tutorial! If you want to see it in action, checkout my latest Dashpong devlog: kzbin.info/www/bejne/bKTIn5WYgticbq8
@DayMoniakkEdits Жыл бұрын
If you're using Godot 4 "Engine.iterations_per_second" is now "Engine.physics_ticks_per_second"
@ZNTHX Жыл бұрын
Thanks bro
@maurizio98108 ай бұрын
my man
@_gamma.2 жыл бұрын
Nice tutorial! I can also see how it would be useful with 4.0’s movie feature for recording replays, like Towerfall
@mrelipteach2 жыл бұрын
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...
@kevinbreen45102 жыл бұрын
Thanks for sharing! Looking forward to giving this a try in the future.
@mikielek86572 жыл бұрын
This was wonderful !! I will try it Also u had a really nice and fluent presentation style, keep it up!
@mrelipteach2 жыл бұрын
Glad you found it useful! Thanks a lot :)
@kotarou85302 жыл бұрын
thank you, helped me a lot :)
@mrelipteach2 жыл бұрын
Glad to hear that!
@hassangolshan3295 Жыл бұрын
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 Жыл бұрын
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.
@this-cris Жыл бұрын
I appreciate that you are responding to comments a year after the video was posted. I had the same question while watching.
@chaoscifer14832 жыл бұрын
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.
@mrelipteach2 жыл бұрын
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
@chaoscifer14832 жыл бұрын
@@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()
@mrelipteach2 жыл бұрын
@@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 Жыл бұрын
@@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.
@The_RevieW3471211 күн бұрын
thanks for tutorial
@christiankoch95162 жыл бұрын
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
@mrelipteach2 жыл бұрын
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
@christiankoch95162 жыл бұрын
@@mrelipteach Thanks for the reply, I will have a look once I get home from work, but it looks promising
@ro-ce8vg2 жыл бұрын
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
@mrelipteach2 жыл бұрын
You should optimize only if there's a need for it. In this case, I didn't see any performance hit.
@SnakeEngine Жыл бұрын
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 Жыл бұрын
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.
@GoggleMan16 ай бұрын
where is the code? 😭😭😭😭
@mrelipteach6 ай бұрын
In the 3.x branch on Github github.com/MrEliptik/godot_experiments/tree/3.x/2D/rewind_mechanic