I've been trying to find a cause for the PC build's performance problems and came across something interesting. Using the Steam console, I was able to log calls made to the Steam API from Destiny to get a general picture. In my research I discovered that each time I loaded an interface or returned focus to the game window, the client would make a SDK call to the GetFriendRelationship function. It would normally do this for each entry in my friends and clan list and sometimes it would do it continuously.
GetFriendRelationship returns the relationship between you and another Steam user (friends, not friends, etc). The interesting thing is in each call, the ID being passed is my own Steam ID and the result is always 0 (k_EFriendRelationshipNone). In a 2 minute period where all I did was launch the game, enter the Tower, return to orbit, then logged out, the client made 13,400+ calls to this function.
In comparison, another game only made 120 calls with similar actions in a similar duration in time. I think a call is being made for each person in your friends list and due to the blocking, it is hindering application performance when trying to process all of this.
[u]Here is output from the console for another test of just 7 seconds:[/u]
[quote]Calls over the last 7082 milliseconds:
Process Method Calls First Last
-------------------- ---------------------------------------- ---------- ---------- ----------
destiny2.exe IClientFriends::GetFriendRelationship [u]660[/u] 1827 7064
[/quote]
I assume in the code to refresh the clans/friends list, they have something like this:
[quote]CSteamID id = SteamUser()->GetSteamID();
//Then later on, something like:
int nFriends = SteamFriends()->GetFriendCount( k_EFriendFlagImmediate );
if ( nFriends == -1)
{
printf( "GetFriendCount returned -1, the current user is not logged in.\n" );
nFriends = 0;
}
for ( int i = 0; i < nFriends; ++i )
{
CSteamID friendSteamID = SteamFriends()->GetFriendByIndex( i, k_EFriendFlagImmediate );
const char *friendName = SteamFriends()->GetFriendPersonaName( friendSteamID );
EFriendRelationship relationship = SteamFriends().GetFriendRelationship(id); <-- Note the wrong id is being referenced here instead of friendSteamID
// Other code to add these details to some list to render
}[/quote]
Also, I would be very happy if someone at Bungie would use the [url=https://partner.steamgames.com/doc/api/ISteamNetworkingUtils#EstimatePingTimeFromLocalHost]EstimatePingTimeFromLocalHost[/url] SDK function and render the latency to the Activity Host and each peer we are playing with on the roster. There is a [url=https://partner.steamgames.com/doc/api/ISteamNetworkingSockets#GetQuickConnectionStatus]GetQuickConnectionStatus[/url] function as well that is more lightweight.
-
I changed this to Destiny 2 feedback as it might be better there.
-
May want to also post this over in the github portal for Bungie's API as you have a way better chance of the API developers to see this report. [url]https://github.com/Bungie-net/api[/url]