Announcement

Collapse
No announcement yet.

Unreal Engine 4 is available for Win10 UWP app dev now

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by jsyarrow View Post
    - Make sure you've checked the box to 'Feature on players' profiles'
    I think the 'Feature on players' profiles' is what concerns me the most. It isn't shown on my 'New featured stat/leaderboard' dialog:

    Click image for larger version

Name:	FeaturedStatDialog.jpg
Views:	1
Size:	51.2 KB
ID:	1130903

    I've seen this mentioned and other peculiarities in the documentation yet it isn't visible on mine. I was hoping that a Dev Center Portal update was coming.

    Originally posted by jsyarrow View Post
    - If you're not already, you should capture and process the returned events from the DoWork call on the StatisticsManager. These might provide some clue if there's an error encountered.
    - Try retrieving the leaderboards in your own code - this will be the only way to display global leaderboards in any case, since the dash/Xbox App focuses on social.
    How do I attach to the DoWork events call stack? I'll look for it but if you happen to know that may save me a bit of time.

    Comment


      It will be something like:

      Code:
      auto EventList = Manager->DoWork();
      for (auto Event : EventList)
      {
      	if (Event->ErrorCode != 0)
      	{
      		// Event->ErrorMessage should have more details
      	}
      }

      Comment


        [MENTION=494622]jsyarrow[/MENTION] - where can I find the log written to in the below code:

        Code:
            Microsoft::Xbox::Services::Statistics::Manager::StatisticManager^ mgr = Microsoft::Xbox::Services::Statistics::Manager::StatisticManager::SingletonInstance;
            if (mgr != nullptr)
            {
                auto EventList = mgr->DoWork();
                for (auto Event : EventList)
                {
                    if (Event->ErrorCode != 0)
                    {
                        UE_LOG_ONLINE(Warning, TEXT("DoWork error: %s"), Event->ErrorMessage->Data());
                        :
                    }
                }
            }
        I placed a breakpoint in the ErrorCode block but it was never hit. Most likely an error never occurred.

        Comment


          That would go to the regular log file. For UWP without a cook server this is %localappdata%\Packages\{Package_Family_Name}\LocalState\{Project_Name}\Saved\Logs\{Project_Name}.log. You should also see it in the Project Launcher output window if running using the Project Launcher, or in the debugger output window if running under the debugger.

          Sounds, though, as if an error is not the problem. I suspect the stat is not actually getting the 'Feature on players' profile' flag, and it sounds as though there may be no way to apply that in the current UI for Creators Program titles. Have you had a chance to try retrieving the stat in your own code yet, (e.g. via StatisticManager::GetLeaderboard)?

          Comment


            Trying to read the leaderboard now using the Stats Manager. Since ReadLeaderboardsAroundUser wasn't implemented I decided to replace its function body:

            Code:
            bool FOnlineLeaderboardsLive::ReadLeaderboardsAroundUser(TSharedRef<const FUniqueNetId> Player, uint32 Range, FOnlineLeaderboardReadRef& ReadObject)
            {
            	//UE_LOG_ONLINE(Warning, TEXT("FOnlineLeaderboardsLive::ReadLeaderboardsAroundUser is currently not supported."));
                if (!LiveSubsystem)
                    return false;
            
                const FOnlineIdentityLivePtr Identity = LiveSubsystem->GetIdentityLive();
                if (!Identity.IsValid())
                    return false;
            
                const FUniqueNetIdLive UserLive(Player.Get());
                Windows::Xbox::System::User^ XBoxUser = Identity->GetUserForUniqueNetId(UserLive);
                if (!XBoxUser)
                    return false;
            
                Microsoft::Xbox::Services::XboxLiveContext^ LiveContext = LiveSubsystem->GetLiveContext(XBoxUser);
                if (LiveContext == nullptr)
                    return false;
            
                Microsoft::Xbox::Services::Statistics::Manager::StatisticManager^ mgr = Microsoft::Xbox::Services::Statistics::Manager::StatisticManager::SingletonInstance;
                if (mgr != nullptr)
                {
                    FOnlineLeaderboardRead olr = ReadObject.Get();
                    TArray<FColumnMetaData> cols = olr.ColumnMetadata;
                    for (FColumnMetaData data : olr.ColumnMetadata)
                    {
                        mgr->GetLeaderboard(LiveContext->User, data.ColumnName, );
                    }
            
                    return true;
                }
            
                return false;
            }

            Unfortunately I need a third parameter for the mgr->GetLeaderboard(LiveContext->User, data.ColumnName, ); call.

            Comment


              Hi there,

              I would love to get our existing 4.16 game project running as a UWP project. I have:

              - Got the latest UWP UE4 Engine from GitHub
              - Run setup.bat
              - Registered the UWP Engine folder as an engine installation
              - Changed the engine association of our existing project to the UWP Engine
              - Right clicked on our existing project and selected "Generate Visual Studio Project Files" which completed successfully
              - Opened the solution file in VS2015
              - Cleaned the solution
              - Set our game project as the startup project and hit build

              I get the following error:

              2> Module.UWPDeviceDetector.cpp
              2>C:\P4\IDA_UWP\Engine\Intermediate\Build\Win64\UE4Editor\Development\UWPDeviceDetector\Module.UWPDeviceDetector.cpp : fatal error C1093: API call 'ImportFile' failed '0x80070002': ErrorMessage: The system cannot find the file specified.
              2>
              2>
              2> Description: The system cannot find the file specified.
              2> HelpFile: complib.hlp
              2>dbsbuild : error : aborting build on error (2)
              2>ERROR : UBT error : Failed to produce item: C:\P4\IDA_UWP\Engine\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-MovieSceneTools.lib
              2> Total build time: 35.58 seconds (SNDBS executor: 0.00 seconds)

              Has anyone else experienced this?

              Phil
              Last edited by PhilMaguire; 07-11-2017, 10:04 AM. Reason: Additional information

              Comment


                Originally posted by jsyarrow View Post
                Have you had a chance to try retrieving the stat in your own code yet, (e.g. via StatisticManager::GetLeaderboard)?
                Yes, in another post I'm trying to use the StatisticsManager::GetLeaderboard call but I haven't worked out the third parameter yet.

                Code:
                bool FOnlineLeaderboardsLive::ReadLeaderboardsAroundUser(TSharedRef<const FUniqueNetId> Player, uint32 Range, FOnlineLeaderboardReadRef& ReadObject)
                {
                    if (!LiveSubsystem)
                        return false;
                
                    //Currently Xbox One only supports single column leaderboards. If more than one column is requested, fail the request for now.
                    if (ReadObject->ColumnMetadata.Num() > 1)
                    {
                        UE_LOG_ONLINE(Warning, TEXT("Failing Leaderboards request for multiple columns. Xbox One currently only supports single-column leaderboards."));
                        TriggerOnLeaderboardReadCompleteDelegates(false);
                        return false;
                    }
                
                    const FOnlineIdentityLivePtr Identity = LiveSubsystem->GetIdentityLive();
                    if (!Identity.IsValid())
                        return false;
                
                    const FUniqueNetIdLive UserLive(Player.Get());
                    Windows::Xbox::System::User^ XBoxUser = Identity->GetUserForUniqueNetId(UserLive);
                    if (!XBoxUser)
                        return false;
                
                    //Microsoft::Xbox::Services::XboxLiveContext^ LiveContext = LiveSubsystem->GetLiveContext(XBoxUser);
                    XboxLiveContext^ LiveContext = LiveSubsystem->GetLiveContext(XBoxUser);
                    if (LiveContext == nullptr)
                        return false;
                
                    //Microsoft::Xbox::Services::Statistics::Manager::StatisticManager^ mgr = Microsoft::Xbox::Services::Statistics::Manager::StatisticManager::SingletonInstance;
                    StatisticManager^ mgr = StatisticManager::SingletonInstance;
                    if (mgr == nullptr)
                        return false;
                
                    try
                    {
                        Platform::String^ StatName;
                        if (ReadObject->ColumnMetadata.Num() > 0)
                        {
                            StatName = ref new Platform::String(*ReadObject->ColumnMetadata[0].ColumnName.GetPlainNameString());
                        }
                
                        if (StatName->Length() == 0)
                        {
                            UE_LOG_ONLINE(Warning, TEXT("Failing Leaderboards request. No statistic requested for friends leaderboard."));
                            ReadObject->ReadState = EOnlineAsyncTaskState::Failed;
                            TriggerOnLeaderboardReadCompleteDelegates(false);
                            return false;
                        }
                
                        ReadObject->ReadState = EOnlineAsyncTaskState::InProgress;
                
                        // Clear out any existing data
                        ReadObject->Rows.Empty();
                
                        mgr->GetLeaderboard(LiveContext->User, StatName, nullptr);
                    }
                    catch (Platform::Exception^ ex)
                    {
                        UE_LOG_ONLINE(Warning, TEXT("GetLeaderboard failed. Exception: %s."), ex->ToString()->Data());
                        ReadObject->ReadState = EOnlineAsyncTaskState::Failed;
                        TriggerOnLeaderboardReadCompleteDelegates(false);
                        return false;
                    }
                
                    return true;
                }

                I'm using ReadLeaderboardsAroundUser since it previously wasn't implemented for my tests. I can replace the ReadLeaderboards function if I can get it working properly.

                Do you know about the LeaderboardQuery parameter?

                Comment


                  Documentation and Dev Center Portal is a little out of sync. For example, the documentation in item 1 states that Xbox Live Creators Program members are using Data Platform 2017. Item 2 though shows a discrepancy between the documented portal and the dialog presented to me on Dev Center. More importantly, and something I'm concerned about, item 3, which was posted just a few days ago on July 6, 2017 makes use of different signatures.

                  1. https://developer.microsoft.com/en-u...7/player-stats

                  Click image for larger version

Name:	01.jpg
Views:	1
Size:	81.6 KB
ID:	1130958

                  2. https://developer.microsoft.com/en-u...configure-2017

                  Click image for larger version

Name:	02.jpg
Views:	1
Size:	61.5 KB
ID:	1130959

                  3. https://docs.microsoft.com/en-us/win...stats-updating

                  Click image for larger version

Name:	03.jpg
Views:	1
Size:	67.8 KB
ID:	1130960


                  Again, for item 3 with the different function signatures, given that it was just published it leads me to question my usage of the API. Which one of is correct?

                  Am I using the correct DLL's, and hence the correct interface? If so, why the continued publishing as shown in item 3.

                  Click image for larger version

Name:	04.jpg
Views:	1
Size:	49.7 KB
ID:	1130961

                  [EDIT]

                  Just verified the contents of the WINMD file using IDLAsm:

                  Click image for larger version

Name:	05.jpg
Views:	1
Size:	312.1 KB
ID:	1130962


                  That at least confirms which DLL I'm accessing.
                  Last edited by Jerry.Richards; 07-11-2017, 12:26 PM.

                  Comment


                    I can build and run from within Visual Studio 2015, but when I try to create a package from within UE, I get the following error -

                    Code:
                    UATHelper: Packaging (UWP (x86-32bit)): MSBuild: UWPPlatform.Automation.cs(214,63): error CS0234: The type or namespace name 'Tools' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [...\engine\Engine\Source\Programs\AutomationTool\UWP\UWP.Automation.csproj]
                    Any thoughts?

                    Comment


                      [MENTION=24297]PhilMaguire[/MENTION] - The UWPDeviceDetector module that's failing is a little special in that it takes a dependency on a Win10 SDK winmd component (Windows:evices::Enumeration:eviceWatcher) in order to locate UWP devices on your local network (for e.g. in-editor deployment to an Xbox). Do you have the Windows 10 SDK installed (for VS2015, I'd recommend 14393)? If so, my only other thought is that maybe there's an incompatibility between SNDBS and use of winmd - that's not something I've tried. If necessary you can turn off use of winmd components in the editor via the branch-specific config variable bUseWindowsSDK10ForEditor (goes in the /Script/WindowsTargetPlatform.WindowsTargetSettings section, set it to false). But you might quickly run into similar issues with the UWP builds themselves.

                      [MENTION=5350]Jerry.Richards[/MENTION] - I think you should just create your own LeaderboardQuery object (warning: forum code)
                      Code:
                      using namespace Microsoft::Xbox::Services::Leaderboard;
                      
                      auto Query = ref new LeaderboardQuery();
                      Query->SkipResultToMe = true;
                      Query->MaxItems = 100;
                      Query->SortOrder = SortOrder::Descending;
                      mgr->GetLeaderboard(LiveContext->User, StatName, Query);
                      You're definitely using the correct libraries. Some details/history: the Xbox Live SDK comes in two flavors: a pure, standard C++ version (which is mostly what you see in sample code these days); and a WinRT projection (also written in C++, as a layer on top of the pure C++ version, and usable from C++ as well as other WinRT-compatible languages). The latter version actually predates the former, and back when Epic first created OnlineSubsystemLive for Xbox One it was the only version available. As a result, it's the version that UE uses.

                      As for the different UI between the doc images and the actual portal, I'd encourage you to provide feedback through the standard Creators Program channels since it's not a UE issue. That's the kind of thing I'm sure they're interested in hearing about from early adopters of the Creators Program.

                      [MENTION=828801]Sparkash[/MENTION] - There's a NuGet reference in UWP.Automation.csproj - we use the Windows Device Portal Wrapper (source here) to assist with deploy and launch on remote UWP devices. If you haven't built that project in VS at least once then the reference may not have been resolved and downloaded. Once the necessary assembly is in place you should be able to package in the editor. (I'm going to try to move the resolution step into Setup.bat when I get a chance.)
                      Last edited by jsyarrow; 07-11-2017, 01:43 PM. Reason: Needs more line breaks

                      Comment


                        Originally posted by jsyarrow View Post
                        [MENTION=5350]Jerry.Richards[/MENTION] - I think you should just create your own LeaderboardQuery object (warning: forum code)
                        Code:
                        using namespace Microsoft::Xbox::Services::Leaderboard;
                        
                        auto Query = ref new LeaderboardQuery();
                        Query->SkipResultToMe = true;
                        Query->MaxItems = 100;
                        Query->SortOrder = SortOrder::Descending;
                        mgr->GetLeaderboard(LiveContext->User, StatName, Query);

                        If it were only that easy

                        Code:
                        error C2248: 'Microsoft::Xbox::Services::Leaderboard::LeaderboardQuery::LeaderboardQuery': cannot access private member declared in class 'Microsoft::Xbox::Services::Leaderboard::LeaderboardQuery'
                        I can't instantiate the LeaderboardQuery. C# (https://github.com/Microsoft/xbox-li...rboardQuery.cs) looks nice and cleaned up:

                        Click image for larger version

Name:	02.jpg
Views:	1
Size:	98.1 KB
ID:	1130967


                        Unfortunately I haven't found the matching repository for the DLL we are using. The "older" version (https://github.com/Microsoft/xbox-li.../leaderboard.h) does have a similar setup:

                        Click image for larger version

Name:	03.jpg
Views:	1
Size:	53.7 KB
ID:	1130968


                        But neither code matches what is in the WINMD file:

                        Click image for larger version

Name:	04.jpg
Views:	1
Size:	128.4 KB
ID:	1130969

                        The items enclosed by the red box are not one for one in the source that I am referencing. The WINMD doesn't look like there is a public constructor, unless I missed it.

                        Are we able to access the repository for the Microsoft::Xbox::Services DLL?

                        Comment


                          Well bother!

                          Source is here, but looks like the XBL SDK release currently in use by OnlineSubsystemLive missed the latest change which adds the necessary public constructor, hence the problem.

                          Once again you could try revving the version in GetXboxLiveSDK.ps1. Looks like latest is 20170710.1 (see this page). And as before this may or may not require rebuilding EraAdapter.

                          Comment


                            Originally posted by jsyarrow View Post
                            Once again you could try revving the version in GetXboxLiveSDK.ps1. Looks like latest is 20170710.1 (see this page). And as before this may or may not require rebuilding EraAdapter.
                            After updating UWPPlatform.Automation.cs (PDBCopyPath for VS2017 Community Edition), OnlineSubsystemLive.Build.cs (XsapiVersionUwp), and modifying the GetXboxLiveSDK.ps1 ($xsapiVersionUwp), running the script, then running GenerateProjectFiles.bat, an error is returned.


                            UWPPlatform.Automation.cs
                            Code:
                            FileReference PDBCopyPath = null;
                            
                            // VS 2017 puts MSBuild stuff (where PDBCopy lives) under the Visual Studio Installation directory
                            DirectoryReference VSInstallDir;
                            if (WindowsExports.TryGetVSInstallDir(WindowsCompiler.VisualStudio2017, out VSInstallDir))
                            {
                            	PDBCopyPath = FileReference.Combine(VSInstallDir, "MSBuild", "Microsoft", "VisualStudio", "v15.0", "AppxPackage", "PDBCopy.exe");
                            }
                            
                            // Earlier versions use a separate MSBuild install location
                            if (PDBCopyPath == null || !FileReference.Exists(PDBCopyPath))
                            {
                                    const string VSCommunity = @"E:\Program Files\Microsoft Visual Studio\2017\Community";
                                    PDBCopyPath = FileReference.Combine(VSCommunity, "MSBuild", "Microsoft", "VisualStudio", "v15.0", "AppxPackage", "PDBCopy.exe");
                            
                                    if (PDBCopyPath == null || !FileReference.Exists(PDBCopyPath))
                                    {
                                     }
                            }
                            OnlineSubsystemLive.Build.cs
                            Code:
                            public class OnlineSubsystemLive : ModuleRules
                            {
                            	// Should match versions in GetXboxLiveSDK.ps1
                            	readonly string XsapiVersionUwp = "2017.07.20170710.001";
                            	readonly string XsapiVersionXboxOne = "2017.05.20170517.001";
                            	readonly string CppRestVersion = "2_9";
                            }

                            GetXboxLiveSDK.ps1
                            Code:
                            # Package versions.  Should match OnlineSubsystemLive.build.cs
                            $xsapiVersionUwp = "2017.07.20170710.001"
                            $xsapiVersionXdk = "2017.05.20170517.001"

                            The script reports that the SDK is installed, and already installed. However GenerateProjectFiles.bat shows the following error:

                            Code:
                            Error: Xbox Live SDK (version 2017.07.20170710.001) not found.  Run Engine/Plugins/Online/XboxOne/OnlineSubsystemLive/GetXboxLiveSDK.ps1
                            What am I missing?

                            Btw, ThirdParty\XSAPI only shows the XboxOne SDK not the UWP as before.

                            Click image for larger version

Name:	alreadyInstalled.jpg
Views:	1
Size:	80.8 KB
ID:	1130977
                            Last edited by Jerry.Richards; 07-11-2017, 06:59 PM.

                            Comment


                              Ugh, after download and unpack the version number on the NuGet package is 2017.07.20170710.01 (note one 0, not two). So that's the string that needs to go in the download script and build.cs. Would be nice if this were consistent...

                              Side note: I'm a bit concerned that you still need to make the adjustment for PDBCopy - does WindowsExports.TryGetVSInstallDir not already report "E:\Program Files\Microsoft Visual Studio\2017\Community" in your environment?

                              Comment


                                Originally posted by jsyarrow View Post
                                Ugh, after download and unpack the version number on the NuGet package is 2017.07.20170710.01 (note one 0, not two). So that's the string that needs to go in the download script and build.cs. Would be nice if this were consistent...

                                Side note: I'm a bit concerned that you still need to make the adjustment for PDBCopy - does WindowsExports.TryGetVSInstallDir not already report "E:\Program Files\Microsoft Visual Studio\2017\Community" in your environment?
                                Removing the 0 from the script and OnlineSubsystemLive.Build.cs fixed the GenerateProfectFiles.bat error and the SDK is downloaded properly now.

                                Code:
                                // Should match versions in GetXboxLiveSDK.ps1
                                readonly string XsapiVersionUwp = "2017.07.20170710.01";

                                As for the PDBCopyPath problem, without my change I wasn't able to Package my game with UWP in the UE4 Editor. I can try it again though and let you know later. . .
                                Last edited by Jerry.Richards; 07-11-2017, 07:36 PM.

                                Comment

                                Working...
                                X