benreid24 / BLIB

Small organized collection of common code I have accumulated over the years that has amassed into a proper 2d game engine
1 stars 0 forks source link

Implement time scaling and interpolation at the engine level #165

Closed benreid24 closed 10 months ago

benreid24 commented 1 year ago

Pass lag time to system update. Time scale factor to apply on times passed down, engine should still track real time. May be nice to pass the real time down to systems as well.

Also implement velocity components and systems to interpolate positions before rendering.

Velocities and positions should be parent-able. It may make sense to use a centralized system to manage parenting as it is starting to apply in many places (renderer overlays, transforms, velocities, etc). Dirty state should be an integer revision id to allow arbitrary refresh order of child/parent while ensuring all get properly updated in a single pass. Probably would be helpful to split local/global transform and velocity as each would be required depending on the use.

May also be nice to introduce a new RenderTransform component to enable interpolation for rendering.