Interpolated Frame Number

Interpolated Frame Number

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Interpolated Frame Number

Post by KDR_11k »

For some continuous animations in Lua it'd be helpful to get the frame number as a float with the current prediction distance added in (so if the currently visible state is interpolated half-way between frame 34 and 35 the result would be 34.5 instead of the 34 GetGameFrame would deliver). Obviously only in unsynced but would help greatly with smoothing stuff out. Maybe also gave a callout to get a unit's currently predicted position for effects that are attached to the units and shouldn't lag behind just to snap to the next position at every frame change?
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Interpolated Frame Number

Post by aegis »

can't you do this roughly with lua already? time the last frame or last X frames, use it as a rough frame time, then don't literally sync with the actual frames so there's no snapping... just average it out so it smoothly stays close to the actual frame.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Interpolated Frame Number

Post by jK »

http://springrts.com/wiki/Lua_UnsyncedRead#Time
what do you think Spring.GetFrameTimeOffset() is doing?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Interpolated Frame Number

Post by KDR_11k »

I assume it does what the topic is about since otherwise you wouldn't post it here but I wouldn't have known otherwise.
Post Reply

Return to “Feature Requests”