applications icon indicating copy to clipboard operation
applications copied to clipboard

[WIP] [com.blizzard.Diablo3] Initial Diablo III flatpak

Open johnramsden opened this issue 7 years ago • 43 comments

Diablo 3 Flatpack

This pull request is for Blizzard's Diablo 3, and is packaged much like Starcraft 2, WoW and OverWatch.

The flatpak is currently runnable, and plays smoothly for me when in 32-bit mode. The last few things are being figured out related to configuration during installation.

I'll continue to update the pull request as things progress.

johnramsden avatar Jun 29 '18 02:06 johnramsden

The nvidia problem might be fixable with this PR as mentioned in the comments. Don't know enough to test it locally myself so I 'm just waiting for it to be merged.

Iolaum avatar Jul 02 '18 17:07 Iolaum

Sorry about the delay, I was on vacation and got back a few days ago.

Thanks for the contribution, added some review comments. I'm building the GL32 fix from winepak/winepak-sdk-images#15 and I'll see if I can push to the repo tonight so you can test. I'll comment when it's added.

julianrichen avatar Jul 10 '18 23:07 julianrichen

We'll also need the appdata & desktop stuff added before pulling.

julianrichen avatar Jul 10 '18 23:07 julianrichen

Thanks, I'll push an update once I've tested if it works.

johnramsden avatar Jul 10 '18 23:07 johnramsden

@johnramsden winepak/winepak-sdk-images#15 was pulled, built, & pushed. Go ahead and update and see if it improves things. Hopefully it works.

julianrichen avatar Jul 11 '18 01:07 julianrichen

Update, I now have it running and the changes seem to have worked. I'll push a commit once I've gotten all the last few details sorted out.

johnramsden avatar Jul 15 '18 03:07 johnramsden

So here is a working version c450d67. Unfortunately, at least for me it's completely unplayable as its quite laggy, i'm not sure if that's just my computer, or if it will be a general problem. I'm hoping someone else has some ideas on what might be causing the bad performance.

Let me know if you have any other change requests.

johnramsden avatar Jul 15 '18 06:07 johnramsden

@johnramsden is there anything I can do to test? I have not messed with winepak before but would love to get D3 to work

jrock2004 avatar Jul 19 '18 18:07 jrock2004

@jrock2004 First add the flatpak winepak repo and install winepak.

flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --if-not-exists winepak https://dl.winepak.org/repo/winepak.flatpakrepo

Install org.winepak.Sdk and org.winepak.Platform.

Clone my repo and checkout.

git clone https://github.com/johnramsden/winepak-applications
cd winepak-applications
git checkout com.blizzard.Diablo3

Now build:

flatpak-builder --user --arch=x86_64 --force-clean --install builds com.blizzard.Diablo3.yml

Then run

flatpak run com.blizzard.Diablo3

I think that's more or less correct.

johnramsden avatar Jul 19 '18 18:07 johnramsden

The manifest visually looks good (haven't tested yet) but because of recent changes to the com.blizzard.BattleNet.BaseApp you'll need to add org.winepak.Platform.Extension.vcrun2015 as an inherit-extensions. See the Overwatch manifest for an example

inherit-extensions:
  - org.winepak.Platform.Compat32
  - org.winepak.Platform.Extension.corefonts
  - org.winepak.Platform.Extension.vcrun2015

@jrock2004 If you have an update version of the BattleNet baseapp you'll need to patch what I mentioned above before testing. Or it'll fail since it won't auto-download the extension. Or just manually install org.winepak.Platform.Extension.vcrun2015 from the repo before installing Diablo3.

julianrichen avatar Jul 20 '18 02:07 julianrichen

@julianrichen I just install winepak right now and have nothing. I ran this command flatpak-builder --user --arch=x86_64 --force-clean --install builds com.blizzard.Diablo3.yml Can't load 'com.blizzard.Diablo3.yml': Failed to open file “/home/jcostanzo/Development/winepak-applications/com.blizzard.Diablo3.yml”: No such file or directory

I changed into the diablo3 directory and got a different error

jrock2004 avatar Jul 20 '18 02:07 jrock2004

Here is that other error

Can't parse 'com.blizzard.Diablo3.yml': :1:6: Parse error: unexpected identifier `app-id', expected value

jrock2004 avatar Jul 20 '18 02:07 jrock2004

@johnramsden maybe I am missing a library to be install to build this?

jrock2004 avatar Jul 20 '18 02:07 jrock2004

@jrock2004 Building fine on my end. What version of flatpak/flatpak-builder do you have? app-id is a valid key type. I'm wondering if maybe you have an older version of flatpak-builder that doesn't support yml and only supports json?

flatpak --version
flatpak-builder --version

julianrichen avatar Jul 20 '18 02:07 julianrichen

@julianrichen here is what I have. Installed both via apt-get. Using Ubuntu 18.04

image

jrock2004 avatar Jul 20 '18 02:07 jrock2004

You need flatpak-builder 0.10.10 :(

https://github.com/flatpak/flatpak-builder/releases/tag/0.10.10

Major changes in 0.10.10

  • We now support yaml manifest as well as json.

Something you can do temporarly is convert the yml to json and run that manifest. Assuming you can't update flatpak-builder, or it would be to much work.

julianrichen avatar Jul 20 '18 02:07 julianrichen

@julianrichen trying to install that release now. Its been a while to install the old fashion way

jrock2004 avatar Jul 20 '18 02:07 jrock2004

I got in game but as @johnramsden mentioned it's really, really laggy. The Wine DB has one test listed:

https://appdb.winehq.org/objectManager.php?sClass=version&iId=29952

What does not

  • 64-bit client has poor performance;
  • With High texture quality settings, items icons in inventory/stash take a long time to load (esp. in act V);
  • Sometimes when starting the game, it crashes just after displaying the town;
  • When Battle.net voice chat is enabled, some of the mouse clicks register as mouse downs (bug #44032);
  • With dual-monitor setup setting Windowed Fullscreen mode makes the game have doubled resolution (3840x1080 shrinked to 1920x1080).

Workarounds

  • Use 32-bit game client;
  • Set texture quality to Low;
  • Kill and restart the game;
  • Don't use voice chat, or compile Wine Staging without "server-send_hardware_message" patch'
  • Use Fullscreen mode, or use Wine Virtual Desktop, or set the resolution manually in D3Prefs.txt (change "DisplayModeWidth" to proper value).

It's from wine-staging 3.12 so it's recent.

If the 32bit client really is better, and we can't find a fix for the 64bit client, then maybe we can just push a 32bit build for people to use. Then in the future when the 64bit version is better we offer that.

julianrichen avatar Jul 20 '18 03:07 julianrichen

@julianrichen I'll add a 32bit build then when I get the chance. Thanks for testing.

johnramsden avatar Jul 20 '18 03:07 johnramsden

In the Battle.net app their is a setting to toggle the 32bit client

Options -> Game Settngs (Diablo 3) -> Launch 32bit client instead of 64bit client

and performance is significantly better in the menus and in game. But on my Ryzen 7 1700x / RX 580 the FPS feels like it's between 45 ~ 50 fps.

We can change client options in the config file located at ${WINEPREFIX}/dosdevices/c:/users/${USER}/Application Data/Battle.net/Battle.net.config. We do it in the Batte.net installer to make the client work already with accelerated graphics: https://github.com/winepak/applications/blob/master/com.blizzard.BattleNet.BaseApp/com.blizzard.BattleNet.BaseApp.yml#L96

And we're discussing how to add options cleaning with #88 after modifying it.

julianrichen avatar Jul 20 '18 03:07 julianrichen

When I build I will change x86_64 to i386

jrock2004 avatar Jul 20 '18 03:07 jrock2004

Well that did not work because it stated there is no i386 version of the blizzard app

jrock2004 avatar Jul 20 '18 03:07 jrock2004

Also after I login, all my windows are black

jrock2004 avatar Jul 20 '18 03:07 jrock2004

So I take it there's no reason to set up a 32-bit version then? Just run the 64-bit version in 32-bit mode?

johnramsden avatar Jul 20 '18 05:07 johnramsden

@julianrichen I looked at the OverWatch pr to see how you're changing the json, I wonder if better option would be to use something like jsed which lets you edit json objects in a programmatic away. That way you could parse to see what the user has set if need be at runtime, and you can also edit it at a later date if an update means meeting to add something new.

I'll enable 32 bit mode for now as done in com.blizzard.BattleNet.BaseApp.yml#L96.

@julianrichen Oh, i've been wondering where you find the official artwork. I've been having trouble finding an official icon.

johnramsden avatar Jul 20 '18 05:07 johnramsden

@johnramsden Official icon: https://us.shop.battle.net/static/3.1.1/images/family-icons/diablo-iii.svg

LeandroStanger avatar Jul 20 '18 14:07 LeandroStanger

I proper json editor would be good since "sed-ing" JSON is generally bad and bound to cause issues (I agree with you @TLATER).

jsed looks interesting but it's written in go and go isn't native to the fd.o runtime, and I'm not sure what kind of issues arise from inheriting an extension from the fd.o runtime when we use the same extension point for our extensions.

I don't know if jshon is any good but it's written in C which we can build out of the box. Or I also found jq which is still being update (May 9 last commit) and is also written in C.

Since all Battle.net apps can benefit from this I think building one of these programs in com.blizzard.BattleNet.BaseApp would be good so every can use them. Then OSTree will de-duplicate the code since they'll have the same checksum.

I'll be gone this weekend but I'll try them out when I get back and hopefully get a better, not hacky solution to this.

This will also effect pr #88 and @TLATER concerns over the same issue.


Also all the icons (as @LeandroStanger mentioned) can be found on this page: https://us.shop.battle.net/en-us

links: https://us.shop.battle.net/static/3.1.1/images/family-icons/diablo-ii.svg https://us.shop.battle.net/static/3.1.1/images/family-icons/diablo-iii.svg https://us.shop.battle.net/static/3.1.1/images/family-icons/hearthstone.svg https://us.shop.battle.net/static/3.1.1/images/family-icons/heroes-of-the-storm.svg https://us.shop.battle.net/static/3.1.1/images/family-icons/overwatch.svg https://us.shop.battle.net/static/3.1.1/images/family-icons/starcraft-remastered.svg https://us.shop.battle.net/static/3.1.1/images/family-icons/starcraft-ii.svg https://us.shop.battle.net/static/3.1.1/images/family-icons/warcraft-iii.svg https://us.shop.battle.net/static/3.1.1/images/family-icons/battle-net.svg

https://us.shop.battle.net/static/3.1.1/images/family-icons/call-of-duty.svg https://us.shop.battle.net/static/3.1.1/images/family-icons/destiny-2.svg

julianrichen avatar Jul 20 '18 17:07 julianrichen

@julianrichen I assume you mean't to respond to me.

jsed was just the first one I found, using a c based one would probably be better. Thanks for the links.

johnramsden avatar Jul 20 '18 22:07 johnramsden

After some experimentation I found echoing configuration in at install time just gets overwritten. I assume because if the echo into the configuration is done while installer is open, and the battle net installer wants to change something, it probably already has the configuration in memory and just changes the old configuration it had. At least that's the experience I've had, I can't get the configuration to hold if it's done after the battle net installer is running. Advice?

I don't want to do it at runtime because it will then overwrite any configuration the user makes.

johnramsden avatar Jul 20 '18 23:07 johnramsden

So I just tested and the game is very playable on the 32-bit setting. I guess for now users will just have to set it themselves?

johnramsden avatar Jul 21 '18 00:07 johnramsden