[Assertion] Fixing specific demorec crash on client.

Discussions about Coding and Scripting
Post Reply
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

[Assertion] Fixing specific demorec crash on client.

Post by Higor »

Guide on fixing undocumented problems in mod development.

Synthom:
- Start recording demo.
- Game crashes immediately or a few seconds later with the following message:
Critical: Assertion failed: Channel [File:C:\UTDev\Engine\Src\UnLevTic.cpp] [Line: 780]

Reason:
The client's local PlayerPawn has not had it's variable CurrentTimeStamp change over the last ~10 (guessed) seconds.
In default player pawns, ClientAdjustPosition() is the function responsible for changing this.
The demo recorder performs a sanity check to ensure the server has sent a signal to adjust the player's position, crashing the game if not.

Intended behaviour:
Case 1 - Player is supposed to disconnect from the server if connection has been fully interrupted.
Case 2 - Server is supposed to adjust the player's position via ClientAdjustPosition (for mod developers).

Solution:
Case 1 - Stop demo recording if the game lags and everything else freezes, or hit reconnect quickly.
Case 2 - Either alter CurrentTimeStamp manually on the client, or have the server call ClientAdjustPosition at least once every 2 seconds if you're altering the client's PlayerPawns.
Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

Re: [Assertion] Fixing specific demorec crash on client.

Post by Spectra »

Yes I had this same problem. The game crashes after 2-3 mins. In mine, even if the game doesn't lag, it crashes suddenly.
Thanks for this guide. But I am not getting the Case 2 solution. Can you elaborate more about it??
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: [Assertion] Fixing specific demorec crash on client.

Post by Higor »

Case 2 is for modders that edit the ways a PlayerPawn actor works.
I stumbled upon this by chance, on Case 2 nonetheless and was able to discover a workaround while working on the ExtendedClientMove plugin (seen on the Development server) which has the ability to stop all unnecesary server update on a player and enhance client position.

It could be possible to make a Mod Menu tool or something capable of auto-stopping a demo if the game is about to crash due to lack of server updates.
But it would be best if it was implemented into a popular mod like Pure or if said check was simply removed from the demorec Native code (will we ever have access to the code?).
UT99.org

Re: [Assertion] Fixing specific demorec crash on client.

Post by UT99.org »

billybill wrote:There is a fix in CSHP/Pure that sets the CurrentTimeStamp, I think it's locally only, for the playerpawn. There is note saying Epic requested it be put there. I thought it was to stop speedhacks?, does this fix what you are talking about?
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: [Assertion] Fixing specific demorec crash on client.

Post by Higor »

Facts:
- The sanity check is exactly as I described it, a sanity check with a side effect called 'appExit' aka graceful crash.
- CurrentTimeStamp is updated from server with the exception of NN and mods that make the player control other pawns.
- In theory, a player actor can go indefinetely without a position adjustment from the server, therefore, without a change in CurrentTimeStamp, as long as the replication system maintains a very precise series of updates from Client->Server and all position matches, it can happen that no positional correction is needed from the server at all in short intervals (3-10 seconds).
- Default netcode forces the server to update a client with 20000 netspeed 25*RealGameSpeed times a second, pretty much a waste of server (1.8 kbps/client) bandwidth and ape coding from Epic.
- What Pure did, was to reduce the allowed time discrepancies between clients and server from 3 to 0.5 second.
- Three of the main reasons behind small positional mismatches are: disparity in tickrates (client<->server), rounding of vector components to integers during replication, and that player exec functions (binds) may arrive to the other end in the wrong order.
- If somebody really wants to speedhack, said person will speedhack.

A workaround in my EXM (dev server beta plugin) was to force an update every 2 seconds, regardless of it being necessary or not, so players recording demos don't crash.
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: [Assertion] Fixing specific demorec crash on client.

Post by Higor »

Just a little note:

You can force a quick timeout by altering this in your UnrealTournament.ini (or it's homologous):
The default value is 15, changing it to lower than 8-10 will reliably disconnect your client before the crash timer is hit.

Code: Select all

[IpDrv.TCPNetDriver]
ConnectionTimeout=7.500000
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: [Assertion] Fixing specific demorec crash on client.

Post by sektor2111 »

Thank you - info acquired.
Post Reply