}

It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
dtgreene: One possible workaround, if you don't mind writing a little bit of C.

1. Create a shared library. This shared library should contain a function with the same name and signature that strace shows the program is calling, and should return the data you want the program to use.

2. When starting the game, use LD_PRELOAD to force your shared library to load before the game loads it.

Now, when the game calls the function, it will get your version of the function instead of glibc's wrapper of the system call.
I was actually planning to write an LD_PRELOAD hook but I just never had the time and, now that Flatpak is around, I figure I might as well go for the more comprehensive solution that doesn't require me to write any C.

(Though I still do plan to write a hook to fix games like Dungeons of Dredmor which only allow you to select valid fullscreen resolutions for windowed mode, which keeps them from playing nicely with a MetaModes line that locks the desktop resolution. That one, I actually started work on years ago, but couldn't figure out how to write a dlsym(RTLD_NEXT, "SDL_ListModes") function pointer signature that the compiler would accept... and then other things kept coming up so I've just not been playing Dredmor.)

I figure that, since the core of my launcher is already being ported from Python to Rust for reusability and stricter type checks, I might as well write the LD_PRELOAD helper using something like redhook ( https://crates.io/crates/redhook ) or hooky ( https://crates.io/crates/hooky ) so I get a language I'm more familiar with and a function pointer syntax that's not so squirrely.
Post edited December 30, 2017 by ssokolow
avatar
ssokolow: I figure that, since the core of my launcher is already being ported from Python to Rust for reusability and stricter type checks, I might as well write the LD_PRELOAD helper using something like redhook ( https://crates.io/crates/redhook ) or hooky ( https://crates.io/crates/hooky ) so I get a language I'm more familiar with and a function pointer syntax that's not so squirrely.
Those are interesting, thanks for pointing them out!
avatar
linuxvangog: Hello everyone!
I just bought Slime Rancher, and it has a nasty bug with fullscreen mode (it basically hangs on startup with flickering screen). There is a known workaround to pass -screen-fullscreen 0 to the binary, which will force Unity to start in Windowed mode. I decided to tweak start.sh to do that, and noticed something strange.

There is a function: execute_game_with_params in gog_com.shlib, which is doing this:

./"${bin_64}" "$@"

Which is fine, except it's not shifting GOG internal parameters before passing extra ones to the actual game. That's clearly wrong, so I had to add

shift 6

there after all internal parameters are read, so $@ would only mean game parameters. Not sure how it ever worked otherwise. I hope this helps.

Also, it's better to use simply $@ there, not "$@", since the later makes it into a single parameter instead of multiple ones.
Post edited January 01, 2018 by shmerl
avatar
shmerl: Also, it's better to use simply $@ there, not "$@", since the later makes it into a single parameter instead of multiple ones.
no, "$@" is correct since it makes sure things work properly if a parameter contains spaces

from man bash

Expands to the positional parameters, starting from one. When the expansion
occurs within double quotes, each parameter expands to a separate word. That
is, "$@" is equivalent to "$1" "$2" ...
avatar
shmerl: Also, it's better to use simply $@ there, not "$@", since the later makes it into a single parameter instead of multiple ones.
No, actually, "$@" is special and results in separately-quoted parameters. You're thinking of "$*".

Here's the relevant part of man bash:

Special Parameters

The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed.

* Expands to the positional parameters, starting from one. When the expansion is not within double quotes, each positional parameter expands to a separate word. In contexts where it is performed, those words are subject to further word splitting and pathname expansion. When the expansion occurs within double quotes, it expands to a single word with the value of each parameter separated by the first character of the IFS special variable. That is, "$*" is equivalent to "$1c$2c...", where c is the first character of the value of the IFS variable. If IFS is unset, the parameters are separated by spaces. If IFS is null, the parameters are joined without intervening separators.

@ Expands to the positional parameters, starting from one. When the expansion occurs within double quotes, each parameter expands to a separate word. That is, "$@" is equivalent to "$1" "$2" ... If the double-quoted expansion occurs within a word, the expansion of the first parameter is joined with the beginning part of the original word, and the expansion of the last parameter is joined with the last part of the original word. When there are no positional parameters, "$@" and $@ expand to nothing (i.e., they are removed).
Post edited January 01, 2018 by ssokolow
avatar
shmerl: ...

Which is fine, except it's not shifting GOG internal parameters before passing extra ones to the actual game. That's clearly wrong, so I had to add

shift 6

there after all internal parameters are read, so $@ would only mean game parameters. Not sure how it ever worked otherwise. I hope this helps.
This maybe explain my struggle to use command line option for Chaos Reborn (as it has full screen problem with newer Unity too, at the moment I'm running it in borderless maximized window). Although it just may be I did something wrong when I was trying out command line options, didn't pay much attention in the hurry.
avatar
immi101: no, "$@" is correct since it makes sure things work properly if a parameter contains spaces
avatar
ssokolow: No, actually, "$@" is special and results in separately-quoted parameters. You're thinking of "$*".
Interesting, since in the past I had exactly this problem with $@ turning into a single parameter. But may be it was related to too many levels of indirection / quotations or may be it was indeed with $*.
Post edited January 01, 2018 by shmerl
high rated
avatar
linuxvangog: If you have any ideas for the content you would like to see from me, e.g. more insight into our work or technical tips, let me know!
Hi!

You may think (by reading this post) that I am an actual carbon-based life-form, but in truth I am a teletypewriter entity living in an 80-character wide world. Though I rarely leave my allocated framebuffer space, on occasion (like now) I can use curl hacks to communicate with the outside world.

I have to ask, is there any chance we'll ever see a revival of the .tar.gz "installer" format or maybe even (are your ready for this?) .tar.xz (holy smokes!)?

As a teletypewriter entity I can't play most games of course, especially none of these 3D devilries kids are playing these days, but I sure like to unpack things neatly from the command line before I attempt to launch something potentially hyperdimensional.

And before you say I can just unzip the current installers and move some stuff around to get the same end result, I hope you realize it's just not the same thing.

U+2404 (␄)
avatar
linuxvangog: If you have any ideas for the content you would like to see from me, e.g. more insight into our work or technical tips, let me know!
I have an idea. Release Witcher 3 on Linux.

Since CDPR sadly aren't interested in that, every single day, march over to their offices in a big penguin suite and run around the place pretending to be one for a few hours. At least they should notice the penguin in the room.
avatar
Pangaea666: Since CDPR sadly aren't interested in that, every single day, march over to their offices in a big penguin suite and run around the place pretending to be one for a few hours. At least they should notice the penguin in the room.
I'm sure some GOG Linux folks already bugged CDPR about it. It's a problem with CDPR management which they can't really fix :)
avatar
shmerl: I just bought Slime Rancher, and it has a nasty bug with fullscreen mode (it basically hangs on startup with flickering screen). There is a known workaround to pass -screen-fullscreen 0 to the binary, which will force Unity to start in Windowed mode. I decided to tweak start.sh to do that, and noticed something strange.
(...)
Another workaround for this game is to edit the prefs file in "$HOME/.config/unity3d/Monomi Park/Slime Rancher", disable fullscreen mode and set the desired resolution manually. Works also for other affected games using Unity engine.

For user-side fixes you can also put the command using game binary and parameters directly, without using gog_com.shlib functions. Thank you for your feedback!

avatar
WinterSnowfall: (...) I am a teletypewriter entity living in an 80-character wide world. (...)
Holy shit, I shouldn't have drunk all this caffeine and stayed so long at work.

(simple tar archives with game files are not coming back, EOF)

avatar
Pangaea666: (...) march over to their offices in a big penguin suite and run around the place pretending to be one for a few hours. At least they should notice the penguin in the room.
And then I should start shouting like this! ;)
Post edited January 08, 2018 by linuxvangog
avatar
linuxvangog: Another workaround for this game is to edit the prefs file in "$HOME/.config/unity3d/Monomi Park/Slime Rancher", disable fullscreen mode and set the desired resolution manually. Works also for other affected games using Unity engine.
There is a problem with such fix, since the game always reverts those changes (you can set read only bit on the file of course in extended attributes).
avatar
WinterSnowfall: And before you say I can just unzip the current installers and move some stuff around to get the same end result, I hope you realize it's just not the same thing.
I think the current method is fine, as both sides win. As long as I'm able to extract them without the installer (which is all I need) I'm more than happy.

Just my opinion of course.
Post edited January 08, 2018 by Ganni1987
avatar
linuxvangog: Holy shit, I shouldn't have drunk all this caffeine and stayed so long at work.

(simple tar archives with game files are not coming back, EOF)
*adopts Nilfgaardian accent* I see you are a man of good taste unlike these barbarians in the north. You mean to bring back embellished tar archives. Marvelous, quite marvelous!

avatar
Ganni1987: I think the current method is fine, as both sides win.
You're probably right, of course... I tend to get a bit unreasonable whenever I hear of "Linux installers", but I'm guessing some people feel more comfortable with this approach.
high rated
I've created some gogmixes you might want to take a look at!

Mac & Linux recommendations for low end machines:
https://www.gog.com/mix/linuxvangogs_list_for_low_end_linux_mac_computers

Mac & Linux recommendations with local multiplayer:
https://www.gog.com/mix/linuxvangogs_list_of_local_multi_linux_mac_games