No, I didn’t travel back in time to meet them, no real time machine here unfortunately but Yes, this is game development related of course :eyebrowlift2:
I was testing the idea of rewinding time, but in actual test I was just reanimating and placing them back in the recorded position some time before, however due to some discrepancy in the history frame and playback frame and add in my stupidity, my objects stutter and freezes and teleport… instead of moving smoothly to the interpolated position
Here is where Zeno came along with Achilles and Tor… nvm, problem was due to how I interpolate position each frame, in my head I kept thinking I should increment a frame counter each frame to indicate time passes and lerp the object position closer to the destination, everything sound right logically… except as time and frame increases my object is forever and ever fall behind…
pseudo only
if frame_counter< max_replay_frame:
frame_counter +=1
else:
frame_counter = 0 #division by 0 error not handled here
ratio = 1/frame_counter
obj.worldPosition = obj.worldPosition.lerp(destination,ratio)
I struggle with this for awhile but finally think about it, I will only reach my destination if the ratio is 1/1=1(100%), but if the frame_counter increases with time and the ratio goes 1/2=0.5(50%),1/60 =0.016(1.66%), I’ll only move slower and slower and only take infinitely smaller steps as infinitely more time passes if I hadn’t reset the frame_counter to 0 every time it reaches max_replay_frame
I have HEARD about this paradox from documentary and stuff but I never thought to SEE and EXPERIENCE them first hand with my own self, so today I finally ever so faintly grasp the wisdom from Zeno of Elea handed down millenniums ago… it is amazing :yes:
That’s all for today’s amazing encounter, who knows whom I’m gonna meet the next time I venture deeper in time lol
and the solution btw, is to deduct some max_frame with the increasing frame_counter and you should* have smooth interpolation between each frame, at least for me
ratio = 1/(max_Replay_Frame - frame_counter)
obj.worldPosition = obj.worldPosition.lerp(destination,ratio)