Release Project: Starfighter


diligentcircle

Well-Known Member
Joined
Aug 29, 2011
Messages
1,594
Age
30
Location
Milky Way galaxy
Website
onpon4.github.io
I don't know how many people are familiar with Project: Starfighter. It's a nice space shooter game developed by Parallel Realities (the developer of Blob Wars: Metal Blob Solid and others) and released in 2003 for the PC. Anyway, I've ported it to the Pandora. You can find it on the repo:


http://repo.openpand....92759361038745


If there are any other problems, let me know!


This port is definitely not a straight port. That would have been awful. I was sure to fix up the controls for the Pandora (and I am very pleased with the result; see below), and I shrank the game down from its original 800x600 to 800x480.


Regarding the controls: the documentation tells all, but one thing that was really nice that I was able to do is make people who want face buttons to be mouse buttons happy! See, Starfighter actually responds to key presses, not mouse clicks; mouse clicks actually just cause a key press to be registered. So as a result of this, you can "click" with the B button.


Since the current version on SourceForge has no music (music is being worked on right now), this port uses the old music that the original author used. The music has been removed due to legal concerns. Music can be re-added back in by dropping a new "starfigher.pak" file in the appdata folder.


Enjoy! :)


EDIT: Version 1.2.P.2 means this game is no longer in beta. The topic on Software News is here: http://boards.openpa...ct-starfighter/
 
Last edited by a moderator:
If it uses g_get_homedir(), just hardcode the paths to the places this is used to /mnt/utmp/yourpndname or use an implementation, that will be redirected by the HOME variable or $HOME directly :)
 
If it uses g_get_homedir(), just hardcode the paths to the places this is used to /mnt/utmp/yourpndname or use an implementation, that will be redirected by the HOME variable or $HOME directly :)

You can also query $PWD without having to use hardcoded paths to the appdata.
 
If it uses g_get_homedir(), just hardcode the paths to the places this is used to /mnt/utmp/yourpndname or use an implementation, that will be redirected by the HOME variable or $HOME directly :)
It doesn't. It "sets up" the home dir with this function:



Code:
#if LINUX

static void setupUserHomeDirectory()

{

    char *userHome;


    char *name = getlogin();


    passwd *pass;


    if (name != NULL)

        pass = getpwnam(name);

    else

        pass = getpwuid(geteuid());


    if (pass == NULL)

    {

        printf("Couldn't determine the user home directory. Exitting.\n");

        exit(1);

    }


    userHome = pass->pw_dir;


    char dir[PATH_MAX];

    strcpy(dir, "");


    sprintf(dir, "%s/.parallelrealities", userHome);

    if ((mkdir(dir, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) != 0) && (errno != EEXIST))

        showErrorAndExit(2, dir);


    sprintf(dir, "%s/.parallelrealities/starfighter", userHome);

    if ((mkdir(dir, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) != 0) && (errno != EEXIST))

        showErrorAndExit(2, dir);


    sprintf(engine.userHomeDirectory, "%s/.parallelrealities/starfighter/", userHome);

}

#endif


As an aside: does using the appdata directory just involve putting stuff in the place Starfighter is mounted?


EDIT: I've edited the source to put the data file into the working directory (I think), but that doesn't seem to be sending it to appdata (oddly, I can't figure out WHERE it's sending it, but it's sending it somewhere, because my savegames aren't going missing).


All I did was comment out the function definition I showed above as well as the call to that function. That causes engine.userHomeDirectory to be an empty string.
 
Last edited by a moderator:
i would change



Code:
userHome = pass->pw_dir;
to

Code:
userHome = getcwd();

http://linux.die.net/man/3/getcwd
Well, I just removed that particular Linux-specific code and it works fine. I was experiencing weirdness because I had two copies of the PND. Now to upload to the Repo...


EDIT: version 1.2.P.1 has been uploaded to the Repo. Changes:


- now saves in the AppData directory


- cursor now appears at the mouse position at the start (bugfix)


- Music from older versions of Starfighter is included.
 
Last edited by a moderator:
Alright, I've found and fixed a segfault which happens when you entered Sol. I think that's all the kinks, so unless someone finds some more, I'll upload the next release (which will free this from beta status) tomorrow. :)
 
onpon4: if we want to add the music ourselves, can we just drop it into the appdata folder?
 
onpon4: if we want to add the music ourselves, can we just drop it into the appdata folder?

You can't just drop the music in the appdata folder, I'm afraid, but you can do something similar. Project: Starfighter works with a proprietary ".pak" file that holds all the data, so you'll need to create a new .pak file, which you can drop in the appdata folder. First you'll need to download the source code here:


http://www.mediafire...6djo1o3obr3yqkc


Then you'll need to modify the makefile to search the /music directory for music. Just add "music/*" (note the asterisk) to DATAFILES (line 11). Then put all the music into the /music directory. To make the .pak, go to the source directory and:



Code:
cd sound

make

cd ..

python pack.py


Then just drop your newly created starfighter.pak (it'll be in the source directory) into Project: Starfighter's appdata folder (currently /appdata/starfighter.onpon4.001, probably won't ever change) and you should be good to go.
 
Last edited by a moderator:
onpon4: if we want to add the music ourselves, can we just drop it into the appdata folder?

You can't just drop the music in the appdata folder, I'm afraid, but you can do something similar. Project: Starfighter works with a proprietary ".pak" file that holds all the data, so you'll need to create a new .pak file, which you can drop in the appdata folder. First you'll need to download the source code here:


http://www.mediafire...6djo1o3obr3yqkc


Then you'll need to modify the makefile to search the /music directory for music. Just add "music/*" (note the asterisk) to DATAFILES (line 11). Then put all the music into the /music directory. To make the .pak, go to the source directory and:



Code:
cd sound

make

cd ..

python pack.py



Then just drop your newly created starfighter.pak (it'll be in the source directory) into Project: Starfighter's appdata folder (currently /appdata/starfighter.onpon4.001, probably won't ever change) and you should be good to go.


onpon4: Thanks for the instructions! This game is awesome with the music! I hope that the authors are able to find/make free replacement music.



If anyone else is trying to do this, I needed to install csound and vorbis-tools. Also, the code block above should be changed to:





Code:
cd sound

make

cd ..

make starfighter.pak
 
I hope that the authors are able to find/make free replacement music.

Yup, they're working on that, and there's already a couple replacement tracks available.

If anyone else is trying to do this, I needed to install csound and vorbis-tools. Also, the code block above should be changed to:



Code:
cd sound

make

cd ..

make starfighter.pak

Ah, thanks for the corrections.
 
Back
Top