I created a achievement with 1 as target value and linked it to a stat using SUM. My game is not released so I assigned the stat and achievement to a deployment in the dev sandbox. The sandbox id and deployment id have been updated in the EOS settings of my DefaultEngine config file. I created a build of my game, launched it, logged in fine with an account that is part of my organization (through the dev authentication tool), triggered a stat ingest for a value of 1 with the stat name. The callback result indicated the operation was a success. I did not receive any achievement notification. The dev portal shows there was no progress on that achievement for the selected user. When I go to the social overlay in game, I can see friend accounts, but no achievements in the list.
Are EOS (not Epic Game Store) achievements supposed to work if the game is not released? Do I have to upload the build to the deployment, download it through the Epic Launcher, then launch it from the launcher for the achievements to work?
Here’s my code for ingesting the stat:
void UOnlineSubsystemManager::UpdateStat(const FString& StatName, const int32 StatValue)
{
auto ThisUserPtr = GetIdentityInterface()->GetUniquePlayerId(0);
if (!ThisUserPtr.IsValid())
{
FMessageLog(FName("OnlineSubsystemManager")).Error(LOCTEXT("Stats", "Unable to query stats. Invalid user. Make sure the user is logged in."));
return;
}
TSharedRef<const FUniqueNetId> ThisUserRef = ThisUserPtr.ToSharedRef();
FOnlineStatsUserUpdatedStats Stat = FOnlineStatsUserUpdatedStats(ThisUserRef);
FOnlineStatValue OnlineStatValue(StatValue);
Stat.Stats.Add(StatName, FOnlineStatUpdate(OnlineStatValue, FOnlineStatUpdate::EOnlineStatModificationType::Unknown));
TArray<FOnlineStatsUserUpdatedStats> Stats;
Stats.Add(Stat);
GetStatsInterface()->UpdateStats(
ThisUserRef,
Stats,
FOnlineStatsUpdateStatsComplete::CreateLambda([this, StatName, StatValue](
const FOnlineError& ResultState)
{
if (!ResultState.bSucceeded)
{
FString ErrorMessage = FString::Printf(TEXT("Failed to update stats: %s."), *ResultState.GetErrorMessage().ToString());
FMessageLog(FName("OnlineSubsystemManager")).Info(FText::FromString(ErrorMessage));
}
if (OnStatUpdated.IsBound())
{
OnStatUpdated.Broadcast(ResultState.bSucceeded);
}
}));
}
Update: I uploaded and labeled the binary. Downloaded and launched it through the Epic Games launcher. Same behavior as with the dev authentication tool: achievement progress not being updated, achievement not visible in the social overlay.
The overlay and achievements should work even from the dev sandbox. A couple of things I would do to confirm things are working correctly.
The first thing I would confirm is that your IDs are correct, that you are initializing the EOS SDK with the correct product ID, Sandbox ID, Deployment ID (with your achievement definitions) and client ID & secret (and not the BPT credentials)
I would also confirm that you are successfully logging into EOS backend via the Connect Interface. With achievements not showing up in the overlay I suspect this to be the issue. All users need to be logged in to the Connect backend and associated with a product User ID. The first time you try to login its going to return Invalid User, which is where you follow the steps to create the user in the backend: Connect Interface | Epic Online Services Developer
Its worth calling out that EOS_Auth_Login and EOS_Connect_Login are two separate steps. The former logs you into the Epic account and gets you the access token. The second logs an authenticated user into the EOS backend. You need to handle both.
If those two items are looking good, make sure you have verbose EOS Logging enabled (Logging Interface | Epic Online Services Developer) and see if any errors standout, if you see any please share those, they should include an error code and correlation ID and we can look from there.
Hi! Thank you for the prompt reply. I double checked the product, organization, client, sandbox and deployment ids, as well as the client secret and it’s all in order.
I’m using the common user plugin to handle the logging in. Going down the code, it looks like it does call EOS_Connect_Login (call order from top to bottom):
These appear to be the Live sandbox and deployment, where you have not pushed achievement definitions to.
If you look at line 260, that is showing the values that the command line are passing to you, including -epicsandboxid.
You could use the passed epic sandbox ID to determine which sandbox you are running, and then have logic in game that basically says “if sandbox ID xyz, then use deployment zyx” when initializing the EOS SDK and I think that should get you sorted.
That would explain it. We recently updated the way the configs are selected in builds. It’s possible the ones with the updated credentials are not being selected. I’ll do a few tests. Thank you!