Half Life 2 - Black Mesa Modification - Networking Part 3

Arne Olav Hallingstad
14th January 2009
Updated 14th January 2009
Home

Black Mesa is a mod that recreates the single player Half Life experience in the Half Life 2 source engine, with updated levels, textures, models, sounds and graphics. The gameplay experience is kept the same as much as possible. There will be support for co-op in Single Player, but there are several technical challenges that needs to be overcome before players can fully enjoy the co-op experience.

Goal

Find the cause for very jerky platform movement while the player is moving. This is the biggest issue since it is so irritating to co-op players. We'll have to find the cause for this and either fix the interpolation/reprediction/whatever or go the long route (and hopefully avoidable as a proper fix had I had the full source code would have been to fix framerate issue, interpolation issue, reprediction issue, timing issue as I suspect the problem is) and create a client entity for synchronization.

Either way, by the end of this article a fix will be found for func_mover, making it noticeably smoother on clients!

The Theory

The jerky movement happens even if the player is not on the platform which is puzzling, but makes me believe player reprediction kicks in only if the player position or view changes, and a timing issue makes the platform calculate the wrong interpolated position for itself during reprediction. It can seem the platform is extra jerky even if just moving the view, but hard to tell, noted.

Setting Up the Test Case

We're on the same map as in part 1 and 2, looking at the deterministic and linear movement of a func_movelinear on a client. Tests were run on an E6600 Core 2 DUO, 4GB memory and Nvidia 8800GT. Unfortunately there does not seem t be a way of running multiple instance of half life 2 as it's tied to the steam account. Therefore a client was simulated by running a game with the cvar maxplayers set to 2 which simulates a server/client. The player will standing on the platform, only being pushed by it. This avoids most player input affecting the result, and is consistently jerky if player is lagging.

graph over interolated platform position

x-axis:


y-axis:
blue line:

graph over player position

x-axis:


y-axis:
blue line:

graph over client fps

x-axis:


y-axis:
blue line:

graph over server fps

x-axis:


y-axis:
blue line:

Tweet

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.