I’d like a SteamDeckGame.ini and SteamDeckEngine.ini etc.
How do I do this? I can’t see any way to differentiate it from Windows when using Proton or Linux without. Its inadequate.
I’d like a SteamDeckGame.ini and SteamDeckEngine.ini etc.
How do I do this? I can’t see any way to differentiate it from Windows when using Proton or Linux without. Its inadequate.
Yep same problem here too. Im not sure what steam deck device profile is? does unreal treat is like pc or linux?
Yes it uses either the Windows or Linux device profile depending on whether you use Proton or Native Linux.
Because Steam doesn’t allow you to differentiate between Steam Deck builds, its often a bad idea to use Native Linux even though it often works better, because then you’re stuck supporting all the weird linux configurations that random users manage to screw up and expect support for.
I have been able to use the DefaultDeviceProfiles.ini for most things:
[DeviceProfiles]
+DeviceProfileNameAndTypes=Deck,Windows
[Deck DeviceProfile]
DeviceType=Windows
BaseProfileName=Windows
bIsVisibleForAssets=True
[Windows DeviceProfile]
DeviceType=Windows
BaseProfileName=
bIsVisibleForAssets=True
However, the main reason I need it can’t use device profiles:
[/Script/WindowsTargetPlatform.WindowsTargetSettings]
DefaultGraphicsRHI=DefaultGraphicsRHI_DX12
I can’t add this for Steam Deck to default it to DX11.
Thanks largely in part to @sswires on Unreal Source Discord we have a solution to make SteamDeck use it’s own config files.
Create a plugin, set the LoadingPhase to EarliestPossible
or figure out the correct one for you - I need to change RHI and couldn’t be bothered testing for when it is set (the plugin needs to load before this).
My plugin is called SteamDeckConfig
.
I add these two functions to the FSteamDeckConfigModule
:
STEAMDECKCONFIG_API static bool IsRunningOnSteamDeck();
STEAMDECKCONFIG_API static bool IsRunningOnSteamDeck_EarlyInit();
You can of course leave these out entirely, but I wanted to use them elsewhere too.
Implement the functions:
bool FSteamDeckConfigModule::IsRunningOnSteamDeck()
{
if (!FSteamSharedModule::IsAvailable())
{
// Load the module
FSteamSharedModule::Get();
}
// Use SteamUtils if it is available
if (FSteamSharedModule::IsAvailable())
{
if (SteamUtils())
{
return SteamUtils()->IsSteamRunningOnSteamDeck();
}
}
// SteamUtils() not yet available, often due to the LoadingPhase
return IsRunningOnSteamDeck_EarlyInit();
}
bool FSteamDeckConfigModule::IsRunningOnSteamDeck_EarlyInit()
{
return FPlatformMisc::GetEnvironmentVariable(TEXT("SteamDeck")).Equals(FString(TEXT("1")));
}
Add this to the StartupModule()
function:
// Query the Steam Deck status
const bool bRunningOnSteamDeck = IsRunningOnSteamDeck_EarlyInit();
if (bRunningOnSteamDeck)
{
TArray<FString> ConfigFiles { TEXT("Engine"), TEXT("Game"), TEXT("Input"), TEXT("DeviceProfiles") };
for (const FString& ConfigFile : ConfigFiles)
{
const FString OverrideConfigPath = FPaths::Combine(FPaths::ProjectConfigDir(), "SteamDeck", "SteamDeck" + ConfigFile + ".ini");
FConfigFile* FoundConfig = GConfig->FindConfigFile(ConfigFile);
FoundConfig->AddDynamicLayerToHierarchy(OverrideConfigPath);
const FString OverrideConfigPathB = FPaths::Combine(FPaths::ProjectConfigDir(), "SteamDeck", "SteamDeck" + ConfigFile + ".ini");
}
}
Now go to your project’s Config
folder (next to the Content
folder and create a SteamDeck
subdirectory. Add SteamDeckEngine.ini
and the other ones you need, probably copy most/all of whats in your DefaultEngine.ini
over as a starting point then modify as needed.
Make sure the plugin is enabled in your project, and it will now load these when running on Steam Deck.
Hey! Thank you so much for all the info you shared here.
I’m curious, why do you want to set SteamDeck to default to DX11?
Advice from experienced devs says DX11 is more stable and performant on Steam Deck. I didn’t test it myself.
One last question, in the code you shared, in StartupModule
you are calling IsRunningOnSteamDeck_EarlyInit
.
Why?
IsRunningOnSteamDeck
will call EarlyInit if the module is not available. Is that a mistake or on porpouse?
Anyone else having issues with “Module not found”, it’s because LoadingPhase being set to EarliestPossible.
Changing it to PostConfigInit should fix the issue.
Also, check if you have OnlineSubsystemSteam as Plugin dependency in your plugin
Because there is no point in testing for a module that will never exist at that point.
PostConfigInit is not guaranteed either. And more importantly, it needs to load this plugin before the RHI to set the default RHI.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.