• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

PC Dynamic weapon content loading more than necessary

Pharrahnox

Grizzled Veteran
Feb 3, 2016
268
71
Cranny mate
This will not follow a bug template. It is not necessarily a bug, the logic flow is native so this is merely my assumptions and discussion of a potential bugged system.

Hitching occurs when players buy weapons from the trader or players spawn in. This is often hidden by being in the trader menu at the time of hitching. For mods where players can use the trader mid-wave this is a real issue - especially for servers on HDDs as opposed to SSDs. Players can desync for seconds at a time.

I tried pre-loading all weapon content using the following:
Spoiler!
Which I can only assume 'works' as it takes 3 seconds to complete on my HDD server. Unfortunately, the hitching persisted. So I logged occurrences of KFPlayerController.TriggerWeaponContentLoad and KFPlayerController.OnWeaponAsyncContentLoaded, where the former calls the latter, and the latter is apparently "called when content is done loading via TriggerAsyncContentLoad". Thus, any such logged event signifies weapon content being loaded. Note the expensive loops in OnWeaponAsyncLoaded:
Spoiler!
Even if TriggerAsyncContentLoad being called multiple times for the same weapon (which it is) doesn't result in the actual content being loaded from the disk multiple times, these loops will run each time. I believe this should only ever need to happen once per weapon.

The logs show that these two functions are executed each time a weapon is given to the player. That is, when a player buys or picks up a weapon. This happens quite often. Multiple weapons are given when a player (re)spawns, hence the hitching at the start of trader time.

The hitching is for the most part barely noticeable if the game and server are both on SSDs. But many community-hosted servers are not on high-end machines. Perhaps the system is working as intended. I would like to point out that if this is intentional, it is highly inefficient. Unfortunately, almost all of the code for this async loading and events surrounding that is native so I have no idea how to circumvent the hitching issues.

Finally, I wonder why this content is loaded during the match in the first place. Isn't the long load time for KF2 attributed to loading content prior to the match, specifically to avoid these hitches?
 
I always noticed weird 'lags' during trader time (like you throw dosh, nothing happens then all thrown dosh ejects at same time, or you run out of trader then suddenly teleport/lag/rollback, things like that) but wasn't able to explain them as the server CPU would not peak in usage and/or the client wouldn't either. That would explain this behavior during trader.
 
Upvote 0
You guys still have faith? Personally I'm done with TWI and being ignored willingly because fixing the **** ton of bugs will not make a new update with new market stuff to sell...

I was going to make THE LIST a few months ago but honestly, what's the point? Even the well documented bugs are ignored.

Think about it like that, hint hint, the answer to these questions is the same:
- will it bring money?
- so will they fix it?
 
Upvote 0