Problem Statement
RenIK needs to be updated
- Will be replaced by EWBIK eventually
- Jankiness at low speeds
- Requires a lot of syncing to look good
- If we lerp too often then sliding and stuff occurs
- If we compute locally, then everyone is out of sync
- This is a problem because jankiness is magnified when it only happens on one person's screen. At least when everyone sees it, you can all laugh at it together.
- Difficult to configure
- Lots of dials to make transition from walking to running smooth, but humans don't have a smooth transition - We change our gait pretty drastically when we hit a certain speed
Solution
New Semi-Deterministic Walk Cycle System
Six states:
- Full Body
- Regular updates
- New feet transforms
- Lerp between updates
- Standing still
- Perform foot placement just like we were doing in RenIK
- Updates only when foot moves
- New feet transforms
- Lerp to new updates as they are received
- Jumping/Falling
- Feet dangle loosely behind avatar
- No syncing required
- Laying down
- Feet play a laying down animation
- No syncing required
- Walking
- Updates sent whenever direction or speed changes
- Starting feet transforms
- Starting player velocity (Already being synced)
- Current player transform (Already being synced)
- Current player velocity (Already being synced)
- Feet transforms are calculated locally between updates
- Updates are only sent when direction or velocity changes drastically or when state changes
- Running
- When the player is moving so fast that avoiding foot sliding is impossible
- Updates sent whenever direciton or speed changes
- Only current velocity
- Feet just do a run cycle with no consideration to shape of terrain since it's now impossible to keep feet planted
We transition smoothly between different states and allow for some overlap between the states to prevent jankiness caused by changing states too fast - i.e. players have to be moving 5% over the speed limit between walking and running to transition to running and 5% below the limit to transition back.
Update messages
- Current State
- Feet transforms
- Can be read as starting feet transforms or current feet transforms depending on the state
Update messages have an expiration time. If no new update comes in before the expiration time, then the current state and feet transforms can be updated by the local client
- Some states like jumping will have a short expiration time. Some like walking and running will have long expiration times. Fullbody will have no expiration time.
- When someone jumps, and lands, because the jump update will have expired, the local client can place feet on the frame where the player lands without having to wait for an update to tell them to.
- When the network is congested, we can forgo sending feet updates, and local clients will take over in all cases except where the player was using fullbody
Walk Cycle