A Nights Haunting: Source · published · build 24048446
In this update i reworked all of the leaderboard statistic tracking achievements redesigning the data handling pipeline for optimization. It was extremely complicating figuring out how the steamworks backend works and then incorporating the steamworks package into the source engine sdk 2013 multiplayer source code was bonkers. Originally the leaderboard syncing infrastructure would work the statistic for each achievement individually and so a single statistic would request individual entry for each achievement into the leaderboard.
e.g. 1 zombie kill would request all 7 achievements pushing the statistics individually, leading 7 individual requests - this was taxing as well as susceptible for individual leaderboard race conditions seeing as though the system is split into client and server-side both needing to communicate the data back and forth without breaking. this would lead to single game sessions not storing the data correctly locally or via steam backend. CON_COMMAND(zombie_kill_sync, "Force sync all zombie kill achievements with Steam")
{
IAchievementMgr* pBaseMgr = engine->GetAchievementMgr();
CAchievementMgr* pAchievementMgr = dynamic_cast<CAchievementMgr*>(pBaseMgr); if (!pAchievementMgr)
{
Msg("[Console] ERROR: Could not get main achievement manager!n");
return;
} const char* zombieAchievements[] = {
"MOD_GOT_COP_KILLS",
"MOD_GOT_COP_KILLS2",
"MOD_GOT_COP_KILLS3",
"MOD_GOT_COP_KILLS4",
"MOD_GOT_COP_KILLS5",
"MOD_GOT_COP_KILLS6",
"MOD_GOT_COP_KILLS7"
}; Msg("[Console] Forcing Steam sync on all zombie kill achievements...n"); for (int i = 0; i < ARRAYSIZE(zombieAchievements); i++)
{
const char* achName = zombieAchievements; CBaseAchievement* pAchievement = pAchievementMgr->GetAchievementByName(achName);
auto* pZombieAchievement = dynamic_cast<CZombieKillAchievement*>(pAchievement); if (pZombieAchievement)
{
pZombieAchievement->ForceSteamSync();
Msg("[Console] Sync complete for %s (%d/%d)n",
achName, pZombieAchievement->GetCount(), pZombieAchievement->GetGoal());
}
else
{
Msg("[Console] ERROR: Could not find zombie achievement %s!n", achName);
}
}
} using arrays each individual leaderboard statistic registers to each statistics achievements all at once.
e.g. 1 zombie kill requests the leaderboard then updates to all 7 achievements at once. this leads the statistics directly into the leaderboards at once and then valves standard refresh rate to updating the leaderboards live online bringing the players results to the leaderboard faster and making the achievements infrastructure more water tight. this came with vigorous testing between multiple user accounts and isolated networks certifying release by yours truly dr.N0
until next time! and HAPPY INDEPENDENCE DAY to ALL INDEPENDENT SOURCE ENGINE MODS!
ITS GOING TO BE THE GREATEST 4TH OF JULY EVUR!