lokigames:creatures3

no way to compare when less than two revisions

Différences

Ci-dessous, les différences entre deux révisions de la page.


lokigames:creatures3 [2026/06/23 07:20] (Version actuelle) – créée - modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +====== Creatures Internet Edition ======
  
 +Nothing exciting to say about installing the game & running it with the bundled SDL-1.2.
 +
 +But things get really nasty if you want to use your system libraries & sdl12-compat in particular...
 +<code>
 +mkdir libs_backup
 +mv libSDL-1.2.so.0 libSDL_mixer-1.2.so.0 libsmpeg-0.4.so.0 libs_backup/
 +</code>
 +
 +===== Adventures in the dark age of broken toolchain - Part 1 =====
 +<code>
 +$ creatures3
 +Welcome to Creatures 3!
 +Inconsistency detected by ld.so: dl-version.c: 204: _dl_check_map_versions: Assertion `needed != NULL' failed!
 +</code>
 +
 +''lc2e'' is a very old ELF binary, and unfortunately it is very broken by modern standards:
 +  * it contains explicit symbol-version requirements against ''libdl.so.2'' (''readelf -V lc2e'')
 +  * but it doesn't declare a dependency on ''libdl.so.2'' (''readelf -d lc2e'')
 +
 +You can use patchelf to fix this:
 +<code>patchelf --add-needed libdl.so.2 lc2e</code>
 +
 +But why does it work with the bundled ''libSDL-1.2.so.0'' ?
 +
 +Because the bundled ''libSDL-1.2.so.0'' has a dependency on libdl (and that makes the loader happy), while any modern versions (be it a real SDL-1.2 or sdl12-compat) won't have it. Again: why ?
 +
 +Because with the release of GLIBC 2.34 in 2021, libpthread, libdl, libutil, libanl have all been integrated into libc; new build does not link with any of them anymore.
 +
 +
 +===== Adventures in the dark age of broken toolchain - Part 2 =====
 +<code>
 +$ creatures3
 +Welcome to Creatures 3!
 +lc2e: symbol lookup error: /home/twolife/games/creatures3/lc2elib.so: undefined symbol: SDL_RateSLOW
 +</code>
 +
 +This is a fun one. ''lc2elib.so'' use some private symbols that are not part of SDL-1.2’s public ABI, that are surprisingly exported by the bundled ''libSDL-1.2.so.0'' ; but that aren't exposed in any other build of SDL-1.2 made in the last 2 decades.
 +
 +Here is the list of symbols we need to provide:
 +<code>
 +void SDL_Convert16LSB(SDL_AudioCVT *cvt, Uint16 format)
 +void SDL_Convert16MSB(SDL_AudioCVT *cvt, Uint16 format)
 +void SDL_Convert8(SDL_AudioCVT *cvt, Uint16 format)
 +void SDL_ConvertEndian(SDL_AudioCVT *cvt, Uint16 format)
 +void SDL_ConvertMono(SDL_AudioCVT *cvt, Uint16 format)
 +void SDL_ConvertSign(SDL_AudioCVT *cvt, Uint16 format)
 +void SDL_ConvertStereo(SDL_AudioCVT *cvt, Uint16 format)
 +void SDL_RateDIV2(SDL_AudioCVT *cvt, Uint16 format)
 +void SDL_RateMUL2(SDL_AudioCVT *cvt, Uint16 format)
 +void SDL_RateSLOW(SDL_AudioCVT *cvt, Uint16 format)
 +</code>
 +
 +The solution I choose is simple: reuse the code from SDL-1.2 in [[https://github.com/libsdl-org/SDL-1.2/blob/main/src/audio/SDL_audiocvt.c|src/audio/SDL_audiocvt.c]] and make it available to the game.
 +
 +===== Solution =====
 +Just compile the code from [[https://github.com/twolife/creatures3-linux-sdl]] and replace ''libSDLStretch.so'' in the game directory.
 +
 +<code>
 +SDL_VIDEODRIVER=x11 creatures3
 +Welcome to Creatures 3!
 +[...]
 +</code>
  • lokigames/creatures3.txt
  • Dernière modification : 2026/06/23 07:20
  • de twolife