Alien vs Predator Port


Rockthesmurf

Advanced Member
Joined
Jul 18, 2003
Messages
1,115
Age
40
Location
Manchester, UK
Website
Visit site
EDIT: A build of Aliens vs Predator (please note plural Aliens not Alien) is now on the repository:

http://repo.openpandora.org/?page=detail&app=com.pawprintgames.avp

To play the game you have to do the following (only tested with the GOLD version of the game):

  1. Get data (AVP Gold works) from a previously installed version of game
  2. Make all files and folders lower case
  3. Copy data into pandora\appdata\com.pawprintgames.avp
  4. Launch game
Please note you need the 'old' AVP Gold PC game, not the one released in 2010/2011.

Some known issues include:

  • Flickering on loading screen (looks like it is only drawing to one buffer, so when it swaps just see what ever happens to be left in memory)
  • Performance in game being slow at times
  • Performance dipping when sounds are playing
  • Controls not being optimized for Pandora
/EDIT


Hi there,
 
Is it possible to port AVP to the Pandora? I had an attempt myself tonight, with a fork of avpmp. My fork can be found here:
 
https://github.com/Scraft/avpmp
 
With _PANDORA defined I am able to compile and run the game, I see the front end, can select the predator campaign, hit the keyboard buttons a few times and get into the level, I can hear sounds and move around, however the screen remains black (it is okay in the front end).
 
Once compiled, to run the game you have to have the AVP gold data, so I got this from my PC, you then have to rename all files and folders to be lowercase. Then when launching the game, you have to run with something like:
 
env APV_DATA=data/gold AvpMP
 
I wondered if anyone had got further than this, or if anyone wanted to collaborate in trying to fix this?
 
Last edited by a moderator:
There was an earlier attempt even with a gles conversion afaik.
But it had similar problems iirc.
 
FWIW: I have also tried running against nanoGL as well as the GL lib floating around on another thread here, but don't seem to be able to get anything on screen. It has been suggested that the problem might be to do with the fact AvP runs the front end in software SDL and the game in hardware GL on the top of SDL, and when it switches between the two perhaps it doesn't correctly destroy create the various display/GL/etc. contexts.
 
Not an easy way to skip the main menu, however I just tried initialising the video mode to the GL/game mode right at the beginning, and not doing the menu SDL mode initialisation. The menu still renders (although offset, still navigatable though) however the game still appears black, so maybe it is not changing video modes that is the problem, but maybe there is something just stopping the GL calls being visible (not clearing z buffer, z range being wrong, culling direction wrong, etc.)

I don't have any tools set up on Pandora to debug this sort of issue (want to really be able to see the GL textures, back buffer, front buffer, draw calls, etc.)
 
Very interesting.

I have setup a codeblock project (for now on old toolchain...like djwillis one) just for test.

I have to made some changes to compile and one is to reenable

typedef char TCHAR; on fixer.h

otherwise didn't compile (says..   iff.hpp:927: error: 'TCHAR' has not been declared).

So reenabling this compile fine but i have problems finds the data, i have only the data from demo version 1.5

it says on terminal:


Opening GLES library...
CreateGlEsInterface
Looking up GLES symbols...
Done!
Unable to find the AvP gamedata.
The directory last examined was: data/gold
Has the game been installed and
are all game files lowercase?


I have setup a dir on a SD card like this:

avpmp/

          runme.sh        (an sh file to execute the game)

          avpmp.bin       (the game exe)

          libopenal.so.1    (a lib needed by the game)

          predator_readme.txt    (a readme found on PC demo dir)

          english.txt                    (a file found on PC demo dir)

          avpvmopt.bin               (a file found on PC demo dir)

          data/

                 gold/

                        fastfile/

                                   common.ffl

                                   ffinfo.txt

                                   tex1.ffl

                                   (various tex...ffl)

                                   snd15.ffl

                        avp_rifs/

                                     invasion_p.rif

                        avp_rufs/

                                      predator.rif

                                      pred_hud.rif

                                      hnpcalien.rif

                                      hnpcmarine.rif

                        fmvs/

                               various .smk files
 
AVP is strange in that it uses SW SDL for the menu and SDL GL for the game engine. This going back and forth works in the desktop but I dont think it works right with EGL.
 
Definately not me, but maybe someone who actually knows how to do it ;)
 
I have to made some changes to compile and one is to reenable

typedef char TCHAR; on fixer.h
Thanks for pointing this out, I just noticed my build scripts define TCHAR=char which would explain the error I was getting, your fix to commenting that line back in is the right one.

With regards to data, it sounds like you have everything set up right, I have only tried with the full game, not with the demo, the function that checks for data checks for these to exist:

/avp_huds

/avp_huds/alien.rif

/avp_rifs

/avp_rifs/temple.rif

/fastfile

/fastfile/ffinfo.txt

Perhaps you are missing avp_huds for some reason? Maybe this doesn't come with the demo? You could modify files.c line 555, function check_game_directory not to check that directory, although perhaps the game will have problems then.
 
My next plan for this project, was to create a function that runs before anything else, and does the SDL GL set up (using the same calls that the game makes) and then just trying clearing the buffers and rendering a triangle to the screen. If/when this works, the next plan is to initialise software SDL first, draw a texture with this, and then switch to hardware GL and attempt rendering the triangle again. If these tests both work and the game still renders black, my guess is some state stuff isn't right, I know there are a few functions that aren't implemented, some of which could be serious:

oglfunc.c

glWrapperPushAttrib ***

glWrapperPopAttrib ***

glWrapperPixelZoom

glWrapperRasterPos2i

glWrapperDrawPixels

glWrapperPushClientAttrib ***

glWrapperPopClientAttrib ***

*** could end up with a bad GL state that ends up with a black screen I guess.
 
If SDL is used only for initial menus, not during the main game,

could we not just close down SDL after the menu bit is done, then start again with SDL+GLES?

You could even exec the program again, with different options or something, if need be.

But it might have to transfer some data from the menu options in that case, in a file or whatever.

Still, I figure that might be easier than grappling with all this SDL vs GL stuff.

I didn't look at the code, so likely this is a wrong suggestion!  anyhow, good luck.

( My dodgy game actually re-execs itself for each new game, or changing to a different level! )
 
Last edited by a moderator:
I think I may have mentioned above, I actually hacked the code so it didn't reinitialise the video mode between hardware/software but the game still ends up with a black screen. Yesterday I quickly got the code to compile, link and run on Windows (which is my development environment). I can confirm it looks okay on there. The next thing I am going to do on Windows is stub out the GL functions that are stubbed out on Pandora to see if I get a black screen on PC or not. Getting a black screen would indicate the missing functions are 'important' not getting a black screen would indicate the problem is elsewhere at least..
 
Okay, I found a few problems on the Windows build with the various missing GL functions (that I simply stubbed out), I've fixed that up now so it works correctly on Windows.

I have quite a basic question for now, does the standard SDL allow for a SDL_OPENGL surface to be created on the Pandora? I've seen some information around that on Pandora, instead of creating an SDL_OPENGL surface, one should instead ensure SDL_OPENGL and SDL_HWSURFACE are not used, and instead SDL_SWSURFACE is used. On top of that, the following can be added:

EGL_Open ***** Added

SDL_SetVideoMode( Width, Height, 0, SDL_SWSURFACE ); ***** NOT using SDL_OPEN or SDL_HWSURFACE instead using SDL_SWSURFACE

EGL_Init **** Added

And instead of SDL_GL_SwapBuffers one can call EGL_SwapBuffers.

I have noticed that in some versions of SDL, there is an option for SDL_OPENGLES (ES version) however, this doesn't appear to be available in the version I am using. The versions I have found that have SDL_OPENGLES have source only and no library (I am not able to compile the SDL library myself so would need prebuilt).

Could anyone advise what is the most 'proper' way to make an SDL GL application work on the Pandora? AVP only uses a handful of SDL_GL_ functions so it feels like it maybe a simplish case The functions it uses are: 

SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); 

SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5); 

SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); 

SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); 

SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); // All of the above get done via EGL_Init

SDL_GL_SwapBuffers(); // replace with EGL_SwapBuffers( );
 
Back
Top