ValveSoftware / Proton

Compatibility tool for Steam Play based on Wine and additional components
Other
24.29k stars 1.06k forks source link

Add Native DOSBox support (Feature Request) #1566

Open martynhare opened 6 years ago

martynhare commented 6 years ago

Feature Request

Add Native DOSBox to Proton

I confirm:

Description

Extend Proton and/or the Steam Runtime to use native Linux DOSBox for DOS-based games.

Justification [optional]

Wine doesn't offer proper DOS games support. DOSBox is a separate project. Adding it to Proton would allow to integrate patches for controller support amongst other features. Also, add this and all the DOSBox games for Windows will start "just working" via Steam Play on Linux. Easy way to bolster the Steam Play library, benefitting Valve commercially.

However, it may be worth considering adding this to Steam Runtime instead and claiming Linux-native compatibility on all the DOS games. This would bolster the library of games showing as made for SteamOS boosting the native library with very little work and a large return.

Risks [optional]

If applied as a Steam Play solution, customers may think the games rely on Wine.
To mitigate this, apply the change at the Steam Runtime level and mark all the games as Linux-compatible instead without claiming the games need Steam Play to work.

References [optional]

Examples of games that would benefit include:

Business Case

See Justification/Risks above. This is a change which if done at the Steam Runtime level, could provide a large ROI for a very minor risk and very little work.

kisak-valve commented 6 years ago

Related: https://wiki.winehq.org/DOSBox

aeikum commented 6 years ago

It's an interesting idea. I'm not sure how we'd go about doing it. Maybe detect the DOSBox program is being invoked and use Wine's existing DOSBox integration instead of launching the win32 DOSBox? Also, I worry about games which may ship a modified DOSBox. Does anyone do this?

CentralPython commented 6 years ago

It's an interesting idea. I'm not sure how we'd go about doing it. Maybe detect the DOSBox program is being invoked and use Wine's existing DOSBox integration instead of launching the win32 DOSBox? Also, I worry about games which may ship a modified DOSBox. Does anyone do this?

What about that Master of Orion 2 game? That game which I have uses DosBox is that a modified version or not? I kinda like this idea but it should be made to work with modified DosBox versions as well so that they'll work as normal like other default DosBox games that aren't modified.

Glog78 commented 6 years ago

https://github.com/duganchen/dosbox/ best fork of dosbox in my eyes it adds what needed on a modern system included SDL2 and shaders.

parkerlreed commented 6 years ago

There's also https://github.com/joncampbell123/dosbox-x

Ruedii commented 6 years ago

I wonder if DOSBox in general should be added to the Steam Runtime to ease porting of old DOS games.

It should also be added if there is ever a Steam Win32 Runtime released (along with SDL and GTK/GTK+ as well as a GTK theme matching the Steam interface. Possibly also add Bash and Python as well to encourage developers to learn to use those.)

thaewrapt commented 6 years ago

I believe dosbox.exe is provided for such games by the developer, not Steam, so marking those as Linux-compatible may rely on their own decision and should be addressed to them directly as the first resort. The possible solution of detecting issues on proton-level (and providing some kind of wrapper and/or substitute between Linux/Wine dosbox and shipped dosbox.exe) seems legit anyway.

dolour commented 5 years ago

Totally agree, DOSBox in general should be supported out of the box. I mean, theres quite a substantial amount of old titles that could easily be added to the "Steam OS and Linux" roster, with allmost zero effort. Not that resorting to Lutris to keep those games organised would be a dealbreaker, but it certainly would be more convienient to not have to deal with another launcher. :p (As much as i like Lutris, id prefer to reserve it for emulator and non-steam stuff.)

aeikum commented 5 years ago

What problems are you having with DOSBox games run in Proton?

dolour commented 5 years ago

Alot of the DOS games in my library dont have any Proton support, thats kinda the whole point. :p

aeikum commented 5 years ago

Can you name some games?

dolour commented 5 years ago

Sure, KOTOR1(not sure if thats actually still a DOS game), XWing/TIE Fighter/Alliance, the Space Quest Collection, the Thief series, I-War, MOO3, and certainly many more. With Steams massive library their maybe just an oversight, but it would be nice to see all the old DOS titles getting an install script.

aeikum commented 5 years ago

I tried all 6 Space Quest games in the Space Quest Collection and they seemed to work fine in Proton 4.2-2. What problem are you having with Space Quest?

Edit: Actually, there is a known issue where the Steam Overlay can cause DOSBox games to crash. You can disable the Steam Overlay to work around this until it is fixed.

dolour commented 5 years ago

You can allso LD_PRELOAD the correct overlay to prevent those crashes. But thats kinda the point, some of those games work just fine but arent listed as linux titles, while others just require a symlink or variable to run. What im saying is, give that some love and make it a "one click install" expirience, since most of that stuff runs just fine anyways.

Ruedii commented 5 years ago

Part of the issue is some older versions of DOSbox have trouble with wine. However, considering that not every DOSbox stack is identical, I would suggest compiling a built-in to replace DOSbox.

On 8:56AM, Tue, Apr 16, 2019 dolour <notifications@github.com wrote:

You can allso LD_PRELOAD the correct overlay to prevent those crashes. But thats kinda the point, some of those games work just fine but arent listed as linux titles, while others just require a symlink or variable to run. What im saying is, give that some love and make it a "one click install" expirience, since most of that stuff runs just fine anyways.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

aeikum commented 5 years ago

Again, what games are you having problems with? What problems are you having?

omicron-b commented 5 years ago

I have an issue with some DOSBox games (The Ultimate Doom, Doom II: Hell on Earth, Heretic: Shadow of the Serpent Riders) where mouse polling rate heavily affects performance, like total freeze with polling rate of 500 Hz on low end laptop or going from 35 FPS to 5-15 on AMD Ryzen 5 PC. Issue is present in Proton 3.7-8 - 4.2-3 , Steam Overlay disabled. Link to issue: https://github.com/ValveSoftware/Proton/issues/1534

Issue is not present when running these games with DOSBox natively, also not present in some other games: Quake, Strife: Veteran Edition.

dreamer commented 5 years ago

@m-svo I just released Steam compatibility tool to run DOS games on Steam through native dosbox: https://github.com/dreamer/steam-dos/releases/tag/v0.1.0

steam-dos

I don't own the games you mentioned, and will likely need help to whitelist them in my tool - if you're interested in helping, create an issue for my project - thanks!

@aeikum I have number of issues with DOS games as well :(

Overall games running windows-version of dosbox have very "sluggish" cursor and sometimes impossible tearing.

I found that Wine already delegates running DOS binaries to native dosbox, but Steam games usually launch dosbox.exe directly or through other windows binaries. Overall there are differences between linux and windows, that result in e.g. supplied .conf files being incompatible. Most of these issues are caused by linux dosbox being case-sensitive when it comes to file handling (including content of .conf file) while windows version of dosbox is case-insensitive. Game developers usually don't care about this when developing .conf files.

aeikum commented 5 years ago

Dark Forces seems to behave the same on 4.2 and 3.16 for me. The cursor is responsive. Alt-tab leaves fullscreen, but this is actually true also on Windows.

There is a known issue in the Steam Overlay that causes DOSBox games to crash. We've reported it to Valve but they haven't looked into it yet. Disabling the Overlay for the game in the Steam client is a workaround.

dreamer commented 5 years ago

Yup, the crash in X-COM was related to Steam Overlay - is there an issue for this in steam-for-linux repo? I can't find any relevant bug.

Thanks to that I separated it from other issue (I thought they are the same): all DOSBox games hang when leaving fullscreen with alt-enter.

kisak-valve commented 5 years ago

Hello @dreamer, add a note to the relevant games you tested in this issue tracker and I'll add the overlay label to go along with it.

Ruedii commented 5 years ago

Native might be very difficult, but a builtin wouldn't be as hard.

A builtin could bypass some of the Wine infrastructure while still operating within the virtual win32 environment.

Any native DOSBox adapter would be well beyond the scope of Proton, but could be implemented as a different specific Steam Play stack.

In fact, adding a Steam Play stack set for DOS games could be made available for Windows users as well. Similar stacks could be made for various non-PC and non-Win64-Compatabile platforms.

For PC platforms, Win16 and CP/M-86 come to mind. For non-PC platforms, CP/M-z80, Apple II, Commodore 64, Amiga, Spectrum Z-80 and all Pre-Dreamcast Sega platforms have legal emulation layer options. (Apple I also has a legal emulation layer, but there aren't any exclusive titles not rebuilt for Apple II). Rights to the necessary firmware for the TI 99/4A and the various Atari systems (Arcade, Console and Computer) are also easily acquirable for large companies. The Dreamcast has some firmware encumbered by Microsoft copyrights, so it may not be as easy to get a hold of. Sega may still be able to release it though, and they have been reasonably easy to negotiate with on these things.

dreamer commented 5 years ago

@Ruedii as I mentioned earlier in discussion - Wine (including Wine bundled with Proton) already does this - whenever PIF file or 16-bit binary is detected, Wine runs it through native DOSBox.

It does not matter, because ALL game developers publishing DOS games on Steam run them through Windows binary of DOSBox (sometimes in a convoluted way, which is not obvious to detect).

In steam-dos I have somewhat-working detection of such situations (including processing of trivial batch files, conversion of .conf files to Linux format, etc), but I am not sure if it's suitable to be merged in Proton.

Ruedii commented 5 years ago

Usually they are literally run in the command "DOSBox.exe" in which case you can simply put in a DLL override for a builtin version on DOSBox.exe

An initial quick build would allow higher efficiency, which may be the slight improvement needed on some high performance games on low performance computers when running in high accuracy mode.

With a little tweaking, direct access to native SDL libraries could be accessed. (SDL is the other library that can have a builtin added to proton.) Furthermore, additional native Linux patches to DOSBox could be added for further efficiency, while still maintaining the ability to operate within the Wine environment for the needs of whatever other utilities ship with the game.

dreamer commented 5 years ago

@Ruedii

Usually they are literally run in the command "DOSBox.exe" in which case you can simply put in a DLL override for a builtin version on DOSBox.exe

It will work maybe for 10% of games, probably less. You need to additionally:

An initial quick build would allow higher efficiency, which may be the slight improvement needed on some high performance games on low performance computers when running in high accuracy mode.

Based on my testing, it's not substantiated. You are more likely to get better performance by disabling sdl.output=surface and tuning cpu.cycles, because publishers putting DOS games on Steam tend to put insane values in their .conf files (or maybe DOSBox on Windows is much more efficient, I don't know).

I started steam-dos to learn what needs to be changed to bring native DOSBox to Proton - and turns out it's not a trivial amount of work. If you want to help, then by all means, drop me a line or create issues or pull requests in my repo.

madewokherd commented 5 years ago

Is it common for games packaged via DOSBox to ship with other tools that need a Windows environment to function?

(Edit: Just remembered I have to be careful with that "collaborator" badge. I find this personally interesting, but I don't know what anyone at Valve thinks about it.)

dreamer commented 5 years ago

Hard to tell, so far I've seen:

Weirdo1312 commented 4 years ago

it would be cool if they would let https://github.com/dreamer/boxtron handle the dos games and include dosbox in steam runtime (if it's not already there) boxtron does a really good job unlike proton in dos games

aeikum commented 4 years ago

This is definitely out of scope for Proton. What @dreamer has done is the right approach, and also really cool.

We should probably move the discussion to the steam-for-linux repo, but I wonder if the right thing to do here is add support for a fixed, system-wide location so Boxtron could be distributed as a distro package, something like /usr/lib/steam/compatibilitytools.d/. Edit: Nevermind! This has been done already.

Or see if Valve is interested in shipping boxtron directly? Seems unlikely though.

dreamer commented 4 years ago

I must agree with @aeikum here - merging Boxtron with Proton is not the right approach. For some games, I needed to implement quite ugly workarounds, that do not fit Proton - and the saddest part is: in most cases, the workarounds are not for games, but for the DOSBox itself!

That's why I started work on dosbox-staging (Vogons thread) - to bring DOSBox step-by-step to the state, where it could, possibly, be merged with Proton, and comfortably run all of the games.

What I have so far:

Once all of the above work will be done, we can think about including native Linux DOSBox in Proton; if it'll be still unfeasible, then at least Linux users will finally have first-rate DOSBox experience :)

If anyone reading this wants to help, there are pleeenty of tasks to go around - programming, code reviews, testing, documenting, packaging, you name it - feel free to contact me via any channel (mail, Discord, Steam chat, GitHub report, whatever).

frostworx commented 4 years ago

Just a little note: I recently added Boxtron support into my steam wrapper "stl": https://github.com/frostworx/steamtinkerlaunch#Boxtron and also for @dreamer's other cool projects https://github.com/frostworx/steamtinkerlaunch#Roberta (for ScummVM games) and https://github.com/frostworx/steamtinkerlaunch#Luxtorpeda (for games with linux native binary)

BenMcLean commented 2 years ago

This seems like something the Steam Deck really needs. Also, some way for users to share mappings of the Steam Deck buttons to the DOS keys would be really nice, so it can be one click for people to start playing a DOS game.

ipr commented 2 years ago

Native version of ScummVM would be nice as well. Beneath a Steel Sky (1368340) has a non-native version of ScummVM, which tries to use text-to-speech API, which isn't supported under Wine/Proton currently.

madewokherd commented 2 years ago

There is a project to launch games with ScummVM so https://github.com/ValveSoftware/Proton/issues/1566#issuecomment-550307305 applies to that as well