Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 854567 - games-fps/serious-sam-tse: switch to fork for working package
Summary: games-fps/serious-sam-tse: switch to fork for working package
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at if you want to take care of it
Keywords: EBUILD
Depends on:
Reported: 2022-06-27 08:32 UTC by t.x00100x.t
Modified: 2022-07-14 22:38 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---

New ebuild for Serious Sam The Second Encounter (serious-sam-tse-1.10.2.ebuild,6.44 KB, application/x-extension-ebuild)
2022-06-27 08:32 UTC, t.x00100x.t
New ebuild for Serious Sam The First Encounter (serious-sam-tfe-1.10.2.ebuild,6.51 KB, application/x-extension-ebuild)
2022-06-27 08:34 UTC, t.x00100x.t
Patch1 (rparh_security_2.patch,1.34 KB, patch)
2022-06-27 08:36 UTC, t.x00100x.t
Details | Diff
Patch2 (rparh_security_vk_2.patch,1.75 KB, patch)
2022-06-27 08:37 UTC, t.x00100x.t
Details | Diff
Manifest for Serious Sam TFE (Manifest,1.84 KB, text/plain)
2022-06-27 08:51 UTC, t.x00100x.t
Manifest for Serious Sam TSE (Manifest,1.84 KB, text/plain)
2022-06-27 08:52 UTC, t.x00100x.t
Fixing the game under building with gcc 11.3 (gcc-11.3_fixed_mod_startup.patch,1.40 KB, patch)
2022-07-01 16:44 UTC, t.x00100x.t
Details | Diff
Ebuild for building with gcc 11.3 Serious Sam The First Encounter (serious-sam-tfe-1.10.2.ebuild,7.41 KB, application/x-extension-ebuild)
2022-07-01 16:48 UTC, t.x00100x.t
Ebuild for building with gcc 11.3 Serious Sam The Second Encounter (serious-sam-tse-1.10.2.ebuild,7.23 KB, application/x-extension-ebuild)
2022-07-01 16:49 UTC, t.x00100x.t
Patch for standardize paths "usr_system_dir.patch" (usr_system_dir.patch,6.96 KB, patch)
2022-07-14 15:45 UTC, t.x00100x.t
Details | Diff
games-fps/serioussam/serioussam-1.10.2.ebuild (serioussam-1.10.2.ebuild,8.57 KB, application/x-extension-ebuild)
2022-07-14 15:47 UTC, t.x00100x.t
games-fps/serioussam/Manifest (Manifest,1.83 KB, text/plain)
2022-07-14 15:49 UTC, t.x00100x.t
games-fps/serioussamse/serioussamse-1.10.2.ebuild (serioussamse-1.10.2.ebuild,8.87 KB, application/x-extension-ebuild)
2022-07-14 15:50 UTC, t.x00100x.t
games-fps/serioussamse/Manifest (Manifest,1.83 KB, text/plain)
2022-07-14 15:52 UTC, t.x00100x.t
games-fps/serioussam-data/serioussam-data-1.5.ebuild (serioussam-data-1.5.ebuild,2.06 KB, application/x-extension-ebuild)
2022-07-14 15:52 UTC, t.x00100x.t
games-fps/serioussamse-data/serioussamse-data-1.7.ebuild (serioussamse-data-1.7.ebuild,1.95 KB, application/x-extension-ebuild)
2022-07-14 15:54 UTC, t.x00100x.t

Note You need to log in before you can comment on or make changes to this bug.
Description t.x00100x.t 2022-06-27 08:32:15 UTC
Created attachment 787979 [details]
New ebuild for Serious Sam The Second Encounter

At the moment Serious Sam The Second Encounter installed from here does not run.
On startup we have an error:
Program received signal SIGSEGV, Segmentation fault.
0xf72c58e0 in ?? () from /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/32/

Thread 1 "ssam_lnx.dynami" received signal SIGSEGV, Segmentation fault.
0xf72168e0 in ?? () from /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/32/

As you know, in 2016, Croteam published the source code of the Serious Sam game engine. Then, in 2016, Ryan Gordon took up porting it.
Porting work has not been completed. There are many mistakes left. Last fall, I started fixing the errors in the Linux port of the game.
Then I ported the Vulkan support to Serious Sam. I documented some of the fixes. They can be viewed here:

I wrote ebuilds for Serious Sam The First Encounter and Serious Sam The Second Encounter with Vulkan support and the Xplus add-on.
Ebuilds have "vulkan xplus cdrom" USE flags. The USE flag vulkan determines whether to build the game with volcano support. 
The xplus flag sets the xplus addition. The cdrom flag is for installing game content from disk.
Comment 1 t.x00100x.t 2022-06-27 08:34:36 UTC
Created attachment 787985 [details]
New ebuild for Serious Sam The First Encounter
Comment 2 t.x00100x.t 2022-06-27 08:36:36 UTC
Created attachment 787988 [details, diff]
Comment 3 t.x00100x.t 2022-06-27 08:37:04 UTC
Created attachment 787991 [details, diff]
Comment 4 t.x00100x.t 2022-06-27 08:51:44 UTC
Created attachment 787994 [details]
Manifest for Serious Sam TFE
Comment 5 t.x00100x.t 2022-06-27 08:52:16 UTC
Created attachment 787997 [details]
Manifest for Serious Sam TSE
Comment 6 James Le Cuirot gentoo-dev 2022-06-28 13:34:27 UTC
Haven't looked at this yet, but I've had my own ebuilds lined up for ages. The only reason I haven't published them yet is because I'd done some heavy patching to deal with the engine's terrible path handling. I got a bit sidetracked, trying to ensure I hadn't broken the game on Windows, but it was probably broken already. I had been thinking about coming back to this soon.
Comment 7 t.x00100x.t 2022-06-29 07:48:43 UTC
Thanks for reply. Serious Sam classic is my favorite game.
Recently, I discovered that if the video adapter is defined as ATI, 
then the parameter mdl_bFineQuality worsens the weapon model is set. 
This is due to the fact that the scripts are old and were designed for old hardware.
This is easy to fix before installing with sed.

> sed -i 's/mdl_bFineQuality = 0;/mdl_bFineQuality = 1;/g' "${D}/${dir}"/Scripts/GLSettings/RAM.ini
> sed -i 's/mdl_bFineQuality = 0;/mdl_bFineQuality = 1;/g' "${D}/${dir}"/Scripts/GLSettings/
Comment 8 t.x00100x.t 2022-07-01 16:44:24 UTC
Created attachment 789320 [details, diff]
Fixing the game under building with gcc 11.3

The day before yesterday I updated the system to the latest portage. Today I discovered that when building with gcc 11.3 with the -DSINGLE_THREADED=FALSE key, the mods does not start. Under the gdb debugger I found the problem and made a patch. The problem turned out to be the incorrect end of the game. Under gcc 10.3 this problem was not. The patch solves this problem. Now the game ends correctly and the mods are launched. I rewrote the ebuilds and at the same time added the arm64 architecture to them, since the fork works on Raspberry Pi 4.
Comment 9 t.x00100x.t 2022-07-01 16:48:55 UTC
Created attachment 789323 [details]
Ebuild for building with gcc 11.3 Serious Sam The First Encounter
Comment 10 t.x00100x.t 2022-07-01 16:49:41 UTC
Created attachment 789326 [details]
Ebuild for building with gcc 11.3 Serious Sam The Second Encounter
Comment 11 James Le Cuirot gentoo-dev 2022-07-11 22:47:01 UTC
Hey tx00100xt. I feel a bit odd addressing you as that, but you appear to want to remain anonymous, and I respect that.

I wanted to check the origins of this work as we cannot just assume it to be safe. I have quickly compared it against ptitSeb's fork and it looks okay. There are a lot of changes, but reading around, I understand that someone else forked ptitSeb's version privately and worked on it for a while, then you made that work public and took it further. Is that correct?

As I mentioned, I'd done quite a lot of work against ptitSeb's fork, but only a small amount has been merged as it is in progress. You seem to believe that his version is very buggy. It ran okay for me, but then I've only done some very brief testing. I don't want my efforts to go to waste, so I'll see whether I can redo some of my changes against your version.

Some of my work improves the path handling, not just to write files to HOME, but also to allow a more standards-compliant installation with the binaries in /usr/bin, the libraries in /usr/lib, and the data in /usr/share.

I find it strange that the engine source was duplicated for TFE and TSE when they used to share a single source tree. Do you know the reason for that?

Finally, my new ebuilds have just the data for TFE and TSE in separate packages, and both engines in a third package with "tfe" and "tse" as USE flags. I'd at least like to keep the data separate. Let's review this after I've gone over my patches.
Comment 12 t.x00100x.t 2022-07-12 12:35:04 UTC
Hello James Le Cuirot. Thank you for working on my favorite game.

Yes, that's exactly how it is. Last fall, I cloned the ptitSeb repository and built the game. 
Unfortunately, there were a lot of errors uncorrected since 2016. 
So I decided to take on the task of fixing bugs and bringing the game to a stable state. 
Later I published the result of my work.

Regarding the PtitSteb fork, I can say the following. I've looked at all the commits since 2016. 
And I did not see any engine fixes. In fact, all serious work stopped in the fall of 2016, when Ryan Gordon stopped accepting pull requests. 
This influenced my decision to take up the work of fixing the errors.

Since my fork is based on the ptitSeb fork, I think patching the paths /usr/lib  and /usr/share shouldn't be a problem.
These patches can also be added to the source code on github.

The original source code published by Croteam did not contain the Entities library for TFE. 
This library was later added to Ryan Gordon's port from the SDK published in 2001. 
In fact, the published code was more suitable for TSE. For convenience, I made two branches TFE and TSE at the very beginning of work. 
Because there are resource conflicts in the Scripts directory, as well as slightly different settings in the Controls directory.
Also, the game engine loads all resources from the game's root directory on startup into memory. 
So I decided early on that it would be more convenient to separate directories, since at an early stage I did not think about the directory /usr.

I also think it's better to have separate data and code ebuilds. It's just that the old ebuild was taken as a basis, where everything was together.

Best Regards
Comment 13 t.x00100x.t 2022-07-14 15:45:45 UTC
Created attachment 791396 [details, diff]
Patch for standardize paths "usr_system_dir.patch"

I decided to rewrite the code to standardize paths so that executables are in the /usr/bin directory, libraries in /usr/lib(64), and the date is in /usr/share.
After thinking, I decided that the best way would be to use the internal name of the game inside the engine.
This will immediately give the paths universality, regardless of the running game, TFE or TSE. I also made the most of internal functions and shared variables. As a result, the code turned out to be compact.
All changes are included in the patch usr_system_dir.patch. Also, the solution turned out to be universal. If the user launches the game from the /usr/bin directory, then all system paths /usr (share, lib ) are used, and if the game is built and launched in the home directory, then they are not used. I also included the xplus mod as a USE flag because it's the best thing ever fans made for a Serious Sam The First Encounter. For four years they worked and changed textures to HD. They also changed weapon models to HD and changed effects.

The directory structure looks like this:

Binaries - /usr/bin/"gamename"
Librares - /usr/lib(64), /usr/lib(64)/"gamename"
Game data - /usr/share/"gamename"
Mods librares - /usr/lib(64)/"gamename"/Mods/"modname"
Mods data - /usr/share/"gamename"/Mods/"modname"
User writable data - ~/.local/share/Serious-Engine/"gamename"

"gamename" - serioussam or serioussamse (internal game name).

As a result, I made four ebuilds. Two for the source code, the other two for installing data from the CD or image.
Comment 14 t.x00100x.t 2022-07-14 15:47:47 UTC
Created attachment 791399 [details]

Comment 15 t.x00100x.t 2022-07-14 15:49:21 UTC
Created attachment 791402 [details]

Manifest for serioussam-1.10.2.ebuild
Comment 16 t.x00100x.t 2022-07-14 15:50:30 UTC
Created attachment 791405 [details]

Comment 17 t.x00100x.t 2022-07-14 15:52:04 UTC
Created attachment 791408 [details]

Manifest for serioussamse-1.10.2.ebuild
Comment 18 t.x00100x.t 2022-07-14 15:52:55 UTC
Created attachment 791411 [details]

Comment 19 t.x00100x.t 2022-07-14 15:54:15 UTC
Created attachment 791414 [details]

Comment 20 t.x00100x.t 2022-07-14 17:47:24 UTC
In ebuilds serioussam-data-1.5.ebuild and serioussamse-data-1.7.ebuild, you need to remove the line DEPEND="games-fps/serioussam" and DEPEND="games-fps/serioussam", Otherwise, there is a cyclic dependency.
Comment 21 James Le Cuirot gentoo-dev 2022-07-14 22:38:23 UTC
Wow, I wish I could keep up here. It's been a busy week for me. This sounds great anyway. I'll try to take a look at the weekend.