-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux compatibility #54
Comments
Linux Note:Every game installed through Steam (and by extension, Proton) installs in separate Wine bottle / prefix, so searching the registry via Proton will produce no results as every instance is isolated. For Proton, either there will need to be a solution for detecting the MCC bottle/prefix some other way or the user may have to target it themselves until such a solution is found. For plain Wine, this *shouldn't * be an issue (don't quote me on that) because the user would already know to run the installer through the associated Wine bottle/prefix themselves in order to detect the installation of either Windows Steam or an original CE install. |
That's...stupid. That breaks apps that depend on other apps' Registry entries. btw, I have to confess that Linux compatibility is and always has been a low priority because it requires a huge rework. However, even those are a low priority after having migrating to .NET 5 a few months ago. The decision to ditch .NET 4 because its SDK irritated me has come back to haunt me. Any new decisions involving the installation procedure will not make it in time for SPV3.3.1 which has been delayed far too long. |
That said, the main reason Valve has it set up this way is because not every game has the same dependencies and, if something goes wrong with a prefix, they have them separated to minimize the potential damage it might have on games that would theoretically share that prefix (like using different Proton versions for specific games because that "updates" the prefix)
That's understandable, it's the case for many projects; usually though, that's just incentive to think about compatibility from the outset rather than an after-thought for future projects because it avoids anyone having to do extra work later On a related note, MAUI seems to not support Linux at the moment - it brought MacOS support first:
EDIT: That aside, GTK# has another potential problem, functionally: it might not be compatible with .NET 5 As for packaging a theoretical native installer for distribution, this would be best done with an AppImage; they have self-updating features, don't have permission issues associated with other distro-agnostic packaging formats, and can be portably used on any drive - mitigating risks, also presented with other packaging formats, that could potentially eat an OS's drive space |
The gtk appearance is a non issue. I can make it look like anything and force it to use that look cross platform. I'll say let's start with it without MCC validation and once we at least got the game working and installing then we can look into it. |
That's good, then I'd be down for GTK but the main issue here is that it would mean switching to a toolkit @BinToss would be unfamiliar with at the moment That said, going backwards after just moving to .NET 5 might sound frustrating, especially when I know Bin was interested in moving to .NET 6 for MAUI to find out that it isn't cross-platform with Linux yet :/ If GTK is decided, I'll look into checking out the toolkit |
So our current options for a multiplatform GUI is limited to GTK or UNO.
Luckily, netstandard2.0 and netcore3.0 are both forward-compatible with net5.0 and net6.0. Probably net7.0, too. Yes, you read that right: net6.0 isn't stable, yet net7.0 already has preview releases.
net6.0 will have fewer benefits for our projects due to delays in development of WPF's compatibility with IL Trimming and MAUI's lack of support for Linux. The former has been delayed to net7.0. |
I've added a new header to the OP titled "Multi-Platform Alternatives to WPF/WinForms" with our current suggestions and some new ones. Multi-Platform Alternatives to WPF/WinForms |
I didn't even know Qt had .NET bindings 😮 |
On Linux OSes, developing with UNO is rather limited in regards to target platforms when compared to macOS and Windows. |
|
Everything related to DRM (including MCC CEA detection) will be removed from or skipped in SPV3.3.1. This means...
|
The game's location (via SteamID) can be found in: As for the DRM being dropped, I'm a bit surprised; I hadn't expected that - why drop MCC's detection? |
Regarding GUI, Avalonia is the most appealing atm. the https://github.com/AvaloniaUI/Live.Avalonia NuGet package provides Live Reloading XAML on Linux distros, but it does not provide in-IDE XAML design. For the past month or so, I've been rewriting the "Compress Install folder on NTFS" feature to use Kernel32 P/Invoke instead of WMI. |
Wine can be detected at runtime, for the Win installer, so you can just detect and disable the NTFS code; I actually know a project that did this recently, though not due to NTFS specifically: Though, for a native installer, that code would have to be avoided, yeah :p |
As far as I'm aware though, there aren't any XAML design options for IDEs outside of Visual Studio (non-Windows exclusive IDEs); it's still nice it has live-reloading but we're not going to find a Linux XAML designer anywhere until some 3rd party is actually bold enough to make one, unfortunately :/ |
On top of .NET Framework 4.8 Runtime's poor quality on WINE, it doesn't support the C# 9 extensions present in some CsWin32 generated code. Only .NET 5 and up are guaranteed to support these extensions. .NET SDK 6.0.300 can compile SingleFile (all-in-one) executables for Windows 7 SP1 which solves the loose, unavailable, or wrong-version dependencies problems, but I'll need to get rid of WPF and WinForms because they are trim-incompatible and add at least 50MiB to a Self Contained deployment. This is the reason why I'm looking into alternative GUI platforms. However, .NET 5+ Windows executables don't run on WINE. I'll have to build and release separate executables for Linux and MacOS. |
Honestly, I wouldn't be too hard-pressed about MacOS support considering supporting OpenGL and Vulkan via anything (including Wine) is a nightmare and a half because of Apple; not going to talk you out of that, of course, just a heads up reminder I'm sure you might have heard of. That aside, yeah, The meat of this will mainly be the cross-platform GUI; the DLL-mod management will just be moving stuff in and out of the game directory, I take it, right? |
I had completely forgotten about that. The only Mac user I know of is Masterz, the project lead SPV3 and Legacies. IIRC, he uses a somewhat older MacBook c. 2015. I don't know of any other Mac users.
Yup. The hard part will be Wine/Proton management.
Indeed. The only data needed from a DLL is the version info and other assembly info, filename, extension, dates, and hashes for verification and file integrity. Regarding the GUI framework, UNO has a cross-platform, out-of-editor visual designer provided by Figma. |
Unfortunately, I can't afford a JetBrains Rider subscription ☠️ |
https://stackoverflow.com/a/970134/14894786 |
@JediMasterChief notified me in Discord that they'll be documenting their steps for Lutris/Proton compatibility this weekend. |
Note: the instructions will not be valid for SPV3.3.1. Linux support will be in the form of native Linux executables where possible and a Mod Loader in the form of
JediMasterChief — Today at 11:47 AM (2022-09-04)
|
How do we ensure haloce.exe (or any app for that matter) runs on the highest-performance GPU on any given Linux distro? P.S. load-balancing across all discovered dGPUs and iGPUs would be best, but is outside the scope of this project. The main goal for this specific query is to prevent the game from running exclusively on the power-saving iGPU without renaming the EXE to "halo.exe". Most drivers have a GPU-accelerated profile for "halo.exe", but not "haloce.exe". Changing the filename may have unexpected side effects. |
@BinToss This is typically handled by the user; in hybrid-GPU scenarios, Optimus (Intel+Nvidia) would be invoked by the user either through Steam client launch options or with Lutris (non-Steam game launcher) Typically, doing this through steam directly is more difficult when using Proton, specifically, because Steam's UI for invoking environment variables and telling Proton what to do is a bit of a mess; I'd advise launching the executable by using "PRIME render offload" somehow, either by the to-be native launcher doing this itself or with a bash script: As for Intel CPU + AMD GPU / AMD APU + AMD GPU combo specifically, I can't say because I'm not personally familiar with it I think the Linux GPU drivers should be acceleratated in discrete-only systems, otherwise, for the game |
Which reminds me, now that you ask, users should be encouraged to have gamemode installed, for better performance; we should also detect if this is installed (or include it ourselves) and load this library to keep performance up |
Related news:
|
NOTES
DEPENDENCIES, RELATED ISSUES
RELATED LINKS
KEY ISSUES
DEPENDENCY: MahApps.Metro
This GUI framework aids in the creation of Metro-styled GUIs. It is dependent on Window Presentation Framework.
This will be especially difficult to resolve.
Solution
Migrate from WPF to Avalonia
old proposals
A. Try mingling UNO with our dependencies, though that probably won't resolve MahApps.Metro's WPF dependency nor WPF's dependency on Windows runtimes.
B. Completely migrate away from MahApps.Metro and WPF to Avalonia, GTK#, QtSharp, Qml.NET, or UNO.
Windows Registry
See HaloSPV3/HXE#217
Steam
Pseudo-DRM was dropped. No more Steam issues...for now.
Path inference of MCC based on location of Steam.exe
Unix OSes don't use the Win32PE EXE format. As such, there won't be a Steam.exe to locate.
Possible Solutions
A. If
System.Environment.OSVersion.Platform
returnsPlatformID.Unix
, prompt the user to locate a 'Steam' assembly without requiring a file extension.B. Allow the user to input the path to 'halo1.dll'. This would require the least amount of development time, but it forces more work upon the user if they choose this method to validate ownership of "Halo CE". As usual, the frontend would be implemented in
SPV3
using the pre-existing backend inHXE
.ROAD PLAN
There are two routes we can take to resolve this issue.
STOPGAP MEASURES
Platform-dependent code paths will be determined at runtime. This implies the following:
System.Environment.OSVersion.Platform
to determine which OS we're running on. In most cases, we'll see eitherWin32NT
orUnix
. All possible values.MS Docs Example:
BUILD FOR EACH PLATFORM
UNO, .NET 6's MAUI, or another GUI framework to assist in maintaining our WPF-reliant, MahApps.Metro-powered GUI.or adapted to work with Proton and WINE. The Windows Registry is required to determine if Retail or Custom Edition was installed legally. How does Proton and WINE handle that?Multi-Platform Alternatives to WPF/WinForms
GTK (GTK#)MAUImain repo does not have GTK bindings for Linux desktop compatibility. Some forks have bindings to GTK. MAUI does not support Windows 7.Qt (QtSharp or Qml.NET)UNOFormerly tracked in HaloSPV3/HCE#249.
The text was updated successfully, but these errors were encountered: