Commit Graph

62 Commits

Author SHA1 Message Date
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
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
3fcaff0288 Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Properties/AssemblyInfo.cs
2017-02-22 23:33:14 +02:00
Regalis
27e74490a0 New wire sprite and switched the body from circle to capsule, tweaked physicsbody position lerping logic (catches up with the server faster) 2017-02-22 22:02:33 +02:00
Regalis
52bf73722f ServerEntityEventManager doesn't process received events until the character inputs of the client for the corresponding frame have been processed (fixes character movement lagging behind EntityEvents at the servers side)
+ split character networking logic into a separate file, characters drop items at the position of their collider instead of hands
2017-02-09 23:09:42 +02:00
Regalis
1f16bef01c Interpolating item drawRotation in the "shortest direction" (prevents twitching if the rotation changes e.g. from -0.1f to PI*2), physicsbodies are lerped towards their targetposition at a constant speed 2017-02-09 00:01:01 +02:00
Regalis
462a8b5da8 Changed character update IDs from uint to ushort 2017-02-06 16:24:11 +02:00
Regalis
b5bac67c4a WIP item position syncing 2017-02-02 20:40:58 +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
beac45458e Transforming received in-sub mouse coordinates to outside coordinates if the character is outside and vice versa, HiddenSubPosition fix (can't use Level.Loaded to find the top of the level because the level isn't loaded yet) 2017-01-05 19:08:54 +02: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
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
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
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
3411448ae8 Submarine position syncing improvements 2016-12-10 19:53:35 +02:00
Regalis
3eec463f5e Anim tweaking, simplified (+ non-broken) water drag logic 2016-12-09 15:02:48 +02:00
Regalis
ac65a431a8 Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Properties/AssemblyInfo.cs
	Subsurface/Source/Items/Components/Signal/Wire.cs
	Subsurface/Source/Items/Item.cs
	Subsurface/Source/Items/ItemInventory.cs
	Subsurface/Source/Networking/GameServer.cs
2016-11-09 17:58:56 +02:00
Regalis
92985f3ed9 Position updates not sent for subs docked to the second main sub 2016-11-06 16:56:05 +02:00
juanjp600
35dafc4792 Merge remote-tracking branch 'barotrauma/master' into new-netcode
# Conflicts:
#	Subsurface/Source/Characters/Character.cs
#	Subsurface/Source/Items/Components/Machines/Steering.cs
#	Subsurface/Source/Map/Structure.cs
#	Subsurface/Source/Networking/GameClient.cs
#	Subsurface/Source/Networking/GameServer.cs
2016-11-05 18:09:44 -03:00
Regalis
48c07cfce5 - doors aren't ignored when checking visibility during waypoint generation or when finding a starting node for a path
- AICharacter will mark their path unreachable if their path is blocked by a door they cant open (may happen if someone closes the door after calculating the path)
- fixed exception when creating a Steering component when there's no active GameSession (i.e. in the editor)
2016-10-27 21:18:45 +03:00
Regalis
df9f89e383 Submarine position syncing 2016-10-25 20:50:47 +03:00
Regalis
62dd055e8d Merge branch 'master' into animcontroller-overhaul
Conflicts:
	Subsurface/Content/Characters/Crawler/crawler.xml
	Subsurface/Source/Characters/AICharacter.cs
	Subsurface/Source/Characters/Animation/FishAnimController.cs
	Subsurface/Source/Characters/Animation/Ragdoll.cs
	Subsurface/Source/Characters/Character.cs
	Subsurface/Source/Map/Submarine.cs
	Subsurface/Source/Map/SubmarineBody.cs
	Subsurface/Source/Networking/GameClient.cs
	Subsurface/Source/Networking/GameServer.cs
	Subsurface/Source/Physics/PhysicsBody.cs
2016-10-25 20:09:25 +03:00
Regalis
07f8c966ab Submarine position is synced using the same logic as the characters, AICharacter position syncing 2016-10-25 19:01:19 +03:00
Regalis
641e579e92 Backported animcontroller-overhaul 2016-10-22 15:18:16 +03:00
Regalis
e2d0e7fe24 Moved collider position correction logic to the physicsbody class (so that it can be used for sub & item syncing), character position msg length is written in bytes instead of bits, misc cleanup/refactoring 2016-10-19 20:49:18 +03:00
Regalis
b4389277aa Collider isn't moved to the position of the main limb when frozen, limb collisions are temporarily disabled if the ragdoll is too far from the collider, some cleanup 2016-10-19 16:21:54 +03:00
Regalis
0cafc674dd - projectiles don't stick to colliders
- fixed impacts weaker than the damage threshold giving characters health
- possible to slide down ladders
- improved IndoorsSteeringManager ladder climbing logic
2016-10-17 17:41:41 +03:00
Regalis
704c7c7561 Collider-controlled monster movement 2016-10-16 22:24:33 +03:00
Regalis
f3e74a6a41 Collider-controlled swimming, fixes 2016-10-16 20:07:34 +03:00
Regalis
db8c2b9f8e Changed colliders from limbs to normal physics bodies, removed RefLimb 2016-10-15 20:08:51 +03:00
Regalis
62c88be214 Controlling humanoid movement with one capsule-shaped physics body that other limbs (attempt to) follow
Broken and WIP
2016-10-14 00:13:19 +03:00
Regalis
ffc6782025 Removed fixed timestep logic from GameScreen (redundant now because the logic is handled in GameMain) 2016-10-04 19:54:17 +03:00
Regalis
050f7ffc83 Removed fixed timestep logic from GameScreen (redundant now because the logic is handled in GameMain) 2016-10-04 19:21:05 +03:00
juanjp600
f6b82eb095 Some progress on flipping subs
Press crouch to flip every sub in the map, texture alignment breaks and physics items vanish, but other than that it's working.
2016-09-29 22:20:15 -03:00
juanjp600
edab86f730 Character freezing + Misc fixes 2016-09-21 16:46:12 -03:00
juanjp600
af220dbc2a Removed Fill/ReadNetworkData
These functions needed to be replaced because they rely heavily on reliability.

Instead, new functions called (Write/Read)Data(Server/Client) will be added. 

Separating client and server code into completely separate functions will help ensure that proper security checks are performed.
2016-08-29 20:02:46 -03:00
juanjp600
73fc0cf724 More security checks
This actually looks pretty bad, not gonna lie.
2016-08-28 19:54:31 -03:00
Regalis
7c8e866030 Fixed the door collision bug at docking ports 2016-08-16 20:21:33 +03:00
Regalis
34c6569313 Server can inflict impact damage on clients, character oxygen level syncing bugfix, hulls send a networkevent when oxygen level changes by >=5%, limb velocities aren't reset when receiving a network update 2016-06-29 17:26:26 +03:00
Regalis
a477dad1b2 Renamed the CollisionMisc collision category to CollisionItem, teleporting items inside/outside the sub if their physicsbody leaves/enters a hull, powercontainer charge can be changed in editor (i.e. batteries can be set to fully loaded) 2016-05-19 19:47:26 +03:00
Regalis
c08029dea8 Handheld sonars only consume batteries when they're on, endworms aren't "flipped" when they turn around, every limb is checked in SubmarineBody.DisplaceCharacters (instead of just reflimb) 2016-04-24 20:31:26 +03:00
Regalis
5120812adf - fixed AICharacters being updated even if they're disabled
- enemies can spot targets from further away if they've previously spotted the target
- physics bodies are immediately moved to the correct position if they're really far (instead of lerping)
2016-03-13 19:24:30 +02:00
Regalis
a1c728d207 Networking bugfixes & improvements:
- fixed server not sending kill-events when a monster dies
- some interpolation when correcting character positions
- physicsbody position lerping improvements
- sending AICharacter Dir instead of TargetDir
2016-03-09 16:56:42 +02:00
Regalis
10bb5d061f - WIP attempt at syncing item positions
- Some changes to item floating logic (lift is also applied to items outside the sub, forcefactor is clamped to 1 if the item is fully submerged)
2016-03-07 00:57:15 +02:00
Regalis
cd4e3a3d2a Fixed password box not working, connecting powered items with multiple parallel wires works, velocity/depth indicators on nav, stuff 2016-02-18 21:09:10 +02:00
Regalis11
064e2eadd0 Round end cinematic, CoroutineManager deltatime 2015-12-26 19:33:23 +02:00
Regalis
4234aa2094 END WORM, fixed camera pos "twitching" when exiting/entering the sub, character scaling 2015-12-19 02:05:10 +02:00
Regalis
af470eab2e more accurate submarine body generation, multiplayer fixes, saving takes HiddenSubPosition into account, fire coordinate fixes, editscreen fixes, checking item triggers in AIObjectiveGoto, netlobbyscreen sync fixes, re-enabled level start/end positions, water edit fixed 2015-12-17 18:26:40 +02:00