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

My experience setting up this project on a GNU/Linux distro #312

Open
felipesanches opened this issue Jul 8, 2020 · 12 comments
Open

My experience setting up this project on a GNU/Linux distro #312

felipesanches opened this issue Jul 8, 2020 · 12 comments

Comments

@felipesanches
Copy link

Maybe this can help to improve the README and also the initial data conversion code to run more smoothly for other GNU+Linux users.

Even though I own the original game CDs, I decided to buy the games again on GOG and download the files. This project seems to be focused on LBA2 only, but I ended up buying both LBA1 and LBA2 on GOG.com since the price was extremely cheap!

GOG warned that these games are only supported on Mac and Windows, but I knew I would only need the data files, so I ignored the warning and proceeded with the purchase.

Instead of downloading with "GOG Galaxy", instead I chose the option DOWNLOAD OFFLINE BACKUP GAME INSTALLERS - Download game files only. Useful if you anticipate limited internet access, or want to have a backup. These installers don't support auto-updating, nor on-line features.

The installer is a Windows executable called setup_little_big_adventure_2_1.0_(28192).exe. I created a directory called lba2_gog inside my local working copy of the git repo for lba2remake and saved the installer there.

I used wine to run the installer:
wine setup_little_big_adventure_2_1.0_(28192).exe

The installer opened some pop up dialogs with ERROR messages, which made me worry that it might have not done its job properly. But clicking "OK" and closing the installer (I did not press the "Launch" button in the end) seemed to be just fine. This process resulted in the game files being installed under the "C:/" drive, as seen by wine at ~/.wine/drive_c/GOG\ Games/Little\ Big\ Adventure\ 2/

I decided to make a symbolic link to that directory so that it would be easier to reach it from within my local working dir:
ln -s ~/.wine/drive_c/GOG\ Games/Little\ Big\ Adventure\ 2/ files

now the files are available in there:
Screenshot from 2020-07-08 19-51-03

Next step was following the README.md instructions. So I ran npm install and it installed a lot of stuff but complained about my npm install being old, so I also did run this as root: npm i npm@latest -g

As you can see in the screenshot below, npm install did not work perfectly in the first try, so I kept rerunning it until I got a clean success message. Not sure why it misbehaves like that...

Screenshot from 2020-07-08 19-58-30

Finally, it told me some dependencies had to be installed manually, so I did (not sure if strictly necessary, but I gave it a try anyway):

  • npm install utf-8-validate@^5.0.2
  • npm install bufferutil@^4.0.1
  • npm install canvas@^2.5.0

Then I was in doubt which exact command to use next, as the README only had instructions for Mac or Windows. In the end this one was good enough: npm run import lba2_gog/files/

It sucessfully recognized the game data files but was unable to create a www/data/LBA2 directory:
Screenshot from 2020-07-08 20-03-17

I manually created the data dir with the following command:
mkdir www/data

Then, rerunning npm run import lba2_gog/files/ it moved on and told me it would extract game data using dosbox, but failed because there's no PowerShell on GNU/Linux, that's a Windows thing!

Screenshot from 2020-07-08 20-06-16

But I do have dosbox installed here (native Debian one, I don't need to use the DosBox.exe binary for Windows that is provided in this repo). Reading the contents of the utils/convert/unpack.ps1 script, I figured it would be super simple to manually execute the same thing by myself.

These are the contents of utils/convert/unpack.ps1:

cd "$PSScriptRoot/../../www/data/LBA2/_unpack"
./DOSBox.exe unpack.bat -exit

And this is what I've done manually:

cd www/data/LBA2/_unpack/
dosbox unpack.bat -exit

Now, running npm run import lba2_gog/files/ again finally worked. The files take a long time to convert (it seems to use ffmpeg to convert audio and video files to file formats better suited to the remake project that will use them on a browser)

Final step was to run npm run dev and cross my fingers :-) (I am running it right now. I may write a followup message if I find other problems)

Happy Hacking,
Felipe "Juca" Sanches :-D

@felipesanches
Copy link
Author

It works! :-)

@felipesanches
Copy link
Author

After seeing the "Compiled successfully." message, it is just a matter of opening http://localhost:8080 on your web-browser, as instructed on README.md. But I stayed there still waiting for a few seconds for some more log messages. It would be nice to print the http://localhost:8080 message on the terminal so that it is clear to the users that the server is ready, up and running!

@felipesanches
Copy link
Author

By the way... I did not mention, but my distro is Debian 10 and I got interested in setting up this project on my computer after seeing the great video in which Sara (I am not sure it that's her name, but that was what I think I heard in the video) showcased the 3d models she's working on for the game remake in blender:

https://www.youtube.com/watch?v=6bAzSgZ0nD0

@agrande
Copy link
Member

agrande commented Jul 9, 2020

Thanks for you feedback!
Did you try updating to a more recent version of node.js like the npm install command suggested?
Do you think it would be possible for you to edit the README / documentation files with a summarized version of this report to help future linux users?
About printing something like "Server ready at http://localhost:8080" in the terminal, I'll see if I can do something about it.

@felipesanches
Copy link
Author

felipesanches commented Jul 9, 2020

Yes, I think I can send a PR with updates to the README. But it would be even better if the initialization command handled gracefully running on GNU+Linux such as not crashing when an empty www/data directory is missing, and also invoking a native dosbox instead of the Windows build one (DosBox.exe) under PowerShell.

@agrande
Copy link
Member

agrande commented Jul 9, 2020

Well, if you think you can do something about that, it would be super cool. I don't have a linux distro at hand so I can't test this myself. You may want to look at the MacOS instructions, as that should be closer to Linux. I'm using the GOG offline backup version of the game too, and the MacOS import script is supporting that.

@agrande
Copy link
Member

agrande commented Jul 9, 2020

Currently, you need to pass the path to the dosbox executable as a command line argument to import from the offline backup version on Mac, but maybe we can skip that part for linux and run the command directly if it's available in the $PATH.

@xesf
Copy link
Member

xesf commented Jul 9, 2020

We never tried on linux, but I do believe following the MacOS guide should work on linux as well, at the least it will be much closer than the Windows counterpart.

@hlechner
Copy link

Hey guys, I tried to install on Linux and I faced the same problems but also an error that was caused by not having the dosbox folder in the LBA2 GOG version (which I had to looking into the utils/convert files to find it out).

I figured out that each version of LBA2 (GogWin, SteamWin, GogMac, etc) has a command line associate to it, since I do use GogWin version it tries to use Powershell command.

GogWin: 'powershell -File utils/convert/unpkLBA2.ps1'
GogMac: 'cd www/data/LBA2/_unpack && ./dosbox unpkLBA2.bat -exit'

If you allow me to suggest a different approach, it could check if the OS is the same OS supported by that installation, for example:

LBA2 version :GogWin / OS: Windows
since the OSes do match, copy the dosbox folder as it is right now

LBA2 version :GogWin / OS: Linux (or even Mac)
the OSes do not match (windows install on linux), just the send the command considering the dosbox is installed and it's on path


It also allow to mac uses windows installation and vice-versa,
If mac using a mac installation would be:
'cd www/data/LBA2/_unpack && ./dosbox unpkLBA2.bat -exit'
if mac using a non-mac installation:
'cd www/data/LBA2/_unpack && dosbox unpkLBA2.bat -exit'

just execute dosbox instead of ./dosbox and expect that the system has the dosbox installed properly (and on path)

and on Windows if installing from a GogMac for example, it could do the same as it now, just ask the dosbox path to the user.

@xesf
Copy link
Member

xesf commented Jul 19, 2021

That is a nice idea, we probably should be choosing installing types per OS instead being per game. Although, I wonder why it did not find the dosbox inside the gog game folder.

Are you willing to create a PR with these modifications?

@hlechner
Copy link

That is a nice idea, we probably should be choosing installing types per OS instead being per game. Although, I wonder why it did not find the dosbox inside the gog game folder.

Since the dosbox folder wasn't useful for me (it had a windows dosbox there) and it give problems on GameHub I just deleted it.

Are you willing to create a PR with these modifications?

I can try, I'm not a typescript developer, just give me a few days and I create a PR

@hlechner
Copy link

I made the code works for linux on my local system, but since my changes I need to test it on windows as well.

Unfortunately it's not working on windows 10 for me (not on my branch, but git cloning the master from you guys):

PS C:\lba2remake\lba2remake> npm run import:win "C:\lba2remake\GOG\"

> lba2remake@0.6.0-alpha import:win C:\lba2remake\lba2remake
> powershell -File utils/convert/import.ps1 "C:\lba2remake\GOG\"


> lba2remake@0.6.0-alpha unpack C:\lba2remake\lba2remake
> ts-node utils/convert/unpack.ts "C:\lba2remake\GOG"

Detected game instalation: GogWin
Extracting image. Do not close the dosbox window.

> lba2remake@0.6.0-alpha convert C:\lba2remake\lba2remake
> ts-node utils/convert/convert.ts "C:\lba2remake\GOG music 128 128"

Unsupported game installation. Currently supported GoG versions for windows and mac. Make sure you specified the correct folder path with installed LBA 2 game. If you verified it is correct, then most probably you can still run the remake, but you will have to copy the game files manually. Refer to the README.md
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lba2remake@0.6.0-alpha convert: `ts-node utils/convert/convert.ts "C:\lba2remake\GOG music 128 128"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lba2remake@0.6.0-alpha convert script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\hlechner\AppData\Roaming\npm-cache\_logs\2021-07-22T21_53_21_724Z-debug.log
Failed to convert music
At C:\lba2remake\lba2remake\utils\convert\import.ps1:8 char:15
+ if (-not $?) {throw "Failed to convert music"}
+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Failed to convert music:String) [], RuntimeException
    + FullyQualifiedErrorId : Failed to convert music

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lba2remake@0.6.0-alpha import:win: `powershell -File utils/convert/import.ps1 "C:\lba2remake\GOG\"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lba2remake@0.6.0-alpha import:win script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\hlechner\AppData\Roaming\npm-cache\_logs\2021-07-22T21_53_21_925Z-debug.log

it's working for you on windows 10?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants