Don't want to see articles from a certain category? When logged in, go to your User Settings and adjust your feed in the Content Preferences section where you can block tags!
Soldier of Fortune OpenGL error
Page: «2/3»
  Go to:
Hamish Sep 9, 2017
Quoting: ageresThere is a Linux port of Soldier of Fortune. Why don't you use it?
You try finding a boxed Loki Software copy of it though, to be fair. It is not exactly up on Steam or GOG.com for sale at the moment.

Your current issue megalanya seems to relate to the game wanting to use a 16 bit colour mode. Some quick research indicates that setting Wine to emulate a virtual desktop through winecfg may help. You should also probably set the game to use Windows 98 compatibility wile you are there to.
Hamish Sep 9, 2017
I will also point out that for the Windows version of Solider of Fortune you can apparently download a patched DLL that will permanently resolve the extension problem for you:
https://pcgamingwiki.com/wiki/Soldier_of_Fortune#Crashes_on_graphics_drivers_with_long_GL_EXTENSIONS_string

PCGamingWiki is your friend.
megalanya Sep 9, 2017
Quoting: ageresThere is a Linux port of Soldier of Fortune. Why don't you use it?

Because Loki Entertainment defunct in 2001. GNU/Linux version of this game is not available.

Quoting: Hamish
Quoting: ageresThere is a Linux port of Soldier of Fortune. Why don't you use it?
You try finding a boxed Loki Software copy of it though, to be fair. It is not exactly up on Steam or GOG.com for sale at the moment.

Your current issue megalanya seems to relate to the game wanting to use a 16 bit colour mode. Some quick research indicates that setting Wine to emulate a virtual desktop through winecfg may help. You should also probably set the game to use Windows 98 compatibility wile you are there to.

Quoting: HamishI will also point out that for the Windows version of Solider of Fortune you can apparently download a patched DLL that will permanently resolve the extension problem for you:
https://pcgamingwiki.com/wiki/Soldier_of_Fortune#Crashes_on_graphics_drivers_with_long_GL_EXTENSIONS_string

PCGamingWiki is your friend.

I have tried the suggestions you mentioned and many other suggestions already. But it didn't work, unfortunately. Discussion is here:

http://www.sof1.org/viewtopic.php?t=4311

New "ref_gl.dll" have already been made in "Soldier of Fortune Community Edition". It does not work.

I see you use an AMD card and an open source driver like myself.

"Soldier of Fortune: Community Edition" is available here:

http://www.sof1.org/sofdownload.php

If want to try, you can download it here.
whizse Feb 22, 2018
FWIW, it is possible to get the native linux port running somewhat:

* Install the Windows version of the game with Wine.
* Grab the modified installer for the Loki port (under beta) and extract it with unzip.
* Extract the resulting tar file for the linux port binaries.
* Grab game data files from Wine install.
* Symlink /usr/lib/i386-linux-gnu/libGL.so.1 (or wherever it lives on your system) to libGL.so in game dir.
* Start with ./sof +set gl_driver libGL.so

The game runs and is playable, the big gotcha is that sound doesn't work. Launching it with pasuspender results in a segfault here:
#0 0xf6d3f4f2 in sl_add () from /lib/i386-linux-gnu/libbsd.so.0
No symbol table info available.
#1 0xee110386 in _S_StartSound () from ./liboasnd.so
whizse Feb 22, 2018
Gave it a try with Wine 3.1, using the platinum version of the game.

Seems to be working fine with MESA_EXTENSION_MAX_YEAR=2000 and gl_gentextures_broken "1" in config.cfg.
rea987 May 27, 2018
Quoting: whizseThe game runs and is playable, the big gotcha is that sound doesn't work. Launching it with pasuspender results in a segfault here:
#0 0xf6d3f4f2 in sl_add () from /lib/i386-linux-gnu/libbsd.so.0
No symbol table info available.
#1 0xee110386 in _S_StartSound () from ./liboasnd.so

The game used to run natively by using OSSPD just fine on Linux Mint 18.3 (Ubuntu 16.04 based). However, starting with Ubuntu 17.10, OpenAL compatibility seems to be messed up. As the game uses a custom libopenal-0.0.so and liboasnd.so libraries, the game crashes if executed with an OSS emulator that was not a case with Ubuntu releases prior to 17.10. As I tried renaming libopenal-0.0.so and linking system's own OpenAL library to game's directory as libopenal-0.0.so; it returns no sound. I will contact with Alan Swanson who seems to be the owner of Loki Compatibility Libraries.
dusted Aug 9, 2018
Sorry to resurrect, but this seems like the latest thread.. Found this while working on getting SoF running on my new system..

I wrote a resolution hack, and that still works. I updated the page with additional information on how to fix a segmentation fault that occurs because of a too long extension list (what whizse suggest seems reasonable, but didn't work for me on Linux, so I found another way as detailed on the resolution hack page).

I'm having the same trouble as you, getting it to work with padsp.. Someone gives sl_add a bad parameter, probably _S_StartSound.. Now, I've not found the source for libaosnd.so (which provides _S_StartSound) but I've managed to get the modified alsa version from the Loki CD to build and that actually kinda works.. It will play ONE sound, after playback, it crashes, as described by rea987.

I wonder if the problem is that the poor _S_StartSound function ALSO gets unexpected data, in that case, it would get it from the alsa lib, which it loads. If that is the case, we may be able to modify the alsa lib to provide the expected parameters to _S_StartSound..

Anyone got updated info on this ? I'm very interested in knowing if rea987 were able to get hold of Alan and maybe obtain the source for the liboasnd ? :)
adamhm Mar 24, 2019
I decided to try SoF in Wine while it's on sale at GOG, and it looks like the error in the OP may be due to an issue with Mesa. On my main system (see profile) I get the same error and nothing I've tried has been able to resolve it. However on my old system which uses an Nvidia GPU this error does not occur - no tweaks are required to get the game to start (old system is still running Mint 18 though so that might also be a factor)

Running the game with "+set logfile 2 +set gl_log", the ref_gl section of the log looks like this on my main system:

Quote------- Loading ref_gl.dll -------
ref_gl version: GL 0.01
Initializing OpenGL display
...setting mode 3: 640 480 FS
...attempting fullscreen
...using desktop display depth of 32
...calling CDS: ok
...registering window class: ok
GLimp_Init() - no hardware acceleration detected
VID_CreateWindow() - GLimp_InitGL failed
Initializing OpenGL display
...setting mode 3: 640 480 FS
...attempting fullscreen
...using gl_bitdepth of 16
...calling CDS: ok
...registering window class: ok
GLimp_Init() - no hardware acceleration detected
VID_CreateWindow() - GLimp_InitGL failed
ref_gl::R_SetMode() - 16bit unavailable in this mode
ref_gl::R_SetMode() - invalid mode
ref_gl::R_Init() - could not R_SetMode()
ref_gl::R_Init() - could not load "opengl"
Initializing OpenGL display
...setting mode 3: 640 480 FS
...attempting fullscreen
...using desktop display depth of 32
...calling CDS: ok
...registering window class: ok
GLimp_Init() - no hardware acceleration detected
VID_CreateWindow() - GLimp_InitGL failed
Initializing OpenGL display
...setting mode 3: 640 480 FS
...attempting fullscreen
...using gl_bitdepth of 16
...calling CDS: ok
...registering window class: ok
GLimp_Init() - no hardware acceleration detected
VID_CreateWindow() - GLimp_InitGL failed
ref_gl::R_SetMode() - 16bit unavailable in this mode
ref_gl::R_SetMode() - invalid mode
ref_gl::R_Init() - could not R_SetMode()
ref_gl::R_Init() - could not load "3dfxvgl"
ref_gl::R_Init() - could not load "3dfxogl"
Cmd_RemoveCommand: avi not added
R_Shutdown() - Shutting down
************************************************************
ERROR: Could not initialize OpenGL rendering environment!

Make sure you have the latest drivers installed (GLSetup is recommended)
Make sure your desktop has more than 256 colors


************************************************************

However on my old system it looks like this:

Quote------- Loading ref_gl.dll -------
ref_gl version: GL 0.01
Initializing OpenGL display
...setting mode 3: 640 480 FS
...attempting fullscreen
...using desktop display depth of 32
...calling CDS: ok
...registering window class: ok
GL_PFD: color(24-bits) Z(24-bit)
GL_VENDOR: NVIDIA Corporation
GL_RENDERER: GeForce GTX 750 Ti/PCIe/SSE2
GL_VERSION: 4.6.0 NVIDIA 415.27
GL_MAX_TEXTURE_SIZE: 16384
...allowing CDS
...enabling WGL_EXT_swap_control
...using GL_ARB_multitexture (4 TMUs)
...GL_EXT_texture_filter_anisotropic available
...using GL_EXT_texture_filter_anisotropic
...using GL_S3_s3tc
------------------------------------
mos May 19, 2020
Quoting: dustedSorry to resurrect, but this seems like the latest thread.. Found this while working on getting SoF running on my new system..

I wrote a resolution hack, and that still works. I updated the page with additional information on how to fix a segmentation fault that occurs because of a too long extension list (what whizse suggest seems reasonable, but didn't work for me on Linux, so I found another way as detailed on the resolution hack page).

I'm having the same trouble as you, getting it to work with padsp.. Someone gives sl_add a bad parameter, probably _S_StartSound.. Now, I've not found the source for libaosnd.so (which provides _S_StartSound) but I've managed to get the modified alsa version from the Loki CD to build and that actually kinda works.. It will play ONE sound, after playback, it crashes, as described by rea987.

I wonder if the problem is that the poor _S_StartSound function ALSO gets unexpected data, in that case, it would get it from the alsa lib, which it loads. If that is the case, we may be able to modify the alsa lib to provide the expected parameters to _S_StartSound..

Anyone got updated info on this ? I'm very interested in knowing if rea987 were able to get hold of Alan and maybe obtain the source for the liboasnd ? :)
Sorry to resurrect x2, just for the record I've tried launching with the actual OSS4 drivers (not ALSA's kernel/userspace emulation) which turned out to be not that hard (and didn't at all require nuking half the system) and ended up with the same result - one sound played, then the crash (((
The bug is likely purely user-space, possibly akin to the exported symbol problem.
But cool to have sound working via the OSS in 2020 =P

PS don't think ALSA has anything to do with the game at all, it has to be OSS only.
PPS liboasnd must be a proprietary lib, specific to SoF.,,
mos May 29, 2020
https://youtu.be/JJpxEnPU6R0?t=48
Think this deserves a 3rd resurrect...
It's 3 in the morning, I'm wearing my glasses and I've finally got it.

An older libbsd did the trick (http://launchpadlibrarian.net/170117961/libbsd0_0.6.0-2ubuntu1_i386.deb)
LD_PRELOAD=./libbsd.so.0 ./sof (plus your favorite OSS emulator)

Damn it's so simple.


Last edited by mos on 29 May 2020 at 10:16 pm UTC
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
Login / Register


Or login with...
Sign in with Steam Sign in with Google
Social logins require cookies to stay logged in.

Buy Games
Buy games with our affiliate / partner links: