MaKiPL / FF8_demaster

Unofficial Final Fantasy VIII Remastered core mod based on import-dependency DLL that updates the gamecode and fixes issues left by developers
https://makipl.github.io/FF8_demaster/
GNU General Public License v3.0
100 stars 9 forks source link

linux - wine support #57

Closed Zeitwaechter closed 1 year ago

Zeitwaechter commented 2 years ago

Heya,

I just wanted to start an issue regarding "support" for wine / linux.

This wording is missleading, IMHO, but as I'm not in on the details and never tried working with DLLs / .net, we might get a better wording along the way.

So, last night I setup the modded FFVIII-R with your latest build and all the latest mods from your dear friend MCIndusMODS. This was done with a fresh setup, following all the READMEs available and on a Windows 10 - it was working fine there and all, no issues within the first 10 minutes after starting a new game, everything loaded as expected.

So, I thought just copying it over might be enough for it to work under Proton as well, but I sadly still have not succeed in that regard.

There was also a thread started just a few hours ago, about the demaster injections not working, when trying to get this to work on the Steam Deck (Arch Linux).

So, my naiv guess is, that the .net version provided by Proton 7.0 (which is what I currently use) might be missing the "something" you probably use to hook your injections into. I could still be wrong, though ;)

Now, MCIndusMODS did provide a comment to his Patreons (I'm also one of them) about him thinking that there are already some people who did get it to work on their Steam Decks (Arch Linux) and did suggest trying to find an answer on his Discord - but I'm not using Discord and probably never will - also there are probably many others who do not want to go that route.

Having said that, this is my attempt to find a solution for this, for all to eadily see and everybody to find.

Now, details, please.

The demaster.conf used:

; FF8 Remastered: Demaster patch config file
;1.2.8a
DIRECT_IO=1
;[CORE]- loads files from unpacked archives
UV_PATCH=1
;Fixes worldmap UV issues significantly improving graphic
LOG=1
;Outputs logs to demaster.txt
MORE_DEBUG_OUTPUT_PATCH=1
;outputs rich engine data to debug console - now stable!
TEXTURE_PATCH=1
;global switch for tex patch
BATTLE_CHARACTER=1
;Disables battle characters texture resolution limit 
FIELD_ENTITY=1
;Disables field entities texture resolution limit
BATTLE_HOOK_MONSTER_FIELDS=1
;Enables support for new/custom texture of battle stages and monsters
FIELD_BACKGROUND=1
;Enables support for loading custom field backgrounds
WORLD_TEXTURES=1
;[UNSTABLE] Enables support for loading custom worldmap textures
LINEAR_PATCH=1
;Disables linear filtering and brings back point clamp as in PlayStation
OPENGL_HOOK=1
;Enables all sorts of functions for OpenGl
DEVELOPER=1
;Enables powerful developer window for debugging, research and modding [BETA]
;BATTLE_STAGE_ANIMATION_DELAY=100
;In milliseconds, if this number is too low it may skip frames.
;BATTLE_STAGE_FORCE_RELOAD=1
;Causes textures to reload when requested from game. This might need to start a new battle.

If you also want to (rather) quickly check it out yourself, how this works and what happens, it might be best to go with Manjaro Linux, instead of Arch Linux, for ease of usage and what is already given to you, before you install Steam. For using the Steam Deck Image, it might be this link.. but not sure about that.

So.. like I said, I would like to use this on the Steam Deck / my Arch Linux setup.

I'm really not into .net/mono/.dlls and have basically never programmed with .net. I would like to provide help to see this "fixed", though.

(Or maybe there is just some other simple step that is missing and my whole guess is wrong! :+1: )

So, if there is anything useful even I can help with, let me know.

Cheers :)

PS: No demasterlog.txt is written, jfyi :bone:

MaKiPL commented 2 years ago

Thanks for rich description. I'll try to set it up. The launcher itself is Mono indeed but the demaster itself is x86 and works via dependency injection, therefore this might be the place it's not loaded as Photon might be using it's own dinput wrappers. I'm working on new, refreshed version, so I'll be talking in note the Linux based systems too. Development just began, so in a month this should be working for everyone on version 2.0 (reborn) instead.

Zeitwaechter commented 2 years ago

Heya, thanks for your fast reply!

Looking forward to V2 then, sorry to (also) not be able to suggest any cool logo - saw your announcement.

Hope to be of any further help, in the future.

:handshake:

Zeitwaechter commented 2 years ago

Hey there, just a "quick" question, without taking a deeper look myself:

Is the FFVIII Remastered ("port") done in Unity?

Maybe something similar must be done - due to this "UnityDoorstop" thing - like e.g. for the FF Pixel Remasters Memoria project; Albeoris/Memoria.FFPR for now(?):

Severus157 commented 2 years ago

Is there any update on this? I noticed the V2 was published, but still Demaster does not seem to read from the correct path and just load the standard main.zzz instead of the extracted ones. But the extraction is working fine though.

Any way to support this?

Zeitwaechter commented 2 years ago

I'm rather inclined to assume that there has been no real change in the recent release yet, as there was no major version update yet :)

As times are continuing to stay difficult - especially in the east of europe -, and we are also moving towards winter season again (with the pandemic), we need to be more patient.

I feel this is more than understandable, right?

Cheers 👍

Severus157 commented 2 years ago

You are right. I just can't wait to finally play a modded game. I saw the version released mid August and thought that it would finally a dream coming true.

As it's just a frustration for me for years as a Linux Gamer... Only now with the release of the SteamDeck developer's are accepting us and not just laugh.

I just always get overly excited, when I have some hope to finally play my favourite game of all time. I just wish I could help to get a functioning and open version soon. But I'm not good in programming, can do a few scripting things I need in my Job, but this stuff is quite difficult...

zelurker commented 1 year ago

Well here the injection dll is dinput8.dl, so you have to run winecfg, add a new application, select ffviii.exe, then in libraries add dinput8.dll (it will be native first then integrated which is ok). The only problem is that with this, the patching fails in the middle, it might be because there are unexpected addresses with the wine/proton native libs, but anyway, without the opengl hook you get this : (after the usual texts during the init of a wine program) DEMASTER ENGINE LOADED! Reading config file demaster.conf IMAGE_BASE at: 10000000; OPENGL at: 0 Applying DIRECT_IO Applying texture patches... Applying BATTLE_CHARA patch Applying FIELD_ENTITY patch BATTLE_HOOK- STARTING PATCHING Applying battle field patch ApplyBattleFieldPatch():ds_free is at: 1166B2A8 and ds_teximg is at: 1166B4AC Applying FIELD_BACKGROUND PATCH Applying WORLD_TEXTURES PATCH And everything freezes here, you have to quit with ctrl-c (assuming you launched from a terminal !).

If you add the opengl hook in the demaster options then you get a nice error message before the freeze : ... Applying WORLD_TEXTURES PATCH GetProcAddress failed at glAlphaFunc0140 and ctrl-c too bad... !

Sebanisu commented 1 year ago

I'm like 90% sure there is no Unity in here.

MaKiPL commented 1 year ago

I'm like 90% sure there is no Unity in here.

unity as of unity 3d - the worst game engine on the market this days with years of unfixed core engine issues where devs need to solve it the 'hackish' way because unity3d devs are incompetent? for sure unity is not used here :D

about the issue- someone on Steam forums already posted the solution, I'm not sure what it means really. I could use steam deck for that, but mainly the thing is that steam deck somehow 'steals' the dinput8.dll on their own implementation rendering the hook useless. In the #reborn branch there's a launcher that directly calls the game as the real launcher and injects the 'hack' on it's own as custom launcher. This might be the final solution for steam deck play. I'll try to do this as a second thing after full texture support. I'm back in the project and work closely with MCINDUS. Just a little more time, please

Thanks for all your support

MiKE41 commented 1 year ago

Hey all,

I was able to get this to run on my steamdeck with a couple config tweaks:

  1. I replaced simpledllloader's dinput8.dll with Ultimate ASI Loader's dinput8.dll, renamed ff8_demaster.dll to ff8_demaster.asi, and kept the official FFVIII_Launcher.exe. The official launcher seems to crash when using simpledllloader, but doesn't when using Ultimate ASI Loader. This may not be required, however if you haven't launched the game with the official launcher at least once you'll get an error that says image So I'd rather just use the official launcher /shrug

  2. Change the launch options in the game properties on Steam to: WINEDLLOVERRIDES="dinput8.dll=n,b" %command% This is needed because by default WINE will replace dinput8.dll as its loaded with one that it provides, which means the loader and demastered dlls are never touched.

  3. Use GloriousEggroll's proton-ge-custom. For some reason using the default proton doesn't detect the controller anymore. Demastered loads fine for me with the default proton, and you can play if you're using a keyboard and mouse... but that defeats the point of the Steam Deck. Using proton-ge-custom the controller is detected and works again.

Here's a quick HDMI capture: https://youtu.be/UpyuKtzs-Hg

Severus157 commented 1 year ago

Hey all,

I was able to get this to run on my steamdeck with a couple config tweaks:

  1. I replaced simpledllloader's dinput8.dll with Ultimate ASI Loader's dinput8.dll, renamed ff8_demaster.dll to ff8_demaster.asi, and kept the official FFVIII_Launcher.exe. The official launcher seems to crash when using simpledllloader, but doesn't when using Ultimate ASI Loader. This may not be required, however if you haven't launched the game with the official launcher at least once you'll get an error that says image So I'd rather just use the official launcher /shrug
  2. Change the launch options in the game properties on Steam to: WINEDLLOVERRIDES="dinput8.dll=n,b" %command% This is needed because by default WINE will replace dinput8.dll as its loaded with one that it provides, which means the loader and demastered dlls are never touched.
  3. Use GloriousEggroll's proton-ge-custom. For some reason using the default proton doesn't detect the controller anymore. Demastered loads fine for me with the default proton, and you can play if you're using a keyboard and mouse... but that defeats the point of the Steam Deck. Using proton-ge-custom the controller is detected and works again.

Here's a quick HDMI capture: https://youtu.be/UpyuKtzs-Hg

That sounds interesting and promising. I'll try it out on my PC later after Work. Hopefully this can finally get it to work.

Sebanisu commented 1 year ago

I have the same problem with the launcher crashing with simpleloaderdll on Windows. Maybe Maki could swap which loader is packaged at least till the new version gets released with the new method. Then we wouldn't need the custom launcher anymore.

That config.txt is because the launcher sets some of the settings and generates the file.

Zeitwaechter commented 1 year ago

Thanks to all of you for the good news.

It will take some time but I will also try it out.. hopefully this weekend, but probably rather on the one next week .. sigh

Edit (2023-05-13): Sure, someday will be "later" :-)

zelurker commented 1 year ago

Yeah after trying, I confirm, it works flawlessly and is extremely simple, just use ultimate asi loader from there : https://github.com/ThirteenAG/Ultimate-ASI-Loader/releases you can either overwrite or rename the old dinput8.dll with the one from this package then rename ff8_demaster.dll to ff8_demaster.osi either add the exception in wnecfg for ffviii.exe for dinput8.dll or add the environment prefix as advises when launching : WINEDLLOVERRIDES="dinput8.dll=n,b" ./FFVIII.exe that's all there is to it, works perfectly, thanks ! :) (I didn't have any controller problem on pc).

Le jeu. 8 déc. 2022 à 22:46, John Doe @.***> a écrit :

Thanks to all of you for the good news.

It will take some time but I will also try it out.. hopefully this weekend, but probably rather on the one next week .. sigh

— Reply to this email directly, view it on GitHub https://github.com/MaKiPL/FF8_demastered/issues/57#issuecomment-1343414232, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAV3SD6JHKMXL7RUUYCVWYLWMJJMVANCNFSM52QTRYQQ . You are receiving this because you commented.Message ID: @.***>

zelurker commented 1 year ago

Le ven. 9 déc. 2022 à 00:29, Emmanuel Anne @.***> a écrit :

then rename ff8_demaster.dll to ff8_demaster.osi

to ff8_demaster.asi of course !!!

Message ID: @.***>

Wedge009 commented 1 year ago
2. Change the launch options in the game properties on Steam to: WINEDLLOVERRIDES="dinput8.dll=n,b" %command%
   This is needed because by default WINE will replace dinput8.dll as its loaded with one that it provides, which means the loader and demastered dlls are never touched.

For what it's worth, I've been happily playing FFVIII-R with Demastered v1.3.3 for this last week or so, on Proton 8.0-2 vanilla (initial run of ffviii_demaster_manager.exe was through Wine). Only needed the aforementioned command addition to get Demastered working with it (world map looked atrocious without its UV corrections). Even PS4 controller is detected fine. PS3 controller is mistaken for an Xbox controller, though (but seems unrelated to this project). Thanks for the efforts.

Only down-side I've discovered so far is an apparent recurrence of the Irvine issue (#19, #54, #56) - broken textures on Windows, crash with Unhandled Exception on Linux with Proton. Was quite frustrating too, because I had lost a fair bit of play time since the last save point.

MaKiPL commented 1 year ago

Ok, closing this one. Let's discuss in respective bug issues

Wedge009 commented 1 year ago

Not sure if it's necessary to re-open this. On occasion I get Unknown Exceptions when playing on Linux via Proton, something I never saw on Windows outside of the infamous Irvine prison rescue scene, but most of the time when restarting and continuing, the crash doesn't happen again so I assume it's a one-off (or a non-deterministic problem).

This time I had the misfortune of crashing twice in a row just before entering the Ragnarok. It's unfortunate that it's a rather long story segment (even with x3 speed boost) between the last save point in the escape pod from the Lunar Base and the one at the start of the Ragnarok, just before the crash. It was only when I disabled Demastered that I was able to progress past that point on Linux. Playing with Demastered on Windows also did not have any crash.

I haven't seen any reports relating to crashes upon reaching the Ragnarok so maybe I was just unlucky.

All this is still playing on Proton 8.0-2 vanilla.

Sebanisu commented 1 year ago

I have seen a crash when quickly changing fields. If it's inconsistent it might be related to that. I'm not sure the cause. Might be helpful to share your save nearest to the crash. If it's repeatable at all. It could help maki figure it out.

On Sat, Jul 15, 2023, 6:33 AM Wedge009 @.***> wrote:

Not sure if it's necessary to re-open this. On occasion I get Unknown Exceptions when playing on Linux via Proton, something I never saw on Windows outside of the infamous Irvine prison rescue scene, but most of the time when restarting and continuing, the crash doesn't happen again so I assume it's a one-off (or a non-deterministic problem).

This time I had the misfortune of crashing twice in a row just before entering the Ragnarok. It's unfortunate that it's a rather long story segment (even with x3 speed boost) between the last save point in the escape pod from the Lunar Base and the one at the start of the Ragnarok, just before the crash. It was only when I disabled Demastered that I was able to progress past that point on Linux. Playing with Demastered on Windows also did not have any crash.

I haven't seen any reports relating to crashes upon reaching the Ragnarok so maybe I was just unlucky.

All this is still playing on Proton 8.0-2 vanilla.

— Reply to this email directly, view it on GitHub https://github.com/MaKiPL/FF8_demastered/issues/57#issuecomment-1636731608, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH45AM2DUUEO4XQYN4IFETXQJWYHANCNFSM52QTRYQQ . You are receiving this because you commented.Message ID: @.***>

Wedge009 commented 1 year ago

Yes, of course. I hadn't seen any indication that this was currently being worked on, and again - I'm not even sure this is specifically a Wine/Proton-related problem. But anyway:

lunar_base_end_to_ragnarok_start.zip

Slot 1 Block 30 is during the escape from Lunar Base, Slot 2 Block 1 is the start of the Ragnarok. When I was playing on Linux via Proton, with Demastered, I kept getting a crash just before that second save point.

20230715202021_1

Rinoa and Squall hop into the Ragnarok, black transition screen, then crash...