OctoberProject Movement Simplification
Posted by Jeff Disher
OctoberProject Movement Simplification
Due to the need for things like entity collision and projectile motion, I have been looking at the OP movement system, yet again.

I noticed that the current design is generally fine but the implementation is incredibly complicated, with lots of bizarre failure modes. Re-thinking this, I realized that there is actually a simpler way to approach this by just tracking the movement within a tick as a simple 2D vector as any Z-movement is described with special sub-actions or just rising/falling while moving in 2D.

This is requiring a pretty large re-work, but not a fundamental design change, and is mostly just changing some types in interfaces and small differences in expected test results (as this DOES change movement results - if only in small ways).

So far, this seems to be working and is far easier to understand, with only 1 simple movement failure case instead of the ~5 complicated failure cases in the previous iteration.

This does mean that the logic is changing, yet again, from "set location to X" to "adjust location by X", but I suspect that this is inevitable and results in a bunch of error cases being commuted into what should be considered understandable movement updates. The client still owns its own location, which is the crucial design aspect, but the displacement should reduce rubber-band stuttering in cases which should just be considered manageable.

This also required changing jump force and swimming behaviour slightly, but they seem to have a slightly better feel than what was there before. This change was forced since accumulation of velocity was moved from the end of the tick to the beginning, since that allows for handling of things like knockback coming from an external source.

For now, I am needing to avoid any kind of 2D inertia in movement, just because I am not sure how to make the drag and movement accumulation feel right but hopefully that can be fixed in such a way that projectiles move nicely but I have an idea for how to handle them, if this isn't something I can get working well.

Still a lot of work before the next release but at least this should be an improvement in general feel,
Jeff.