erikwatson / Bramble

A little JS game engine for jamming on prototypes.
MIT License
0 stars 1 forks source link

add a fixed time step option #26

Open erikwatson opened 3 years ago

erikwatson commented 3 years ago

plz

erikwatson commented 3 years ago

Okay, having dived into this for a while today I have some thoughts and reasons for putting it off until quite a bit later.

Fixing the time step itself isn't actually very difficult, but the problem comes when blending the previous game state with the current game state to remove the jitter from left over accumulated time.

In Bramble at the moment, there really isn't much of a concept of an Entity system or a Scene Graph or anything like that, and that's honestly one of the things I like about it. You just make your own things, update those things and draw those things yourself. Unfortunately, it seems this would mean that you would also need to store 2 copies of all your entities state and do the blend between them yourself when rendering.

Bramble could handle this if we had some kind of Scene & Entity system, where you must add Entities to the Scene yourself. It could keep track of all the entities in the scene and their previous states automatically. I think this is not only out of scope, but also is in quite bad taste.

I need to have a good think on this one.