question

Cedric Neukirchen avatar image
Cedric Neukirchen asked

XPlatCPP SDK - UE4 - Xbox

Hey everyone,

we got the XPlatCpp SDK working in UE4 for Windows, but that's obviously nothing special, because I could just use the Plugin you peeps already made.

We do however need this to work on Linux and Xbox too and following your "C++ Quickstart for Xbox" is really tricky, because it requires a lot of steps that might not be needed when using UE4.

(Note: The JSON Library you peeps use defines "JSON_API", and so does UE4. The Library expects this to be undefined. If you ever have peeps coming in that can't get this SDK working in UE4, that's most likely the problem. We ended up changing the definition to JSON_PLAYFAB_API and it works now.)

So my question now is: What do I need to do in order to produce library files of the SDK for Xbox?
Compiling them for Windows was easy enough, but I'm not sure if I actually have to create custom Xbox files or if the Windows ones work here too.

I most likely have to create Linux ones, but that's for later.

I'm currently using this (custom) function in the build.cs of our project (or plugin if you want):

private bool LoadPlayFabXPlatformLib()
{
    string LibrariesPath = Path.Combine(ThirdPartyPath, "PlayFabXPlatformLibrary");

    bool bIsLibrarySupported = false;
    if (Target.Platform == UnrealTargetPlatform.Win64)
    {
        bIsLibrarySupported = true;

        string PlatformString = "x64";
        PublicLibraryPaths.Add(Path.Combine(LibrariesPath, PlatformString));
        PublicAdditionalLibraries.Add("lib_json.lib");

        PublicLibraryPaths.Add(Path.Combine(LibrariesPath, PlatformString, "XPlatCppWindows"));
        PublicAdditionalLibraries.Add("XPlatCppWindows.lib");
    }
    else if (Target.Platform == UnrealTargetPlatform.XboxOne)
    {
        bIsLibrarySupported = true;

        string PlatformString = "XboxOne";
        PublicLibraryPaths.Add(Path.Combine(LibrariesPath, PlatformString));
        PublicAdditionalLibraries.Add("lib_json.lib");

        PublicLibraryPaths.Add(Path.Combine(LibrariesPath, PlatformString, "XPlatCppXbox"));
        PublicAdditionalLibraries.Add("XPlatCppXbox.lib");
    }

    if (bIsLibrarySupported)
    {
        // Add Include Path
        PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "PlayFabXPlatformInclude"));
    }

    return bIsLibrarySupported;
}

The windows part works fine, but I'm not sure about "lib_json.lib" and "XPlatCppXbox.lib".
They are just the copy pasted and renamed versions of Windows.

I tried opening the Xbox SDK SLN file, but I'm kinda sure I can't just compile that, cause the Target is Xbox, not x64.

Would be really awesome if someone could share some wisdom with me here.


Kind regards,
Cedric

PS: It would be awesome if you peeps from PlayFab either upgraded the UE4 Plugin to support the other two platforms or if you could at least make a guide to include this SDK into a UE4 project.

PS2: Why did you recreate the SDK from scratch for UE4 instead of just using the library and wrapping it into some exposed UE4 functions/variables?

sdksunreal
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image Seth Du ♦ commented ·

I will inform our team about your questions on CppSDK.

1 Like 1 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

We recommend to continue to use the marketplace plugin when working with UE4 and Xbox. Meanwhile for now, you still need to manually install the library and it should work.

>>I tried opening the Xbox SDK SLN file, but I'm kinda sure I can't just compile that, cause the Target is Xbox, not x64.

Which project are you looking at? What’s the meaning of targeting Xbox? Do it mean a target configuration in Visual Studio? If so, you can change it: https://docs.microsoft.com/en-us/visualstudio/ide/how-to-create-and-edit-configurations?view=vs-2019

Besides, we are not expert on XBOX, it will be better to get dedicated support form Xbox developer community.

11 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Cedric Neukirchen avatar image Cedric Neukirchen commented ·

>> We recommend to continue to use the marketplace plugin when working with UE4 and
>> Xbox. Meanwhile for now, you still need to manually install the library and it should work.

We asked how to use PlayFab with UE4 on Xbox and Linux and we were told that we have to use the Cross Platform SDK. We removed the Plugin (Blueprint Implementation) and moved everything to C++ with the Crossplatform SDK now. This is not something we will change back. It's also a bit annoying that we get two different answers, cause this costs production time.

>> Which project are you looking at? What’s the meaning of targeting Xbox?

Well, the Xbox Solution of the Crossplatform SDK of PlayFab, which can be found in the Build folder, next to the Windows Solution (which works). It only has a Target for Xbox (or rather "Durango") and I'm not sure if changing it to Win64 solves the problem.

I basically want to know how to produce the library files of PlayFab's SDK for Xbox and Linux.
That's not really something I want to bring over to the Xbox Dev Forums, as the question directly affects PlayFab's SDK.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Cedric Neukirchen commented ·

We have noticed the differences answers that was delivered to you and will discuss it in the team. I keep this thread updated if there is any feedback.

0 Likes 0 ·
Cedric Neukirchen avatar image Cedric Neukirchen Seth Du ♦ commented ·

Would be nice if you could put someone onto this thread who knows more about the C++ SDK and how to properly build it for Linux and Xbox.

This is pretty time-consuming for us at the moment. I tried following the Linux quickstart in the meantime, but more than "Our Linux SDK is currently broken." did not come around.

0 Likes 0 ·
Show more comments
Cedric Neukirchen avatar image Cedric Neukirchen commented ·

@Andy Right, we had the PlayFab UE4 Plugin installed before we were told that it doesn't support Linux and Xbox. Multiple threads said the same. The plugin was located in our Plugins folder (Project-Level) and it wasn't compiling for Linux. The Dedicated Server simply crashed cause of the missing BP Nodes.

What's the difference between your approach and what we already had implemented? I would like to confirm this now first before switching SDKs again.

Does Step 2. mean to take the Unreal Plugin from an engine Folder, after it got added to the current engine version via Marketplace download, and then move it to project level? Because we had that already.

0 Likes 0 ·
Andy avatar image Andy ♦♦ Cedric Neukirchen commented ·

We'd have to see the actual compiler errors to know how to resolve the problem. Do you have an existing thread with that information? Our expectation is that it should absolutely compile for Linux (it has for sample projects).

I agree that it doesn't sounds like there's much difference between the simple steps I provided and what you were already doing, though. Still, in theory, getting the marketplace plugin working across the platforms you're targeting should be more straightforward than trying to shoehorn the xplat SDK into UE4 targeting Xbox.

0 Likes 0 ·
Cedric Neukirchen avatar image Cedric Neukirchen Andy ♦♦ commented ·

Sorry for being vague here. With "It wasn't compiling for Linux" I meant that it didn't produce any binaries for it. The project itself packaged fine for Dedicated Server - Linux, but it never actually included the PlayFab Plugin. There were no errors or warnings. I only noticed because the DedicatedServer crashed, reporting that types and functions of Playfab, used in Blueprints, weren't existing.

That was the point I noticed there weren't any Binaries for Linux. I then went to the forums and asked about it. That's when I was told to use the cpp sdk. This was my thread: https://community.playfab.com/questions/30481/unreal-engine-4-linux.html

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.