If the floor in front of the character is higher than where the character is standing, the character slows down and lifts its feet more. The position of the feet is also clamped below the waist, preventing the character from doing a backwards somersault when running over "fake stairs".
Instead of sending over mouse position as two floats (8 bytes total), the game will send the aim angle represented as a short (0 to 65535, so it's fairly precise) and the selected item ID (up to 4 bytes total, 2 bytes if it's only one of the inputs).
The problem with IsKeyHit is that it checked when the player started a key press, when it should've been checking for the key being released.
I'm guessing this one comes from the player's position not being updated immediately after the input is processed, so that's where most of the remaining error came from.
Also added some rounding to the horizontal velocity when approaching 0, and changed something that depended on the head limb to use the collider instead, which should hopefully further reduce the chance of syncing errors.
- main limb is anchored to collider
- server ignores inputs from unconscious characters and doesn't freeze them
- using timestamp-based interpolation on the client's own character instead of IDs
The collider now levitates above the ground, which makes small obstacles a non-issue. The raytest also helps the collider stick to staircases, so players don't jump off anymore.
Crouching now changes the collider to a smaller version, so now there is actual functionality to crouching.
I also removed the anchor from corpses of network players. I'm not entirely sure why this was done, but removing it doesn't seem to break anything.
- can't climb over obstacles if the contact point is above the center of the character collider
- higher "obstacle climbing velocity"
- limiting collider velocity when dragging another character
- waypoints are created between docked subs and removed when they undock
- fixed start waypoint being left out of steering paths
- NPCs won't close doors/hatches on themselves
- NPCs won't let go of ladders until their feet are above the lower edge of the hull
- fixed FindDivingGear "loops": need to find a suit -> need to get to a suit -> need a suit to get to the suit -> need to find a suit...
- fixed characters constantly turning from side to side in small rooms
- recursive function for finding the button which opens a door (so a button doesn't have to be connected straight to a door for an NPC to be able to open it)
- AIObjectiveGetItem keeps searching for more suitable items even if a path to a matching item has been found
- characters can run while grabbing/dragging someone
- inventory and chatbox are hidden when stunned
- turret rotation is reset between minRotation and maxRotation when changing the rotation limits
- fixed explosion damage being applied to simPositions of the limbs instead of worldpositions
- characters aren't teleported outside until they're far enough from hulls (prevents them from "jumping" outside as they're teleported partially inside the body of the sub)
- arms are mirrored/flipped when turning in water
- bugfixes in HumanoidAnimController.Flip()
- item/itemcomponent statuseffects are stored in a dictionary with the actiontype as a key, so the item doesn't have to iterate over all the components and all their statuseffects
- gap bubble particle tweaking
- changes to the dying logic: characters will be unconscious when their health or oxygen goes below 0.0, and die when it drops to -100.0 (if either of the values is below zero, it will automatically decrease so the character will quickly die without medical care)
- fixed LightSprite being drawn on LightComponents even if the item is inside an inventory
- characters extend their arm more when placing signal items