neuromancer / avp

Aliens vs Predator Linux enhanced with cutscene support and new screen resolutions
Other
42 stars 7 forks source link

RE: Compiling the game #4

Open andrew-mcmahon opened 5 years ago

andrew-mcmahon commented 5 years ago

I can see there's a few people struggling to get this working so I thought I'd post as I've had no trouble getting it to compile.

These instructions relate to Debian Testing so the package names will likely change on a different distribution. You don't have to use a chroot to do this but I prefer not to install lots of development packages on the system proper.

First off I've set up a new chroot with debootstrap:

mkdir mychroot
debootstrap --arch amd64 --variant minbase sid mychroot/ http://deb.debian.org/debian/

Once that's done we can chroot into it and start downloading some packages:

sudo chroot mychroot/
apt install build-essential git cmake cmake-curses-gui libopenal-dev libsdl1.2-dev libavcodec-dev libavformat-dev libavdevice-dev libavfilter-dev libavresample-dev libswscale-dev

cmake-curses-gui is optional; I find it's an easy way of altering cmake build options after using cmake.

Clone the repository somewhere: git clone https://github.com/neuromancer/avp

Change into the cloned directory: cd avp

Make a build directory and change into it: mkdir build; cd build

Configure the project with cmake: cmake ..

Optionally use the cmake gui to change build options; there's not a lot to alter - it already picks sensible defaults besides SDL2 is completely busted: ccmake .

Compile: make { or do make -j4 to use four cpu cores }

Even on my old Phenom II 955 the code should compiles very quickly. Now you need the game data. I use innoextract with GOG's installer: innoextract -d output setup_avp_classic_20160330_\(2149\).exe

Rename all the files/folders to lower case with the exception of the FMV folder. The final thing should look like this: https://pastebin.com/Wnmc24nT

You'll need a few packages installed to play the game too i.e: libopenal, libsdl1.2, etc. If you've already got steam installed you likely have a lot of them already.

To start the game in fullscreen mode use: ./avp -f

neuromancer commented 5 years ago

Thanks a lot @andrew-mcmahon. I should update the README with this.

andrew-mcmahon commented 5 years ago

I should say that's it not a perfect experience...yet My mouse doesn't appear to function at all when not running in fullscreen mode. Strangely I'm completely unable to rebind any of the keys from the defaults via the in-game options - so I have to use the arrow keys; I've not used those in an FPS for about 25 years! =D Whilst the intro videos play the majority of smacker files don't - so you won't be seeing any of the videos that should play in-game; those are pretty vital to give the player guidance. I'm no programmer I'm afraid but I know there's libsmacker and likely other ways of doing it too. http://libsmacker.sourceforge.net/

I haven't tested music playback as GOG haven't included any ripped music files or a cd image in the installer. I'd have get a bin/cue image from archive.org and rip the music to flac/vorbis. The FMVs folder + files should probably all be lowercase too for consistency.

andrew-mcmahon commented 5 years ago

Thanks a lot @andrew-mcmahon. I should update the README with this.

Thanks for taking the time to improve and get AvP running natively: https://imgur.com/a/iQFxLaf It feels as though it's about 80% of the way there!

Ultimately I'll be much nicer than being dependent on WINE: https://imgur.com/a/S3gQu1U _(winetricks d3dx9_43 d3dcompiler43 to get it working) You'll notice the higher CPU usage. WINE does appear to show a proper hor+ widescreen image though i.e: it's not stretched.

The problems I've mentioned appear to affect the original source found here: http://icculus.org/avp/files/avp-20170505-a1.tar.gz http://icculus.org/avp/files/avp-20150214.tar.gz

So this isn't something you've caused - it looks like it's always been partly broken/missing functionality.

johndoe71rus commented 4 years ago

try to build on lubuntu 14.04 https://paste.ubuntu.com/p/tvsfp6zSxK/ I understand that 14.04 is an old system. But maybe there will be clues?

neuromancer commented 4 years ago

Compilation works, but linking is failing:

MakeFiles/avp.dir/src/bink.c.o: In function `BinkDecodeFrameInternal':
bink.c:(.text+0x197): undefined reference to `av_frame_unref'
CMakeFiles/avp.dir/src/bink.c.o: In function `BinkStartMovie.part.0':
bink.c:(.text+0x86b): undefined reference to `av_frame_alloc'
bink.c:(.text+0x95e): undefined reference to `av_frame_alloc'
CMakeFiles/avp.dir/src/bink.c.o: In function `BinkDecodeFrame':
bink.c:(.text+0xbd2): undefined reference to `av_frame_unref'
CMakeFiles/avp.dir/src/bink.c.o: In function `CreateBinkFMV':
bink.c:(.text+0x1f67): undefined reference to `av_frame_alloc'
bink.c:(.text+0x1ff5): undefined reference to `av_frame_alloc'

This is most likely caused by an old version of ffmpeg/avconv in the Lubuntu 14.04 repository. It is very recommended to upgrade if you want to use it.