Hi, I am currently working on a Cross-Platform Project. On Win64,Win32,Mac,Linux I want to use Steam with plugin SteamParty which has me create a game instance from SteamBeaconGameInstance.
However, since XBox and PS4 do not use Steam, I imagine I will need to derive from a different game instance.
If this is correct, I would like to know how to make it use a specific game instance depending on which platform I am using.
(NOTE: I am currently not working with XBox and PS4 platforms yet, but want to know about setup for the future.)
Since I don’t think you’re able to change the game instance in the project during runtime you may be better off adding all of the code to a single instance, and then choosing which code to run based off of the string output using the “Get Platform Name” node. I’m not sure how to use that node in C++, but there may be some documentation online for it. Hope this helps, but maybe others can find a better solution.
Look into EngineMapsSettings class within the EngineSettings API module, the Engine code uses it to read what GameInstance class your game uses (that dropdown menu property in your Project Settings. I think though, you’d have to compile UE from source code so you are able to modify it as per your needs (i.e. choosing before the game starts, which GameInstance is appropriate for the detected platform rather than what is selected in that drop-down button.).
EDIT: I don’t remember last time I looked into it, but perhaps you could derive from it and write that custom logic yourself?