sebadorn.de

Dead Cells: Unlocking the Daily Challenge blueprints in the bugged Linux GOG version

Dead Cells error message.

Dead Cells has a Daily Challenge or Daily Run mode, but it is just a minor optional part. Except that is required in order to unlock three weapons (“blueprints”) for the main game. Just by starting a Daily Run on different days unlocks the following blueprints:

  1. Swift Sword (internal name SpeedBlade) the first time
  2. Lacerating Aura (internal name DamageAura) after the fifth time
  3. Meat Skewer (internal name DashSword) after ten starts

However, specifically the Linux version on GOG has an issue where it is impossible to start the Daily Challenge. The Linux version on Steam is not affected. To use anything online-related in Dead Cells – which thankfully is not a lot as it is a local single-player game – the GOG GALAXY client is required. Which does not exist for Linux. Until a GOG GALAXY client for Linux is released, I probably should not buy games from GOG any­more and just go with Steam, because otherwise I cannot trust that all features will work. Which is a pitty because I really like GOG for being DRM-free.

The Dead Cells issue is known for years and by now it seems rather unlikely it will be fixed. At some point a note was added to the store page:

Additional Notes: Galaxy client is required to access Daily Runs and Streaming features.

Let's hack the game

The blueprints dropped in a level.

At the point of writing I was using Ubuntu 20.04.2 and the Dead Cells game version 1.14.0 / v24. You will need a hex editor which can handle big files of around 1 GB. I used and can recommend GHex. You can install it with:

$ sudo apt install ghex
Read more

Changing the message language for Bash

The system language of my Ubuntu installation is set to German. Per default this also means that my command line output is in German if the application supports it. This can be a bit of a hindrance when developing, because error messages and warnings will also be in German which makes it harder to search for solutions – most discussions in help forums and blogs are in English.

So let's change the terminal language. In your ~/.bashrc file add the following lines:

unset LC_ALL
export LC_MESSAGES=C

If LC_ALL had a value, it would overwrite the setting for LC_MESSAGES, so it has to be unset first. I first tried setting LC_ALL=C, but this had the undesired side effect of certain keys behaving differently. I have a German keyboard with QWERTZ layout, but keys like “ä”, “ö”, “ü” suddenly did different things. I can only assume I would have run into some other issues as well. So keep it simple and just change the messages.

The next terminal you open will have the setting applied. Also note that this only affects your terminal and no other applications – except those launched from said terminal.

To check your language settings you can use locale. My output using Bash looks like this:

$ locale
LANG=de_DE.UTF-8
LANGUAGE=de_DE:en
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES=C
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=

Side note: I also tried LC_MESSAGES=en_US.UTF-8, but that didn't work – no idea why. I also didn't look further into it since I have a working solution.

Sources


Dead Cells: PS4 controller support on Linux

Dead Cells is a game, it is really good, and it is available for Linux. However right after installation (version 1.0 from GOG) it did not recognize my PS4 controller. It could not be a problem with the controller itself or Linux in general, because the DS4 worked with other applications – for example it showed up perfectly fine in jstest-gtk (0.1.0).

After some research I came across this reddit post. Dead Cells uses the SDL library, so maybe that's it. I followed the instructions and built and ran sdl2-jstest. The output should contain an entry like this for the DS4 (2nd gen):

Joystick Name:     'Sony Interactive Entertainment Wireless Controller'
Joystick GUID:     030000004c050000cc09000011810000
Joystick Number:    0
Number of Axes:     6
Number of Buttons: 13
Number of Hats:     1
Number of Balls:    0
GameControllerConfig:
  Name:    'PS4 Controller'
  Mapping: '030000004c050000cc09000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,'

… or like this for the DS4 (1st gen):

Joystick Name:     'Sony Computer Entertainment Wireless Controller'
Joystick GUID:     030000004c050000c405000011810000
Joystick Number:    0
Number of Axes:     6
Number of Buttons: 13
Number of Hats:     1
Number of Balls:    0
GameControllerConfig:
  Name:    'PS4 Controller'
  Mapping: '030000004c050000c405000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,'

Take the value behind Mapping and add a line in your /etc/environment file like this:

SDL_GAMECONTROLLERCONFIG='030000004c050000cc09000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,'

After the next reboot everything should be working. Or if you want to test it right away without reboot, then you can just add it to the start script of the game. Assuming you used the standard installation path from the GOG installer, the file is located at ~/GOG Games/Dead Cells/start.sh. Change the file so it now begins with:

#!/bin/bash
# GOG.com (www.gog.com)
# Game

export SDL_GAMECONTROLLERCONFIG='030000004c050000cc09000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,'

That's what worked for me. If it still doesn't for you, try adding some udev rules as described in my article Using NW.js to communicate with a DS4 controller.


Sublime Text 3 portable unter Linux

Sublime Text ist derzeit der Editor meiner Wahl, zusammen mit einigen Zusatz-Paketen. Installiert habe ich ihn über das Web Upd8 PPA. Das ist allerdings hinderlich, wenn man ihn auch als normalen Text-Editor zum spontanen Bearbeiten verwenden möchte. In dem Fall springt immer das zuletzt geöffnete Projekt mit auf. Eine Extra-Installation wäre hier praktisch.

  1. Lade Sublime Text 3 als tarball herunter.
  2. Entpacke das Archiv nach ~/.st3_portable. (Name egal.)
  3. Erstelle in dem Verzeichnis einen Ordner namens Data. (Wichtig!)

Das reicht schon, um auf eine portable Version umzustellen. Für die Verwendung als Gelegenheits-Text-Editor steht aber noch ein wenig mehr an. So soll, wenn eine Datei geöffnet wird, auch das zugehörige Verzeichnis in der Sidebar angezeigt werden. Dafür erstellt man sich ein kleines Bash-Skript ~/.st3_portable/st3_p.sh:

#!/bin/bash
cd ~/.st3_portable/
FOLDER=$(dirname "$1")
./sublime_text "$FOLDER" "$1"

Das Argument $1 ist die zu öffnende Datei. Im letzten Schritt muss nun noch eine .desktop-Datei angelegt werden. Erstelle eine Datei ~/.local/share/applications/st3-portable.desktop mit dem Inhalt:

[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text 3 (portable)
Comment=Sophisticated text editor for code, markup and prose
Exec=/home/seba/.st3_portable/st3_p.sh %F
Terminal=false
MimeType=text/plain;
Icon=sublime-text
Categories=TextEditor;Development;Utility;
StartupNotify=true

X-Desktop-File-Install-Version=0.21

Anstatt /home/seba/ sollte da natürlich der eigene Benutzername stehen. Relative Pfadangaben bzw. ~/ funktionieren hier nicht. Ist die Datei gespeichert, sollten sich Dateien nun per Rechtsklick › Öffnen mit › Sublime Text 3 (portable) öffnen lassen.


Minecraft: Tastaturprobleme unter Ubuntu [inkl. Lösung]

Minecraft

Das Problem

Bei mir läuft immer noch der IBus nebenher, da ich gelegentlich auch mal etwas auf Japanisch eintippen möchte[1]. Dummerweise gibt es scheinbar einen Bug[2] zwischen IBus und gewissen Java-Komponenten, wegen dem dann Tastaturereignisse – sprich: Tastendrücke – nicht an die Java-Anwendung weitergereicht werden. Aufgefallen ist mir das bisher in Minecraft.

Bevor ich zur Lösung komme (wer es eilig hat, liest das hier vermutlich ohnehin nicht und scrollt direkt zum Code), ein paar Hinweise. Zum Einen sollte – auch auf Empfehlung von Notch hin[3] – nicht das standardmäßige OpenJDK benutzt werden, sondern Suns JVM. Im Weiteren setze ich auch voraus, dass diese als Default für den Befehl javagesetzt wurde:

sudo update-java-alternatives -s java-6-sun

Der andere Hinweis ist, IBus aktuell zu halten. Obgleich es bisher nicht zur Behebung des Fehlers beitragen konnte. Wie man stets aktuell bleibt, steht auf der IBus-Projektseite.

Read more