TheForceEngine icon indicating copy to clipboard operation
TheForceEngine copied to clipboard

[Linux] Snap package

Open zyga opened this issue 11 months ago • 10 comments

Hey

I'm one of the upstream maintainers of snapd. I'm also in love with the original game and I absolutely love the open source force engine :)

I'm working on the packaging recipe and a helper script that allows easily installing data from the GOG .exe file or GOG shell script, so that one can play the game immediately after installation.

I'm working on some of the details but the rough idea is as follows:

snap install the-force-engine
the-force-engine.load-gog-data setup_star_warstm_dark_forces_1.0.2_(20338).exe

The name of the snap and the name of the support program is just a proposal.

EDIT: I hit submit too soon.

I wanted to collect feedback if there's someone already working on the package, if there is any preference on naming things or other feedback. The snap would obviously come with a graphical launcher so it would work from the menu as well.

zyga avatar Mar 06 '24 19:03 zyga

Looking forwards to this very much. The flatpak was a major let down - it just doesn't fly :/

dziadulewicz avatar Mar 07 '24 13:03 dziadulewicz

I've posted a very early version of the package to collect feedback. There are details on the snapcraft forum.

https://forum.snapcraft.io/t/the-force-engine-to-play-classics-like-star-wars-dark-forces-in-modern/33799/11

zyga avatar Mar 08 '24 21:03 zyga

I've posted the snap package to the store now: https://snapcraft.io/the-force-engine

I have two small patches that need discussion. One is probably okay, the other one papers over a bug in the code that should be fixed in a different way.

zyga avatar Mar 09 '24 14:03 zyga

What is the bug in the code?

luciusDXL avatar Mar 23 '24 00:03 luciusDXL

The bug is that the game loads some assets relative to the current working directory, even before finding assets in the system-wide "share" directories. Please look at the code in this patch: https://gitlab.com/zygoon/the-force-engine-snap/-/blob/main/0001-Add-crude-support-for-SNAP-usr-share-TheForceEngine.patch?ref_type=heads

This effectively changes the working directory to where the data is, because the data loaded immediately after that is not searching any directory list but assumes you are running from the build directory and assets are next to the binary.

CC @luciusDXL - thank you for looking :)

zyga avatar Apr 04 '24 13:04 zyga

@zyga I installed your snap TFE on Mint 21.3. I can start the program, but when I want to start a game it crashes (window closes). Any idea?

Admiral-Harkov avatar May 31 '24 20:05 Admiral-Harkov

Can you open up the terminal and run the game there? We should see what is going on and why it might be crashing.

zyga avatar Jun 01 '24 09:06 zyga

same, when starting a game it closes the window, I ran it this way in a terminal:

/snap/bin$ the-force-engine [Main] The Force Engine v1.09.530-13-gd029fe2b

[Paths] Program Path: "/snap/the-force-engine/5/usr/share/TheForceEngine/" [Paths] Program Data: "/home/matthias/snap/the-force-engine/common/Data/" [Paths] User Documents: "/home/matthias/snap/the-force-engine/common/Data/" [Paths] Source Data: "/home/matthias/Spiele/DarkForces/" [Startup] TFE_System::init [Display] Fullscreen enabled. [Display] Vertical Sync enabled. [RenderBackend] OpenGL Device Tier: 3 [Startup] TFE_AudioSystem::init [Audio] SDLAudio using interface 'pulseaudio' [Audio] Device 00: Tiger Lake-LP Smart Sound Technology Audio Controller HDMI / DisplayPort 3 Output [Audio] Device 01: Tiger Lake-LP Smart Sound Technology Audio Controller HDMI / DisplayPort 2 Output [Audio] Device 02: Tiger Lake-LP Smart Sound Technology Audio Controller HDMI / DisplayPort 1 Output [Audio] Device 03: Tiger Lake-LP Smart Sound Technology Audio Controller Speaker + Headphones [Audio] Starting up audio stream for device '' [Startup] TFE_MidiPlayer::init [Startup] TFE_Polygon::init [Startup] TFE_Image::init [Startup] TFE_FrontEndUI::init [MemoryRegion] Allocated new memory block in region 'game' - new size is 1 blocks, total size is '8388608' [MemoryRegion] Allocated new memory block in region 'level' - new size is 1 blocks, total size is '8388608' [Progam Flow] The Force Engine Game Loop Started [Game] Dark Forces Version: 1.0 (Build 1) [MemoryRegion] Allocated new memory block in region 'Landru' - new size is 1 blocks, total size is '4194304' [MemoryRegion] Allocated new memory block in region 'Cutscene' - new size is 1 blocks, total size is '8388608' [Error : CrashHandler] Received Signal 11 errno 16 code 0 [Error : CrashHandler] faulting address 0x10 [Error : CrashHandler] Backtrace 9: [Error : CrashHandler] 000 /snap/the-force-engine/5/usr/bin/theforceengine(+0x1a6672) [0x57095e6c3672] [Error : CrashHandler] 001 /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x77c081ba7520] [Error : CrashHandler] 002 /snap/the-force-engine/5/usr/bin/theforceengine(+0x8bc67) [0x57095e5a8c67] [Error : CrashHandler] 003 /snap/the-force-engine/5/usr/bin/theforceengine(+0x8d0f8) [0x57095e5aa0f8] [Error : CrashHandler] 004 /snap/the-force-engine/5/usr/bin/theforceengine(+0xab61c) [0x57095e5c861c] [Error : CrashHandler] 005 /snap/the-force-engine/5/usr/bin/theforceengine(+0x18eea) [0x57095e535eea] [Error : CrashHandler] 006 /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x77c081b8ed90] [Error : CrashHandler] 007 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x77c081b8ee40] [Error : CrashHandler] 008 /snap/the-force-engine/5/usr/bin/theforceengine(+0x195a5) [0x57095e5365a5] Speicherzugriffsfehler (Speicherabzug geschrieben)

Admiral-Harkov avatar Jun 01 '24 22:06 Admiral-Harkov

same, when starting a game it closes the window, I ran it this way in a terminal:

/snap/bin$ the-force-engine [Main] The Force Engine v1.09.530-13-gd029fe2b

Thanks for sharing this.

I cannot immediately reproduce the issue. What kind of GPU do you have? Perhaps this is related to the graphics card used?

zyga avatar Jun 18 '24 05:06 zyga

intel iRIS XE, here is my system info output:

System: Kernel: 6.5.0-35-generic arch: x86_64 bits: 64 compiler: gcc v: 12.3.0 clocksource: tsc Desktop: Cinnamon v: 6.0.4 tk: GTK v: 3.24.33 wm: Muffin v: 6.0.1 vt: 7 dm: LightDM v: 1.30.0 Distro: Linux Mint 21.3 Virginia base: Ubuntu 22.04 jammy

Machine: Type: Laptop System: Acer product: Aspire A517-52 v: V1.25 serial: Mobo: TGL model: Jasmine_TL v: V1.25 serial: part-nu: 0000000000000000 uuid: UEFI: Insyde v: 1.25 date: 01/26/2022

CPU: Info: quad core model: 11th Gen Intel Core i7-1165G7 bits: 64 type: MT MCP smt: enabled arch: Tiger Lake rev: 1 cache: L1: 320 KiB L2: 5 MiB L3: 12 MiB Speed (MHz): avg: 1651 high: 4565 min/max: 400/4700 cores: 1: 1573 2: 4513 3: 400 4: 400 5: 400 6: 4565 7: 400 8: 964 bogomips: 44851 Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx

Graphics: Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] vendor: Acer Incorporated ALI driver: i915 v: kernel arch: Gen-12.1 ports: active: eDP-1 empty: HDMI-A-1 bus-ID: 0000:00:02.0 chip-ID: 8086:9a49 class-ID: 0300 Device-2: Quanta HD User Facing driver: uvcvideo type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 1-8:4 chip-ID: 0408:a061 class-ID: 0e02 Display: x11 server: X.Org v: 1.21.1.4 with: Xwayland v: 22.1.1 driver: X: loaded: modesetting unloaded: fbdev,vesa dri: iris gpu: i915 display-ID: :0 screens: 1 Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22") s-diag: 582mm (22.93") Monitor-1: eDP-1 model: BOE Display 0x084e res: 1920x1080 hz: 60 dpi: 128 size: 382x215mm (15.04x8.46") diag: 438mm (17.3") modes: 1920x1080 API: EGL v: 1.5 platforms: gbm: drv: N/A x11: drv: N/A inactive: wayland,device API: OpenGL v: 4.6 vendor: intel mesa v: 23.2.1-1ubuntu3.1~22.04.2 glx-v: 1.4 es-v: 3.2 direct-render: yes renderer: Mesa Intel Xe Graphics (TGL GT2) device-ID: 8086:9a49

Admiral-Harkov avatar Jun 18 '24 13:06 Admiral-Harkov