Commit Graph

166 Commits

Author SHA1 Message Date
Regalis
b24f0877a1 Fixed characters occasionally teleporting around at the clients' end after respawning. The position syncing logic assumed that all coordinates above the level are in sub-relative space, even though the world position of the respawn shuttle can also be above the level. 2017-04-17 17:56:17 +03:00
Regalis
f863eb331d Moved stun from AnimController to the character class, server notifies clients when the stun ends, husk infection included in character status messages 2017-04-07 19:56:25 +03:00
Regalis
77614dfa4e Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Source/Characters/Animation/Ragdoll.cs
2017-04-06 21:59:52 +03:00
Regalis
00b7193b6b Minor optimizations: GUITextBlocks don't reposition and wrap the text when only the position of the text block changes (almost killed my laptop by spamming a bit too many messages to the debug console), less unnecessary floor raycasts 2017-04-06 21:58:19 +03:00
Regalis
3246e2c521 Limb physics aren't disabled when a character is frozen (only collider physics) -> frozen characters can still take damage from weapons 2017-04-05 17:53:31 +03:00
Regalis
8215c4d91b MemStates without a timestamp are removed from a character when using timestamp-based interpolation (there may still be ID-based states with a timestamp of 0.0 in the buffer when switching to timestamp-based interpolation, for example when the controlled character dies)
+ vice versa when switching from timestamp-based to ID-based
2017-04-04 21:32:53 +03:00
Regalis
d4db37f8dd CPR syncing + some refactoring
Clients send an entityevent to the server when they start/stop doing CPR, and server includes the animation state in messages when character is dragging some other character
2017-03-22 20:05:50 +02:00
Regalis
823ad12058 Some refactoring: made PosInfo a class and moved character-specific fields to a "CharacterStateInfo" subclass 2017-03-21 19:36:28 +02:00
Regalis
2722d3cf8d Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Source/Events/MonsterEvent.cs
2017-03-21 18:16:25 +02:00
Regalis
cd0da235a2 Swimming anim fix: legs are forced back to their correct position if the thighs are bent too close to the torso (should fix characters swimming with their legs extended up over their shoulders) 2017-03-19 19:49:59 +02:00
Regalis
4285cdde27 ID of the entity a character is interacting with is also sent to the client controlling the character (should fix characters dragging someone at the server's end but not at the client's, or vice versa) 2017-03-15 23:07:33 +02:00
Regalis
5bdb57b98a Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Properties/AssemblyInfo.cs
	Subsurface/Source/Characters/AICharacter.cs
	Subsurface/Source/Characters/Animation/HumanoidAnimController.cs
	Subsurface/Source/Characters/Character.cs
	Subsurface/Source/GameMain.cs
	Subsurface/Source/Items/Components/Signal/Connection.cs
	Subsurface/Source/Items/Item.cs
	Subsurface/Source/Networking/GameServer.cs
	Subsurface/Source/Networking/GameServerLogin.cs
	Subsurface/Source/Physics/PhysicsBody.cs
2017-03-11 13:24:09 +02:00
Regalis
c9f09031de Re-enabled anchoring main limb to the collider when a remote player is unconscious (otherwise only the position of the collider will be synced, and the ragdoll won't follow it)
+ stunned characters can't send position updates
2017-02-25 18:06:43 +02:00
Regalis
bf3fa804df Fixed ragdolls accumulating a large movement value while being dragged (backported from commit a21d8d7) 2017-02-25 16:40:52 +02:00
Regalis
a21d8d7a53 Fixed ragdolls accumulating a large movement value while being dragged (line 902), causing them to launch off with a high velocity when they wake up
+ some cleanup
2017-02-25 14:25:21 +02:00
Regalis
68b0f2132a Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Source/Characters/AICharacter.cs
2017-02-17 19:31:25 +02:00
Regalis
a5e56f7d4d Hacky fix for monsters getting lodged inside the sub due to tunneling 2017-02-17 19:28:16 +02:00
Regalis
99cf438ed7 The lowest point of a character collider is calculated from its AABB (works correctly now even if the collider is rotated, allowing prone characters to be dragged through stairs), dragged characters collide with stairs when climbing up, the AI of unconscious or stunned characters isn't updated 2017-02-17 19:27:54 +02:00
Regalis
d46207916f Server doesn't send character position updates to far-away clients, clients disable characters if they haven't received position updates in a while 2017-02-07 18:59:25 +02:00
Regalis
b5bac67c4a WIP item position syncing 2017-02-02 20:40:58 +02:00
Regalis
39f977535d Fixed ragdolls colliding with stairs when swimming even if not steering upwards, AI steering fixes 2017-02-02 20:39:51 +02:00
juanjp600
cfeb720836 Fixed IsKeyHit (ladder climbing being inconsistent) + optimized interaction syncing
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.
2017-01-09 15:06:19 -03:00
juanjp600
073def094f Merge branch 'new-netcode' of https://gitlab.com/poe.regalis/barotrauma into new-netcode
# Conflicts:
#	Subsurface/Source/Characters/Character.cs
2017-01-08 12:30:56 -03:00
juanjp600
4b868fc09d Constant error correction + fixed standing catchup
With constant correction, there's little chance for a large difference to build up, so it becomes practically unnoticeable.
Also added a flag which stops the character from updating client-side until the server sends the spawning position.
2017-01-08 12:20:36 -03:00
Regalis
44cbd0d9bf Fixed AI characters constantly flipping over the X-axis when inside, fixed clients not receiving a msg about characters spawned by RespawnManager 2017-01-07 16:51:51 +02:00
juanjp600
7dc474dab4 Actually round movement.X down to zero
whoops
2017-01-06 16:05:23 -03:00
Regalis
65d64af041 Server reads CHARACTER_INPUT messages even if the client isn't allowed to move (but ignores the inputs), otherwise it would fail to read the rest of the packet 2017-01-06 18:19:51 +02:00
juanjp600
5b4d6120ff Merge branch 'new-netcode' of https://gitlab.com/poe.regalis/barotrauma into new-netcode 2017-01-05 22:37:45 -03:00
juanjp600
0569a665f4 Fixed a server-side off-by-one error in the player input IDs
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.
2017-01-05 22:37:14 -03:00
Regalis
518eea746e Transforming in-sub MemPos/MemLocalPos coordinates to outside coordinates if the character is outside and vice versa, server doesn't start sending ingame updates until they receive the first ingame update message from the client (no need to send updates while the client is loading or if they fail to start the round) 2017-01-05 18:16:58 +02:00
Regalis
7a40658fba derp 2017-01-04 20:46:51 +02:00
Regalis
bb685019a2 Fixes to unconscious character pos syncing:
- 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
2017-01-03 23:49:37 +02:00
Regalis
1fb15f5589 The collider position of the controlled character is synced with the same interpolation logic as the rest of the characters when unconscious/stunned (todo: make the ragdoll follow the collider even when unconscious/dead/stunned) 2017-01-02 22:40:00 +02:00
Regalis
c318e629ff Health, bleeding, oxygen & stun syncing, sending aim and use inputs and cursor positions to clients so other players will be able to see when someone is shooting, hitting with a wrench etc 2017-01-02 22:12:50 +02:00
Regalis
1f07b18e5b Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Properties/AssemblyInfo.cs
	Subsurface/Source/Items/Components/DockingPort.cs
	Subsurface/Source/Items/Components/Signal/Wire.cs
	Subsurface/Source/Items/Item.cs
2016-12-29 22:18:27 +02:00
Regalis
12b7290bad Fixed Ragdoll.HeadInWater not being set to true if the character is inside a water-filled hull but the head is outside the sub, HUDProgressBars aren't created when a non-controlled character repairs something 2016-12-28 20:00:40 +02:00
Regalis
49d4108eeb Fixed character colliders sinking/floating away when using a railgun controller underwater 2016-12-28 19:56:52 +02:00
Regalis
311f388358 Limbs with no sprite don't cause the game to crash anymore, lightsources attached to a limb are drawn at the interpolated position (= DrawPosition) of the limb, lightTexture origin is flipped on the X-axis when parent limb flips 2016-12-17 14:24:54 +02:00
Regalis
3eec463f5e Anim tweaking, simplified (+ non-broken) water drag logic 2016-12-09 15:02:48 +02:00
Regalis
d95acec6a2 v0.5.4.1 + regenerated waypoints in vanilla subs & FishAnim tweaking 2016-12-04 19:21:17 +02:00
Regalis
adde3461ea Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Properties/AssemblyInfo.cs
	Subsurface/Source/Characters/Animation/HumanoidAnimController.cs
	Subsurface/Source/Characters/Character.cs
	Subsurface/Source/Items/Components/Door.cs
	Subsurface/Source/Items/Components/Power/PowerContainer.cs
	Subsurface/Source/Items/Components/Signal/Wire.cs
	Subsurface/Source/Items/Item.cs
	Subsurface/Source/Networking/ChatMessage.cs
	Subsurface/Source/Networking/GameClient.cs
	Subsurface/Source/Networking/GameServer.cs
	Subsurface/Source/Networking/GameServerLogin.cs
	Subsurface/Source/Networking/GameServerSettings.cs
	Subsurface/Source/Networking/NetworkMember.cs
2016-11-24 19:52:40 +02:00
Regalis
9d1d64901a Pathfinding fixes:
- determining if a character is close enough to a waypoint works now, even if the character is too short for its collider to overlap with the wp (e.g. crawlers)
- enemies can drop down from platforms
- an extra waypoint is placed at the middle of stairs to prevent characters from choosing a waypoint on a platform above the stairs as the starting point of their path
2016-11-23 22:20:44 +02:00
juanjp600
7a3bce3973 Hull volume helper in editor + Character name matches client name + Better-looking Watcher light source
Also '' is a thing of the past, use \" instead
2016-11-20 18:47:22 -03:00
Regalis
6ca605aa57 Merge branch 'master' of https://gitlab.com/poe.regalis/barotrauma 2016-11-18 18:48:10 +02:00
Regalis
8c90fd1774 Doors push colliders away when closing, small human standing anim tweak 2016-11-18 18:47:58 +02:00
juanjp600
a4ebb116c0 Fixed falling damage 2016-11-17 15:35:15 -03:00
Regalis
a4f00310dc "Floor check" raycasts ignore platforms/stairs based on the bottom pos of the collider instead of the lowest limb, fixed IndoorsSteeringManager node diff checks 2016-11-17 20:00:03 +02:00
Regalis
089b0dbcee Water slows down players based on the depth of the water relative to the bottom of the collider 2016-11-17 19:16:30 +02:00
Regalis
bded421366 Added colliderHeightFromFloor to a few places I missed, some more human collider tweaking, correcting collider y position faster 2016-11-17 19:06:12 +02:00
Regalis
adece20072 Collider height from floor can be changed in the xml files, moved human collider a bit higher to allow climbing over roughly waist-high obstacles 2016-11-17 18:06:43 +02:00