Unreal Engine 4 is available for Win10 UWP app dev now

Okay, thank you. I’ll look at it more tomorrow. Trying to convert it to VS2017 first since that’s what I have installed. If that fails, I reinstall VS2015 and try again.

@ - I have a VS2017 solution setup for EraAdapter, and I can compile cleanly all the sources files, except one, Networking.cpp.

Networking is referencing Windows::Networking::XboxLive namespace but I can’t resolve it. I tried adding the reference



Windows.Networking.XboxLive.XboxLiveSecureSocketsContract


but that didn’t help, and the reference shows a caution icon next to it. Thinking that it was a compatibility issue, I tried adding it to a project with a wider range of support:



Build 15063
Build 10240


which showed the same caution icon after adding the reference. I was trying different from - to target combinations but VS2017 returned an HRESULT when trying to create the solution.

For the EraAdapter project (15063 to 10586) the following references are present:



Windows.ApplicationModel.Calls.CallsVoipContract
Windows.Devices.Printers.PrintersContract
Windows.Foundation.FoundationContract
Windows.Foundation.UniversalApiContract
Windows.Graphics.Printing3D.Printing3DContract
Windows.Networking.Connectivity.WwanContract
Microsoft.Xbox.Services (from XSAPI path)
Windows.Networking.XboxLive.XboxLiveSecureSocketsContract (warning icon)
Xbox Live Extension SDK


The other Contract references were added automatically after reopening the solution.

Do you have any suggestions?

That reference should be part of the Xbox Live Extensions SDK which you will have installed thanks to the GetXboxLiveSDK script. Try removing both the broken Windows.Networking.XboxLive.XboxLiveSecureSocketsContract and the Xbox Live Extension SDK references, and then readding the latter (Add reference -> Extensions).

No improvement after performing the above steps.

[EDIT]
According to the link https://docs.microsoft.com/en-us/uwp/extension-sdks/xbox-live-extensions
we should have the following contracts:



Windows.Gaming.XboxLive.StorageApiContract, version=1.0.
Windows.Networking.XboxLive.XboxLiveSecureSocketsContract, version=1.0


Unfortunately, I don’t see either of them. How can I tell if my XboxLive is working or not? I can access the services from within UE4 but my separate project is having a problem. Is it a compiler switch?

@ - Well, I took different strategy and was able to open the EraAdapter project just by double-clicking on it. I modified the HintPath in the project file but still encountered the same error.

Basically, I used VS2017 Open -> File -> Open With, selected XML (Text) Editor, replaced HintPath with:
MICROSOFT_UWP_UNREAL\Engine\Plugins\Online\XboxOne\OnlineSubsystemLive\ThirdParty\XSAPI\UWP\build
ative\lib\x64\v140\Release\Microsoft.Xbox.Services.winmd

Ok, worked out what was going on. This is related to VS2017 picking up winmd references from a SDK-version-specific subfolder of Windows Kits\10\References, but the Live Extensions SDK doesn’t put its winmds in that location.

Try this: remove the existing broken reference, edit the project xml, and add a block like the below



    <Reference Include="Windows.Networking.XboxLive.XboxLiveSecureSocketsContract">
      <HintPath>C:\Program Files (x86)\Windows Kits\10\References\Windows.Networking.XboxLive.XboxLiveSecureSocketsContract\1.0.0.0\Windows.Networking.XboxLive.XboxLiveSecureSocketsContract.winmd</HintPath>
      <IsWinMDFile>true</IsWinMDFile>
    </Reference>


This references the winmd directly, rather than as an ‘Extension SDK’, and is working for me.

(edit)
…your path to Microsoft.Xbox.Services.winmd above looks about right, but note these are two separate winmd references that are needed. Microsoft.Xbox.Services.winmd for sign-in, leaderboards, etc. And Windows.Networking.XboxLive.XboxLiveSecureSocketsContract.winmd for secure networking (not used in Creators Program, but required for EraAdapter to build).

That (the build) worked. I renamed the original dll and winmd to .dll.BAK and .winmd.BAK, then copied the newly generated into the same EraAdapter folder.

So, taking a quick stab, I copied the new DLL to my game Binaries AppX folder, figuring that since it’s just a DLL it should be replaceable. Now I’m running my game in Cook-on-the-Fly Debug mode.

[EDIT]
That (Login) worked. Now I have a valid PlayerId :slight_smile:

Now I just need to get the gamertag and image and display it. . .

Getting the gamertag (IOnlineIdentity::GetPlayerNickname) was easy enough. Now I want to get the player’s avatar.

@ - I am able to successfully logon, get the AppId, and get the gamertag. Unfortunately, I encountered a problem while trying to update leaderboard information. After gameplay, I try to get the FUniqueNetId from the IOnlineIdentity interface but it returns null:



bool UWPScores::WriteLeaderboard(. . .)
{
    * oss = ::Get();

    if (oss != nullptr)
    {
        IOnlineIdentity* iss = oss->GetIdentityInterface().Get();
        if (iss != nullptr)
        {
            TSharedPtr<const FUniqueNetId> playerId = iss->GetUniquePlayerId(0);
            if (!playerId.IsValid())
                return false;
            :
        }
        :
    }


In the above code PlayerId is always null. Possibly I made a mistake, others appear to use the same approach, I tried getting the PlayerId during the callback function when logging in:



void UMainMenuScreenWidget::LoginPlayerCallback(TSharedPtr<const FUniqueNetId> PlayerId, const int ControllerIndex)
{
    if (PlayerId.IsValid())
    {
        * oss = ::Get();
        if (oss != nullptr)
        {
            IOnlineIdentity* iss = oss->GetIdentityInterface().Get();
            if (iss != nullptr)
            {
                TSharedPtr<const FUniqueNetId> tmpPlayerId = iss->GetUniquePlayerId(0);
                if (!tmpPlayerId.IsValid())
                    GEngine->AddOnScreenDebugMessage(-1, 10.0f, FColor::Yellow, FString(TEXT("GetUniquePlayerId() failed ")));
            }
        }
    }
}


In the login callback function, GetUniquePlayerId fails, tmpPlayerId is always null. Should this work? Should I be able to get the FUniqueNetId in both cases (during callback, and within my other function)?

Okay, I see the issue with WriteLeaderboards, it isn’t ready yet:



bool FOnlineLeaderboardsLive::WriteLeaderboards(const FName& SessionName, const FUniqueNetId& Player, FOnlineLeaderboardWrite& WriteObject)
{
	UNREFERENCED_PARAMETER(SessionName);
	UNREFERENCED_PARAMETER(Player);
	UNREFERENCED_PARAMETER(WriteObject);
	return false;
}


ReadLeaderboards is done but I don’t know if that works or not. I’m going to look at sample code online and see if I can implement it quickly or not, meaning before anyone else does, unless it is being done by someone else.

For GetUniquePlayerId, do you have a game controller attached? The parameter name ‘controller index’ is literal in this case :slight_smile: - comes from the code’s original home on Xbox. On the whole I’d recommend stashing the net id that comes in as a callback parameter to sign in, and then (when possible) using the overloads of online methods that take in a net id.

The current approach to updating leaderboards is to submit events through the IOnlineEvents interface. The implementation is based on the technology described as ‘Data Platform 2013’ in the Xbox Live Docs. It may well need to be updated for Creators Program - I’m not aware of anyone doing that yet.

Yes, that is what I ended up doing.

And here I was digging into both codebases (Epic, and MS). Are you able to refer me to any examples for IOnlineEvents? I’m searching now. . .

What are the event names?



/// The name of the event, and the names of the event fields (both dimensions and measurements), must match
/// the names declared in the title's service configuration. The names are case insensitive.


If I understand the comment correctly, event name is actually something I set in the Dev Center configuration portal. I’m giving it a try. . .

Nothing appears on GameHub. Since I’m not certain of the syntax for the events, I’ve posted an issue on the Xbox Live SDK GitHub, and have the same question on the MSDN forums. Hopefully, someone will be able to help.

Hi All,
I was wondering if you could help, trying to setup the Holo lens to work with UE4.
So I have downloaded the MS_UWP_Fork, run the setup and generate the project file.
In Visual Studio I set the solution etc and select build and run the debugger.

No errors are reported but when I startup a UE4 project from visual studio the UWP tab does not appear in the project settings - platform tab??

I’m having difficulty in getting a 3D project to run on the Xbox One, it just crashes shortly after the splash screen. There isn’t anything in the scene apart from the preexisting bit of geometry.
Building the Paper2D project as UWP and deploying that does seem to work, however.

Is mine an isolated issue?

Fixed

@ - I’m trying to write achievements following the code in OnlineAchievementsInterfaceLive.cpp:



for ( FStatPropertyArray::TConstIterator It( WriteObject->Properties ); It; ++It )
{
	float Percent = 0.0f;
	It.Value().GetValue( Percent );

	if ( Percent < 100.0f )
	{
		continue;
	}
	:
	:
	FName Name = It.Key();
	int32* Index = AchievementsConfig.AchievementMap.Find( Name.ToString() );

	FOnlineEventParms Parms;
	Parms.Add( TEXT( "AchievementIndex" ), FVariantData( (int32)*Index ) );

	if ( !EventInterface->TriggerEvent( PlayerId, *AchievementsConfig.AchievementEventName, Parms ) )
	{
	}
}


Why is the value in Properties 100.0f?

Where is the AchievementsConfig and AchivementMap kept? It appears that Google Play Plugin has such a map: Using Google Play Achievements in Unreal Engine Projects | Unreal Engine 5.1 Documentation

The Live plugin doesn’t have a similar map. Is it supposed to be in an INI file?

Also, the above code does not appear to write my key-value pair:



writeObject->SetIntStat(FName("HighScore"), totalScore);
:
ioa->WriteAchievements(*playerId, writeObjectRef, callback);


The OnlineAchievementsInterfaceLive code above appears to write the event name, “AchievementIndex”, and the index value for the achievement:



FOnlineEventParms Parms;
Parms.Add( TEXT( "AchievementIndex" ), FVariantData( (int32)*Index ) );

if ( !EventInterface->TriggerEvent( PlayerId, *AchievementsConfig.AchievementEventName, Parms ) )


Maybe there is some subtlety in the code that I missed, but test cases in the same file present a different view:



	FOnlineEventsLive * EventInterface = (FOnlineEventsLive*)LiveSubsystem->GetEventsInterface().Get();

	FOnlineEventParms Parms;
	Parms.Add( TEXT( "GameplayModeId" ), FVariantData( (int32)1 ) );
	Parms.Add( TEXT( "DifficultyLevelId" ), FVariantData( (int32)1 ) );
	Parms.Add( TEXT( "ExitStatusId" ), FVariantData( (int32)0 ) );
	Parms.Add( TEXT( "MapName" ), FVariantData( FString("Highrise") ) );
	Parms.Add( TEXT( "PlayerScore" ), FVariantData( (int32)0 ) );
	Parms.Add( TEXT( "PlayerWon" ), FVariantData( (bool)false ) );

	EventInterface->TriggerEvent( PlayerId, TEXT( "PlayerSessionEnd" ), Parms );


Are you able to provide some insight on this?

@anonymous_user_1267f45c - this again is the plugin revealing its origins as a component of UE for Xbox One XDK games. The ability to write Achievements is not part of the Xbox Live Creators Program.
@User-645081948 - do you have the Windows 10 SDK installed (preferably either 14393, or if you’re using VS2017, 15063)?
@xxValiumxx - a couple of ideas: be aware of the performance envelope for UWP on Xbox One. In particular, make sure you’re not exceeding the memory limit, and that you’re using the D3D11 RHI. Also, try running the Windows App Certification Kit (WACK) against your appx package; often that will highlight problems that can go unnoticed on Windows desktop, but that will limit your game’s ability to run on other UWP devices. Note that it’s expected that configurations other than Shipping use some unsupported APIs, so you may need to use a Shipping build to run on Xbox.

How do I write the Featured Stats / Leaderboards then:

I’ve tried writing them with events too:



IOnlineEvents* ioe = ios->GetEventsInterface().Get();
if (ioe != nullptr)
{
    FOnlineEventParms Parms;
    Parms.Add(TEXT("GameplayModeId"), FVariantData((int32)1));
    Parms.Add(TEXT("DifficultyLevelId"), FVariantData((int32)1));
    Parms.Add(TEXT("HighScore"), FVariantData((int32)levelScore->GetTotalScore()));

    bool isOk = ioe->TriggerEvent(*playerId, TEXT("OceanWave"), Parms);
    isOk = ioe->TriggerEvent(*playerId, TEXT("HighScore"), Parms);
}


Above, I used two calls with different event names hoping that one of them will match my Xbox Live Configuration.

For the record, I’ve posted my request for help at two additional locations:

https:///Microsoft/xbox-live-api/issues/203

https://social.msdn.microsoft.com/Forums/Windowsapps/en-US/bfa760b9-d083-48d6-9749-23773309bf81/cannot-update-xbox-live-creators-program-leaderboard?forum=xboxlivedev

Sadly no response yet.