ptitSeb / Serious-Engine

A port to the OpenPandora (and working fine on plain Linux) of the open source version of a game engine developed by Croteam for the classic Serious Sam games. Status: Working (for both FE and SE).
https://pyra-handheld.com/boards/threads/serious-sam-first-encounter.77225/
GNU General Public License v2.0
75 stars 22 forks source link

Cannot initialize classes when built as Release #1

Closed sum01 closed 7 years ago

sum01 commented 7 years ago

Testing the install with this (WIP) PKGBUILD for Arch-Linux

# Maintainer: sum01 <sum01@protonmail.com>
pkgname=('serious-engine-git')
pkgver=r396.dce3915
_srcname="Serious-Engine"
pkgrel=3
pkgdesc="A game engine developed by Croteam for the classic Serious Sam games."
arch=('i686' 'x86_64')
url="https://github.com/ptitSeb/Serious-Engine"
license=('GPL2')
depends=('sdl2' 'python' 'bash')
makedepends=('cmake' 'make' 'sed')
source=("git+https://github.com/ptitSeb/Serious-Engine.git")
sha512sums=('SKIP')
pkgver(){
  cd "$srcdir/$_srcname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare(){
  cd "$srcdir/$_srcname/Sources/"
  if [[ $CARCH = "i686" ]]; then
      sed -i 's/cmake -DCMAKE_BUILD_TYPE=Debug/cmake -DCMAKE_BUILD_TYPE=Release/g' build-linux32.sh
      sed 's/cmake -DCMAKE_BUILD_TYPE=Release/cmake -DTFE=TRUE -DCMAKE_BUILD_TYPE=Release/g' build-linux32.sh > build-linux32-tfe.sh
      chmod 755 build-linux32-tfe.sh
  else
    sed -i 's/cmake -DCMAKE_BUILD_TYPE=Debug/cmake -DCMAKE_BUILD_TYPE=Release/g' build-linux64.sh
    sed 's/cmake -DCMAKE_BUILD_TYPE=Release/cmake -DTFE=TRUE -DCMAKE_BUILD_TYPE=Release/g' build-linux64.sh > build-linux64-tfe.sh
    chmod 755 build-linux64-tfe.sh
  fi
}
build(){
  cd "$srcdir/$_srcname/Sources/"
  if [[ $CARCH = "i686" ]]; then
    ./build-linux32.sh
    cp cmake-build/ssam ../Bin/
    cp cmake-build/Debug/* ../Bin/Debug/

    rm -rf cmake-build
    ./build-linux32-tfe.sh
    cp cmake-build/ssam-tfe ../Bin/
    cp cmake-build/Debug/* ../Bin/Debug/
  else
      ./build-linux64.sh
      cp cmake-build/ssam ../Bin/
      cp cmake-build/Debug/* ../Bin/Debug/

      rm -rf cmake-build
      ./build-linux64-tfe.sh
      cp cmake-build/ssam-tfe ../Bin/
      cp cmake-build/Debug/* ../Bin/Debug/
  fi
}
package(){
  mkdir -p "$pkgdir"/usr/{bin,lib/$pkgname}/
  mv "$srcdir/$_srcname" "$pkgdir/usr/lib/$pkgname/"
  ln -s /usr/lib/$pkgname/$_srcname/Bin/ssam "$pkgdir/usr/bin/ssam"
  ln -s /usr/lib/$pkgname/$_srcname/Bin/ssam-tfe "$pkgdir/usr/bin/ssam-tfe"
}

After you recommended switching to build as Release instead of Debug.

Trying to launch either ssam or ssam-tfe results in a "Cannot initialize classes" error.

Cannot initialize classes; Cannot load DLL file 'usr'lib'serious-engine-git/Serious-Engine/Bin/libEntitiesMP.so': /usr/lib/serious-engine-git/Serious-Engine/Bin/libEntitiesMP.spo: cannot open shared object file: No such file or directory

STUBBED: load window icon in ~/NameOfFolderIBuiltIn/serious-engine-git/src/Serious-Engine/Sources/SeriousSam/MainWindow.cpp, line 168.
STUBBED: Need SDL invisible window or something in ~/NameOfFolderIBuiltIn/serious-engine-git/src/Serious-Engine/Sources/SeriousSam/MainWindow.cpp, line 327.

I'm not really sure why it's even trying to look in the ~/NameOfFolderIBuiltIn/ and that might be the issue.

ptitSeb commented 7 years ago

for sse (tse), "ssam" "libShaders.so" "libEntitiesMP.so" and "libGameMP.so" should all be in the "Bin" subfolder. for sse-tfa, it's "ssam-tfe" "libShaders.so" "libEntites.so" and "libGame.so" that should be in the Bin subfolder.

Easiest way is to extract / copy a Window game, and replace the Bin folder by the one above. Also, don't forget to copy "SE1_10.gro" from the root of the git clone to the folder where all other ".gro" from the game resides.

(even without any data from the full game, a minimal menu should be launchable from the root of the git)

sum01 commented 7 years ago

Alright, the new PKGBUILD seems to build/install correctly. No more crashes when going to the options menu either. 👍

I don't actually have a game to test it with, so hopefully that's fine. I'll upload it and ask the person who requested it to test.

ptitSeb commented 7 years ago

Good :)

Actually, I'm experimenting with the TSE Demo Data that you can find on Internet. If you manage to extract everything from the InstallShield exe, you should have everything needed to try the game.