Feeling depressed after finished a game

(I wrote a related post in Chinese here.)

I recently finished a visual novel (a game genre). It is a great game with fully voiced feature, and it has good ending. However, after I finished the game, I felt depressed and empty until now (around a week now). The feeling is just similar to grief. I believe that, how good the game is, then how empty it will be. This is because the fictional and realistic are totally different thing. Whatever you feel through fiction, when you come into reality then they are just gone. And you found that, what you gained was just emptiness.

I searched online, and found that this type of depression is called post-game depression.

I have summarized the factors that cause me having post-game depression.

  1. The player (you) has great empathy – you can feel like game character feels.
  2. Game characters have realistic characteristics – you will feel that the game characters like a real person.
  3. Fully voiced dialog – just like those scamming dating app, you feel the heartwarming speech.
  4. The game character(s) match the player’s favour – you like the character.
  5. The story is long – you spend time with the game, causes you attached to the game character.
  6. The story is reasonable and logical – it may contains science fictional element, but story flow is reasonable.
  7. Good ending, but without finalize everything – you see the happy ending, but looks like something is missing.

In conclusion, you are attached to a fictional story that is somehow realistic (especially in the characters’ relationships), but when the story ended, then it is ended. Nothing else. This causes the player feel something suddenly missing.

In order to cope this bad experience, I am trying to (i) pay more attention on my spiritual life (i.e prayer and bible reading); (ii) talk to someone else (e.g. join Discord); (iii) listen to sad songs/musics; and (iv) re-imagine the whole game with a more completed story. Time passing will make me forget the game and the feeling, but this is really a bad experience. 😕

Reviving Samsung Galaxy Tab 10.1 part 2

In my previous post, I mentioned about reviving old Samsung Galaxy Tab 10.1. Today continue some extra customization works.

Firstly, the problem of the headphone mode emerges again. I tried to clean with cotton, but it doesn’t help. At the end, I found a page recommends an app (Disable Headphone(Enable Speaker)). I tried to install the app, and it works. It really works. That solves the most critical problem of my tab.

Other than that, I have installed several useful apps. They are

(from F-Droid)

(not from F-Droid)

Therefore, the tab basically is functional enough: file operations, view image, watch video from internal storage, and surf net. And there is one more thing remain: gaming!

RetroArch

I tried to install RetroArch. The best to work on my tablet is the F-Droid version.

The modern games, especially mobile games, in my opinion, they are just wasting our time (converting our time to their money through ads). The use erotic drawings (yet not offending the terms and conditions), in-app purchase, and they usually require us to watch ads in order to recharge playing point (usually called “energy” in the game). These “free” apps is free without us to pay the money, but we are being used to earn the money without knowing it.

Instead of spending 30 seconds to watch an ad, it will be better we use the 30 seconds to implement “Kaizen”.

Back to RetroArch, the old school games are designed to play! The game design focuses on the gameplay, in order to achieve the sales. Modern game design (especially mobile games) focuses on earning money, in order to make the project sustain. To earn money, it requires to attract more users. As a result, erotic design of heroine is most attractive (in my opinion).

Back to RetroArch again, it contains various emulators. My favourites are GBA, NES, and SNES. Since I am born in 80s, NES games accompanied my childhood most. Though I played SNES games as well, that’s only when I was teenager and played through emulator as well.

After installed RetroArch, there is a zip extraction issue happened. I don’t know what is the exact solution, but I created temp folder in .retroarch. (this results .retroarch/temp to be created). Note that, there is another folder, RetroArch/temp exists. Then the zip extraction issue is solved.

I have tried RetroArch with some games. But tablet or mobile, the touch screen is worst for playing games. I have ordered a gamepad with bluetooth support, it is way to come. Will try on RetroArch with the gamepad. Hopefully this old tab will be a retro gaming “station”. 😊

Hades (game) cheat

If you feel that Hades is too difficult to play, and want to cheat, can try the following patch in Content\Scripts.

diff –git a/Combat.lua b/Combat.lua
index d9df948..2cc3e32 100644
— a/Combat.lua
+++ b/Combat.lua
@@ -867,6 +867,7 @@ function DamageEnemy( victim, triggerArgs )
end
end
+ triggerArgs.DamageAmount = triggerArgs.DamageAmount * 10
if triggerArgs.DamageAmount == 0 then
return
end
diff –git a/DeathLoop.lua b/DeathLoop.lua
index d36c3f8..226a93b 100644
— a/DeathLoop.lua
+++ b/DeathLoop.lua
@@ -162,6 +162,7 @@ function StartDeathLoop( currentRun )
EnableCombatControls()
ShowCombatUI()
+ currentRun.Money = 80000
end
function SetupDeathArea( currentRun )
@@ -346,7 +347,7 @@ function StartOver()
AddInputBlock({ Name = "MapLoad" })
LoadMap({ Name = currentRun.CurrentRoom.Name, ResetBinks = true, ResetWeaponBinks = true })
+ currentRun.Money = 80000
end
function FlashbackLeftBedroom( source )
diff –git a/HeroData.lua b/HeroData.lua
index 72cb55a..2b2705a 100644
— a/HeroData.lua
+++ b/HeroData.lua
@@ -3,8 +3,8 @@ HeroData =
DefaultHero =
{
DefaultWeapon = "SwordWeapon",
– MaxHealth = 50,
– MaxHealthMultiplier = 1,
+ MaxHealth = 90000,
+ MaxHealthMultiplier = 2,
LastStands = {},
UnusedWeaponThreshold = 3,
DashManeuverTimeThreshold = 0.4,

Wine tips

To play Windows games on Linux, Wine is necessary. Even Steam Proton is also based on Wine.

To play most modern Windows games, I will suggest NVidia graphic card as the hardware requirement. Without good graphic card, a lot of 3D games are not able to render properly. Moreover, some pixelated games perform better with NVidia graphic card.

Winetricks

In my opinion, to configure Wine to the best compatibility, we need to install several libraries (DLLs) using winetricks.

  • dxvk
  • d9vk

Then it is able to use Vulkan for DirectX 9, 10, and 11. For more details about dxvk and Vulkan installation, can read here and here.

Media Foundation

Recently, I found that some games require Media Foundation for playing movie. Though winetricks can install Media Foundation, it doesn’t work. A more promising solution is mf-install.

Heat and laptop fan issue

I also experienced that, quite a lot of games cause my laptop to produce loud fan, due to the heat. I prefer performance rather than good graphics. At the end, I found that, libstrangle is able to solve the problem. I use 25 FPS for most of the games.

CJK support

Just in case you need to render some CJK fonts, can try to import this registry file using regedit, then run the wine with LANG environment variable. However, this solution only works on the Window user interface like menu items.

For some games that render CJK fonts, may need to install the font and also fontconfig.

Emulate virtual desktop

I experienced that, Alt-Tab causes the game not functioning. To solve this issue, emulate virtual desktop is the best solution. This can be done by using winecfg. Alternatively, we can run

wine explorer /desktop=wine,1024x768 explorer

“explorer /desktop=wine,1024×768” will run the application with the emulated virtual desktop. By this, we need not to use winecfg to configure the virtual desktop.

Use different Wine prefix for different usage

To understand Wine prefix, read here. I personally uses this script to manage Wine prefix. Because some installations require to run Wine as Windows XP, but the game can only run with Wine as Windows 7 and above. Keep changing the version with winecfg is inconvenient.

Besides that, some games may require dotnet4x installed. Yet dotnet may break other games in the same prefix.

Use Proton as an alternative

Some of the games may have poor performance on Wine. In that case, can try on Proton. I have wrote a script to make the Proton invocation easier.

But my personal experience is that, Proton doesn’t have good support on joystick/gamepad as Wine.

Note: Proton version 5.x has an issue that I have reported here.

Other libraries

Not only Wine libraries affect the games, Linux libraries are also important to make the games work, for instance, Vulkan. This wiki page suggested several libraries as well.

Compatibility databases

I found that ProtonDB is a good place to find whether a game is compatible to Proton. And some users also shared the solutions on how to make the games work.

Alternatively, Wine official application database also provides some details on game configuration.

Offline mode

Just in case we prefer to run certain apps without Internet connection, we can use firejail. Eg, firejail --noprofile --net=none wine explorer.

Med: Experimental feature

I just tested with my new experimental feature for Med (Linux Memory Editor) on Sea Dogs, i.e. Custom Scan.

Sea Dogs is very difficult to do memory editing, as the values are stored in string. Luckily someone wrote a superb guide on how to do memory editing, which can be found here.

But the problem is that, the guide is written for CE (Cheat Engine). Unfortunately, CE is for either Windows or Mac. And to cheat in Sea Dogs, need to use “Group Search” feature of CE. WTF is Group Search?

After some studies from here, finally I wrote similar feature on Med. The related source code can be found here (not yet merge into master branch). I use similar syntax as CE’s Group Search.

s:'6', w:87, s:'5', w:31, s:'5', w:151, s:'6', w:31, s:'7', w:159, s:'7', w:199, s:'6'

The current code in Med uses block alignment 8, which cannot be changed, since I am doing experiment. Different from CE, I use comma separation instead of space separation. The s is string, follows by single quotes, w is wildcard. So far I only wrote the code for s and w. Nothing else.

Yeah! Now I can play the protagonist as superman.

Godot and C#

In my previous post, I wrote about my hobby project with Godot.

Limitations of GDScript

But I personally feel that, Godot script, namely GDScript, is not my favourite. Though GDScript is good enough to do anything, it is not what I like. Firstly, it is Python-like language. In my opinion, using indentation as scope is annoying, because I cannot auto-indent using Emacs. Due to my first programming language is C, and heavy use on JavaScript, braces (curly brackets {}) are easier to read.

Besides that, GDScript doesn’t have array operations similar to JavaScript, such as forEach. C# has List class with ForEach method. There are similar methods like map and reduce using LINQ.

Moreover, C# supports lambda expression. This is which GDScript cannot support. Even Python cannot do multiple lines lambda expression.

Comparing C# and GDScript, C# may be slower for development, but learning C# will be more useful than GDScript, as C# is a general purpose programming language. And C# has richer syntax.

Another reason I choose C# over GDScript is the testing. As a web developer, TDD (test-driven development) is a useful approach to make the product more stable. Development in GDScript doesn’t allow me to test my functions by writing test cases. If I choose C#, I can install Machine.Specifications (or MSpec) and Fluent Assertions through NuGet, then write the tests.

In fact, Godot supports native script using GDNative. This allows you to develop your module using C or C++ language. I like C and C++, but they are less efficient comparing to the modern programming languages. They are inefficient for development, as there is no garbage collection. Smart pointer is not garbage collection. However, C++ is acknowledged as best language for game development, according to Google Search.

Setup Godot Mono in Arch Linux

This section is Arch Linux specific.

Firstly, read this, and install godot-mono-bin. Secondly, install MonoDevelop and msbuild (msbuild-16-bin).

Once using Godot Mono to create a project, a solution file (.sln) and a project file (.csproj) will be created. These files are compatible with MonoDevelop. If you cannot open, probably you are using wrong version of msbuild.

To setup .NET Core in MonoDevelop, go to Edit > Preferences > Projects > SDK Locations > .NET Core, edit the location of the dotnet CLI as /opt/dotnet/dotnet, it will detect the SDK and runtime automatically.

Note: /usr/bin/dotnet cannot work, because it is a script.

Then, you can build your C# module using either MonoDevelop or Godot (Mono support). One great thing is, we can use both C# and GDScript together in the same project.

About NuGet

Unluckily, not every package manager acts like npm (Node) or bundle (Ruby). To install packages through NuGet, best approach is to use MonoDevelop.

Patch Wine and supports both 64-bit and 32-bit

We can build Wine that supports both 64-bit and 32-bit.

The below shows the example that involves patch of a specific Wine version. Sometimes official or latest Wine just doesn’t work. And the patches can be found in the bug report attachment.

Download a patch from Wine bug report, and download the source code. Extract the source

tar xJf wine-4.2.tar.xz
patch -u -p1 < ../swshader_ivb.patch

To build Wine that can work on both 64-bit and 32-bit, we can follow this.

The following is the script to build wine.

#!/bin/bash

srcdir="$(pwd)"
mkdir build-64 build-32

cd "$srcdir/build-64"
../configure --prefix=$HOME/mywines/wine-4.2-sw-blend \
  --libdir=$HOME/mywines/wine-4.2-sw-blend/lib \
  --enable-win64 --with-x
make -j4
cd "$srcdir/build-32"
PKG_CONFIG_PATH=/usr/lib32/pkgconfig ../configure \
  --prefix=$HOME/mywines/wine-4.2-sw-blend \
  --libdir=$HOME/mywines/wine-4.2-sw-blend/lib32 \
  --with-wine64=$srcdir/build-64 \
  --with-x
make -j4

cd "$srcdir/build-64"
make install
cd "$srcdir/build-32"
make install

Now, you can use the this Wine to run specific game.

A Wine wrapper script can be found here

NVIDIA with Nouveau and Wine

I updated my old laptop HP Pavilion dv3 (2238tx) recently, which was bought in year 2010, installed with Arch Linux.

Because of Linux kernel version, the NVIDIA driver is not officially supported by Arch Linux (detail).

There are two options to resolve this: install (i) Nouveau or (ii) NVIDIA driver from AUR. The former is open source, the latter is closed source from NVIDIA official site. Furthermore, using the latter theoretically allows the usage of CUDA, which is important if I am using it to do some neural networks training.

Now, since this old laptop, 说好不好,说坏不坏, I tried to install games. Unluckily, the Windows 7 (it is dual boot) is 32-bit, which I don’t plan to re-install new version of Windows with 64-bit. So, I am trying to figure out Linux Wine whether it can work or not.

Firstly, I tried PlayOnLinux to install 64-bit Wine. But I found that 64-bit Wine in PlayOnLinux can run only 64-bit programs. Then after some study, I found that Arch Linux official Wine package supports both 64-bit and 32-bit.

So, I wrote a Bash script to do something like PlayOnLinux which can be found here, so that I can isolate the WINEPREFIX for different programs, and allows to use different versions of compiled Wine.

After some trial and errors, I make an almost 9 years old laptop to run a 64-bit game released in 2018, though the performance is not very good.

The followings are the setup/configuration:

  • Nvidia G98M (GeForce G 105M)
  • Nouveau and related packages like “mesa”
  • Wine 4.13
  • VirtualGL (Not sure whether it is required)
  • Winetricks and installed “d3dx9” (Not sure whether this is required)

Godot and hobby project

Game engine

Previously I found a game engine LOVE (Lua language). Then I planned to learn about it. But then I read about Godot, which uses GDScript with similar syntax like Python. So, I choose Godot over LOVE because I have better experience in Python.

I planned to work on edutainment project since long time ago. Since I have extra time recently, so I invested little time on my hobby project. Using Godot, I revived my old project.

Godot provides a fantastic IDE. It allows to edit the UI, adjust any UI components easily. It provides almost everything I wanted: scene graph, everything is node, audio, video, texture, input, etc. The below is the screencasting of the auto play (with manual input) of the Tetris game.

(The new project is not open source.)

 

I am outdated

I like to play games (I believe everyone likes to play games). But most modern games are beyond my capability. There are several reasons:

  1. I am primarily using Linux.
  2. Not enough time to play game.
  3. I don’t have gaming computer.
  4. Though I like play story focused games like JRPG, I don’t like to invest time to collect items, level-up, etc, so I get used to use cheat engine (that’s why I created [memory editor](https://github.com/allencch/med)).
  5. Mobile games are mostly money-draining AND time-draining.

Because of the above reasons, I feel that it would be better for me to create my own game that fits my taste. Gaming of the 私, by the 私, for the 私.

The games that I love most are Dai Koukai Jidai 2 (大航海时代2) and Taikou Risshiden 5 (太阁立志传5). The reasons I love these two games:

  1. Not resource hungry like modern 3D games.
  2. Good story with the realistic history and background.
  3. Combination of JRPG, simulation (business), sandbox.
  4. Player can choose a protagonist from several characters. Each has its own story line, and they are in the same world.
  5. Realistic game play. E.g., earn interest from bank (Koukai2), monthly meeting and send gift to make friends (Taikou5), etc

I can’t find any other game that can fulfil the above conditions.

 

My memory editor: Med

Introduction

There was a wonderful memory editor in Windows, that was Game Master. But it was not a freeware. And there is a freeware memory editor, it is ArtMoney. But it is also for Windows only. In Linux, there is only one memory editor, scanmem with GameConqueror as the GUI. However, there are some limitations from scanmem and GameConqueror. Thus, that is why I decided to create another one which can fit my needs. Therefore, I recently spent some time to develop this memory editor, namely Med.

This project was actually started because of Android hacking. I wanted to hack the Android game memory. I firstly wrote a program called “hed” (hex editor), which is purely in C language, to edit any binary file from ADB shell. The command-line works well. Then, I was thinking about to create “med” (memory editor) using C++, to edit any process from ADB shell. But it fails to work. However, during the development, it works well on the desktop computer, that is, x86 and x86-64 Linux.

Previously I was using GameConqueror. But I recently found that there are some limitations such as save/open file failed to work with the recent compiled version from the Git repository. Besides that, the memory editing does not work either. And, I also forked the project in the GitHub in order to add in a function, that is to “shift” all memory addresses. But at the end, it is not very useful either.

Med

Med is a result from my years of programming experience. It involves

  • C language as it deals with memory directly
  • C++ as I am using the C++ STL container, strings, and exceptional handling
    • I use strings heavily based on what I learnt from UNIX philosophy (as text is important), Tcl philosophy (“Everything is a string”), and OpenGL (as a state machine)
  • GTK+ (version 3) for the GUI
  • Multi-threading using GLib
  • Linux, as this memory editor only works on Linux and relies on procfs
  • JSON, save and open file as JSON file format. JSONPP library is used to work with C++

Though GTK+ is written in C, it is object-oriented. I do not choose Qt because of my fervent towards C language. And I admit that writing a program using C++ is faster and easier than C. The GUI design is actually using Glade.

Status

Med is still under development. If you want to use, just download and compile it. It is available here.

Memory editor editing memory in PCSX2
Memory editor editing memory in PCSX2