Skip to content
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

[GOG]: use native builds of ScummVM and DOSBox when available #3797

Merged
merged 2 commits into from
Jul 23, 2024

Conversation

imLinguin
Copy link
Member

Tested with Alone in the Dark 1 (dosbox) and Beneath the Steel Sky (scummvm)

gogdl will pick available versions with following conditions

  • alternative executable isn't set (Game Settings -> Advanced)
  • executable is either dosbox.exe or scummvm.exe

possible executables gogdl will look for

Flatpak PATH
DOSBox io.github.dosbox-staging dosbox
ScummVM org.scummvm.ScummVM scummvm

when gogdl is in flatpak container it will attempt to call flatpak-spawn available through org.freedesktop.Flatpak session bus.

If none of the above are available default wine runner will be called

updated to gogdl 1.1.0 that includes this change

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@imLinguin imLinguin added the pr:ready-for-review Feature-complete, ready for the grind! :P label May 30, 2024
@imLinguin imLinguin requested review from a team, arielj, flavioislima, CommandMC, Etaash-mathamsetty and Nocccer and removed request for a team May 30, 2024 13:49
@imLinguin imLinguin linked an issue May 30, 2024 that may be closed by this pull request
@JKingweb
Copy link
Contributor

Would it make sense to also look for DOSBox-X? I'm not a DOSBox-X partisan myself, but it definitely has its adherents, and I can't think of any reason it couldn't also be used.

This would necessitate searching for com.dosbox_x.DOSBox-X and dosbox-x.

@imLinguin
Copy link
Member Author

I seem to be unable to run Alone in the Dark with DOSBox-X flatpak. It complains about missing CD-ROM driver, similarily to com.dosbox.DOSBox. So for compatibility with GOG's windows builds, staging seems to be the only option.

We may also need to add additional PATH lookup of dosbox-staging sometime in the future, various distro packages seem to be inconsistent about it. As far as I know Fedora has dosbox binary for staging while Arch package has it as dosbox-staging. I'll leave that for now, we can reconsider this later on

@JKingweb
Copy link
Contributor

Ah, right, DOSBox Staging is more forgiving when it comes to path matching. Makes sense.

public/bin/darwin/gogdl Outdated Show resolved Hide resolved
@Nocifer
Copy link

Nocifer commented Jun 1, 2024

As far as I know Fedora has dosbox binary for staging while Arch package has it as dosbox-staging. I'll leave that for now, we can reconsider this later on

Arch's dosbox-staging package has the binary as simply dosbox as well, so there shouldn't be any problem on that front.

Copy link
Collaborator

@CommandMC CommandMC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this with a couple games and it does appear to be working fine.

Could you link to the commit hash of gogdl we're now using? I assume it's 7c9a6f4?

@imLinguin
Copy link
Member Author

I just found out this breaks compatibility with Diablo
due to it relying on drive letters in paths. I'm open to suggestions on how should we approach this.
One thing that comes to my mind is hardcoding the drive letters for everything except games with ScummVM

@imLinguin imLinguin added pr:wip WIP, don't merge. and removed pr:ready-for-review Feature-complete, ready for the grind! :P labels Jul 12, 2024
@imLinguin imLinguin added this to the 2.15.0 milestone Jul 12, 2024
@imLinguin imLinguin added pr:ready-for-review Feature-complete, ready for the grind! :P and removed pr:wip WIP, don't merge. labels Jul 16, 2024
@hfc2x
Copy link

hfc2x commented Jul 20, 2024

I just found out this breaks compatibility with Diablo

It probably breaks compatibility with Carmageddon and Tomb Raider (GOG versions) as well, due to the configuration files that come with those games also hardcode the DOS paths, along with whatever is included in the CUE file replacement they use. In the case of both games, it's named GAME.DAT, and the "BIN" file they reference is in lowercase, which causes DOSBox not find it for some reason.

What I did on my end to be able to play these games through Lutris was copy the config they come with by default, back up the old config, and use the modified configs to launch them, which includes changes such as replacing backslashes with forward slashes. I also modified the "CUE" files to all-uppercase so DOSBox can find the "BIN" file properly.

It's a bit of a pain, especially because I use dosbox-staging, which also changes a lot of the settings (for example, imgmount -t cdrom for normal DOSBox becomes imgmount -t iso in staging).

That's the only solution I've come up with lol. There's probably a more streamlined way of doing it, like having a database specifically for DOSBox configuration file changes so no fiddling is required from the user's part.

@CommandMC
Copy link
Collaborator

Perhaps make this an experimental feature, disabled by default? Or maybe just an option in the game settings?

Aside, now that #3849 is merged, this PR no longer needs to modify the gogdl binary

@imLinguin
Copy link
Member Author

imLinguin commented Jul 21, 2024

I'll rebase the branch to remove the gogdl binary. I feel like there is no need for this to be experimental, there are no known implications from using this. I have modified the way we do the setup so that only scummvm games will use Linux paths (without drive letters), working around the issue I mentioned earlier.

@CommandMC
Copy link
Collaborator

I see, it wasn't clear to me that the commit was related to that issue (I assumed "relying on drive letters in paths" meant that it relied on them while actually launching the game, so a commit changing how the setup worked didn't seem relevant)
In that case yes, definitely keep it how it is right now

@imLinguin imLinguin merged commit a519c74 into main Jul 23, 2024
9 checks passed
@imLinguin imLinguin deleted the feat/native-gog-runners branch July 23, 2024 16:55
@Heroic-Games-Launcher Heroic-Games-Launcher locked and limited conversation to collaborators Jul 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr:ready-for-review Feature-complete, ready for the grind! :P
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Launch DOS games using native system DOSBox
6 participants