shivansps
Posts: 35
Joined: Thu Jan 26, 2012 5:11 pm

How to run Freespace 2 Open on Raspberry PI 3

Thu Jan 03, 2019 1:43 am

-UPDATE-
Buster has some issues with the game, making it to loss focus and to pause if ran in a window on RPI3/4. Stretch on RPI3 works fine.
In order to run in Buster you need to run the game in a window, no fullscreen is possible for now.

Image
This is the classic Freespace 2 game from 1999, getting it to work is petty much stright forward, i had to compile a launcher and a fs2open binary.
I had to use a rather old version of the source code since the up to date version needs OpenGL 3.1 minimum. So i tested it working with 3.6.18, 3.7.0 and 3.7.2 versions, anything newer than that needs OpenGL 3.1.
So lets start with this guide.

Part 1 : Compiling & installing Wxlauncher
Open a terminal and run these commands

Code: Select all

sudo apt-get install build-essential libopenal-dev libwxgtk3.0-dev git python-markdown cmake libsdl2-dev
git clone https://github.com/scp-fs2open/wxLauncher
cd wx*
cmake ./
sudo make install
wxLauncher should now be installed and avalible at "Accessories" after reboot. Also by default is installed to "/usr/local/bin", you can launch it from any terminal typing "wxlauncher".


Part 2 : Compiling Fs2 Open bin
Now that you have the launcher up and running you need to compile FS2_Open.
Open a terminal and run these commands

Code: Select all

sudo apt-get install libopenal-dev libjansson-dev libjpeg-dev liblua5.1-dev libogg-dev libpng-dev libsdl-dev libtheora-dev libvorbis-dev automake libswscale-dev libavcodec-dev libavformat-dev
wget http://scp.indiegames.us/builds/fs2_open_3_7_2_src.tgz
tar zxvf fs2_open_3_7_2_src.tgz
cd fs2_open_3_7_2
./autogen.sh
sed -i -e 's/-mtune=generic -mfpmath=sse -msse -msse2/-mtune=cortex-a53/' ./mongoose/Makefile
sed -i -e 's/-mtune=generic -mfpmath=sse -msse -msse2/-mtune=cortex-a53/' ./code/Makefile
sed -i -e 's/-mtune=generic -mfpmath=sse -msse -msse2/-mtune=cortex-a53/' Makefile
make -j4
Note: It should not be needed to do anything manually, but In case you get errors about -mtune=generic or -msee there are 3 files that need to be edited: fs2_open_3_7_2/Makefile, fs2_open_3_7_2/code/Makefile, and fs2_open_3_7_2/mongoose/Makefile
What you need to change is the same on every file, use a text editor and the search, seach for "-mtune" when you find -mtune, delete from that line "-mtune=generic -mfpmath=sse -msee -msse2". Those are x86 specific compiler flags that dont work on arm. These appear 2 times on each of the 3 files.

UPDATE: If you have a raspberry pi 4 you should use these sed lines instad, so it compiles for a72. This is not needed.

Code: Select all

sed -i -e 's/-mtune=generic -mfpmath=sse -msse -msse2/-mtune=cortex-a72/' ./mongoose/Makefile
sed -i -e 's/-mtune=generic -mfpmath=sse -msse -msse2/-mtune=cortex-a72/' ./code/Makefile
sed -i -e 's/-mtune=generic -mfpmath=sse -msse -msse2/-mtune=cortex-a72/' Makefile


It will take a while (about 30 minutes) to compile on the RPI.

Part 3 : Making the fs2 root folder & configuring wxlauncher
1) Create a folder called "fs2_open" on the user folder (/home/pi/).
2) Copy the "fs2_open_3_7_2" executable file from the "fs2_open_3_7_2/code" folder on the source code you just compiled on this root folder.
3) You are ready to drop mods folder or the retail files in here. The retail files you are gona need are:

Code: Select all

root_fs2.vp
smarty_fs2.vp
sparky_fs2.vp
sparky_hi_fs2.vp
stu_fs2.vp
tango1_fs2.vp
tango2_fs2.vp
tango3_fs2.vp
warble_fs2.vp
If you dont have the freespace 2 retail file you can try the demo (instruccions on the 1st reply)

4) launch wxlauncher from accessories menu.
5) Basic Settings-> Browse for Game Root folder -> select the "fs2_open" folder you just created.
6) Select "fs2_open_3_7_2" as"fs2 open executable".
7) Video Resolution: 1280x720 MAX, Depth: 16 or 32 bits, Texture Filter: Bilineal, Anisotropic: off, anti-aliasing:off
8) Playback device: Select vc4_hdmi if you are running off HDMI audio, dont enable EFX.
9) Go back to Welcome and save the profile.

-ONLY FOR RASPBIAN/DEBIAN BUSTER"
10) Go to "Advance Settings"
11) Scroll down to "Dev Tool"
12) Select and Enable "Run in a Window" and "Dont grab mouse/keyboard in a Window"
13) (optional) use "-res 1920x1010" in "Custom flags" to adjust the window size to screen size, this will fit a 1920x1080 screen, to me performance was not good enoght but you can use this to change window resolution.
14) Go back to Welcome and save the profile.

-Note: Changing window resolution dosent work with the Freespace 2 demo files, it will always run in 800x600 in a window no matter what you set, this however works for the retail game files.

Here is a video guide and gameplay.
https://www.youtube.com/watch?v=TA6ew4aXpl4

Notes: As i was unable to get S3TC texture compression working on the RPI, getting mods to work is a problem, FS2 Retail game files and the fs2demo works. That for sure.
Last edited by shivansps on Mon Nov 18, 2019 12:01 am, edited 22 times in total.

shivansps
Posts: 35
Joined: Thu Jan 26, 2012 5:11 pm

Re: Freespace 2 Open on Raspberry PI 3

Thu Jan 03, 2019 2:49 am

Installing Freespace 2 Demo "mod" to fs2_open
1) Download https://drive.google.com/open?id=1jF0YL ... _7QTjMROOq
2) Uncompress
3) Copy folder inside the "fs2_open" root folder
4) Run wxlauncher
5) Go to "mods"
6) Select & Enable "Freespace 2 Demo" from the list
7) Go to "Advanced Settings"
8) Scroll down to "Gameplay", select and enable "Strech interface to fill screen" (whiout this it will always run at 800x600)
7) Play!

Image
Image
Image
Last edited by shivansps on Sun Nov 17, 2019 10:48 pm, edited 2 times in total.

kwadroke
Posts: 31
Joined: Tue Jan 29, 2013 4:20 am

Re: How to run Freespace 2 Open on Raspberry PI 3

Mon Jan 14, 2019 3:54 am

Very Nice!

You might want to change the

Code: Select all

make
command to

Code: Select all

make -j4
and the code will compile a whole lot faster.

shivansps
Posts: 35
Joined: Thu Jan 26, 2012 5:11 pm

Re: How to run Freespace 2 Open on Raspberry PI 3

Fri Aug 02, 2019 12:23 am

has anyone tried on the RPI4?

laurent
Posts: 314
Joined: Thu Jul 26, 2012 11:24 am

Re: How to run Freespace 2 Open on Raspberry PI 3

Thu Aug 08, 2019 12:22 pm

Tested first on Pi 3 (last July Raspbian Buster version) before testing on Pi 4.
Every steps ran fine until I had launched the game itself. The game starts successfully but randomly returns to the desktop within few seconds.
I tested full and fake KMS OpenGL driver with 256 Mb for video memory.
May be something broke on Buster for this tutorial.

I own the original CD's and managed to extract the corresponding game's files. I was so excited on the idea of playing this game again :cry:
I'll soon try a newer version of fs2 open on the Pi 4.

EDIT : Tested back on the last Stretch image (2019-04-08) with a 3B+ and it works very well. I can confirm something is broken with Buster. I hope to test on Pi 4 next week (with a newer version of fs2 open, though).

shivansps
Posts: 35
Joined: Thu Jan 26, 2012 5:11 pm

Re: How to run Freespace 2 Open on Raspberry PI 3

Thu Aug 29, 2019 1:42 am

The problem of running newer versions of fs2open is the minimum OPENGL version they need... thats something that may be fixed with newer Stretch versions or in the RPI4.

This was also the reason of why i was unable to run mods, because i needed S3TC support, and i never made it to work.

laurent
Posts: 314
Joined: Thu Jul 26, 2012 11:24 am

Re: How to run Freespace 2 Open on Raspberry PI 3

Fri Aug 30, 2019 9:20 pm

shivansps wrote:
Thu Aug 29, 2019 1:42 am
The problem of running newer versions of fs2open is the minimum OPENGL version they need... thats something that may be fixed with newer Stretch versions or in the RPI4.

This was also the reason of why i was unable to run mods, because i needed S3TC support, and i never made it to work.
Fortunately, I own a Pi4B2 to play with. But for now, I'm in vacations.

Anyway, your great tutorial may be updated for Buster compatibility.

superjugy
Posts: 3
Joined: Sun Sep 15, 2019 3:16 am

Re: How to run Freespace 2 Open on Raspberry PI 3

Mon Sep 16, 2019 1:56 pm

Hi. Did you guys ever figured out the S3TC issues? it is my understanding that Mesa 19 which comes with Buster in RPI4 should be able to handle S3TC. Is the issue because of VideCore VI and not related to Mesa? I'm having a similar issue when trying to run a project done with jmonkeyengine 3 using that texture compression.

shivansps
Posts: 35
Joined: Thu Jan 26, 2012 5:11 pm

Re: How to run Freespace 2 Open on Raspberry PI 3

Thu Sep 26, 2019 12:04 am

No, i never managed to workaround it... newer Mesa and Drivers are the only way to go.

BTW, gog is giving away Freespace 2 for free for 48hs, this is a good chance to pick it up in case someone that dosent have and want to play on RPI

https://www.gog.com/game/freespace_2

The retail campaign should be fully playable.

User avatar
Gavinmc42
Posts: 4034
Joined: Wed Aug 28, 2013 3:31 am

Re: How to run Freespace 2 Open on Raspberry PI 3

Thu Sep 26, 2019 1:53 am

I thought S3TC was designed for GPU hardware decompression.
As far as I know S3TC was not in the Videocore IV and probably not the VI.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

shivansps
Posts: 35
Joined: Thu Jan 26, 2012 5:11 pm

Re: How to run Freespace 2 Open on Raspberry PI 3

Thu Sep 26, 2019 11:55 pm

Gavinmc42 wrote:
Thu Sep 26, 2019 1:53 am
I thought S3TC was designed for GPU hardware decompression.
As far as I know S3TC was not in the Videocore IV and probably not the VI.
Worse-case scenario it can be done on software.

I could also extract the texture from the mod files and uncompress it, but i never managed to get it to work properly.

User avatar
Gavinmc42
Posts: 4034
Joined: Wed Aug 28, 2013 3:31 am

Re: How to run Freespace 2 Open on Raspberry PI 3

Fri Sep 27, 2019 1:11 am

I'm sure VC4 had ETC1 compression.
ETC2 compression is mandatory for OpenGLES3.0 so it will be in the VC6.
Can S3TC be converted to ETC?

Is the Pi4/VC6 fast emough not to need compression?
Do a glxinfo and check the extensions?

The new Raspbian mesa just got releases yesterday, that might help, it has some 3.1 stuff in it.
Gentoo64 already has it and I don't notice many issues.

Time to try the later versions of Freespace2?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

dank10110
Posts: 2
Joined: Sun Sep 29, 2019 12:08 am

Re: How to run Freespace 2 Open on Raspberry PI 3

Sun Sep 29, 2019 2:02 am

laurent wrote:
Thu Aug 08, 2019 12:22 pm
Tested first on Pi 3 (last July Raspbian Buster version) before testing on Pi 4.
Every steps ran fine until I had launched the game itself. The game starts successfully but randomly returns to the desktop within few seconds.
I tested full and fake KMS OpenGL driver with 256 Mb for video memory.
May be something broke on Buster for this tutorial.

I own the original CD's and managed to extract the corresponding game's files. I was so excited on the idea of playing this game again :cry:
I'll soon try a newer version of fs2 open on the Pi 4.

EDIT : Tested back on the last Stretch image (2019-04-08) with a 3B+ and it works very well. I can confirm something is broken with Buster. I hope to test on Pi 4 next week (with a newer version of fs2 open, though).
I can confirm weirdness with Pi4B running Buster. When running fullscreen, the game minimizes randomly after a few seconds to a few minutes. It can't be restored once this occurs. Running in windowed mode works, but the window will randomly lose focus. When restoring focus, mouse controls are hopelessly messed up after. I'm not sure what drives the loss of focus.
It's a shame, since the performance was very good. I saw 60fps most of the time, with cloudy environments at 40fps.

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: How to run Freespace 2 Open on Raspberry PI 3

Sun Sep 29, 2019 6:15 am

I can successfully get it started on an RPI 4, even all the way up to 1080p. The problem is that focus is lost and it randomly goes back to desktop though the game is still running. I can go back to the game, but it simply loses focus again in a few seconds. You can keep returning to the game, but it is unplayable since focus cannot be kept.

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: How to run Freespace 2 Open on Raspberry PI 3

Sun Sep 29, 2019 6:23 am

One tip is to use the innoextract tool if you have the the setup file and no windows computer to run it on. Exagear is also an option if you desire to run the setup file directly on the RPI. Exagear is a paid software package however whereas, innoextract is free. If you should desire to try innoextract, install it as follows:

Code: Select all

sudo apt install innoextract
Usage is simply going to directory of install file and entering:

Code: Select all

innoextract installfilename.exe
Maybe if more throw their hats in the ring, we can find a way to solve the loss of application focus issue preventing this from running correctly in buster on RPI 4.

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: How to run Freespace 2 Open on Raspberry PI 3

Sun Sep 29, 2019 7:50 am

I can tell you that setting SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0 does not work with loss of focus on the game. There is something up with Buster and not being able to maintain focus. Not sure what it is as of yet. Even setting this globally does not help.

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: How to run Freespace 2 Open on Raspberry PI 3

Sun Sep 29, 2019 8:23 am

There is a way to pull off running this game, open via terminal this way:

Code: Select all

./fs2_open_3.7.2 -window
No more focus loss at that point. Enjoy

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: How to run Freespace 2 Open on Raspberry PI 3

Sun Sep 29, 2019 8:53 am

It still has a few issues once in game. It shows "Paused" once you get in game and if you disable "Pause", it goes right back to showing "Paused". I can go through the menus and select ship, weapons and etc, but once it play, it is "Paused". For some reason, it seems mouse controls disappear once actually in game.

shivansps
Posts: 35
Joined: Thu Jan 26, 2012 5:11 pm

Re: How to run Freespace 2 Open on Raspberry PI 3

Wed Oct 09, 2019 11:54 pm

What is the reported OpenGL version of RPI4 running glxinfo? because if is 3.0 or higher it can run newer versions.

dank10110
Posts: 2
Joined: Sun Sep 29, 2019 12:08 am

Re: How to run Freespace 2 Open on Raspberry PI 3

Fri Oct 11, 2019 3:28 pm

shivansps wrote:
Wed Oct 09, 2019 11:54 pm
What is the reported OpenGL version of RPI4 running glxinfo? because if is 3.0 or higher it can run newer versions.
OpenGL version 2.1 Mesa 19.2.0-rc1

shivansps
Posts: 35
Joined: Thu Jan 26, 2012 5:11 pm

Re: How to run Freespace 2 Open on Raspberry PI 3

Sat Oct 19, 2019 1:09 pm

Still no enoght to run newer versions :/

shivansps
Posts: 35
Joined: Thu Jan 26, 2012 5:11 pm

Re: How to run Freespace 2 Open on Raspberry PI 3

Wed Nov 13, 2019 1:20 am

Ok after re testing with RPI 4... its the same so far.

3.7.2 - Works but it now has this weird issue with the game minimizing or pausing if ran in a window.

3.7.4 - Works but not hardware accelerated, seems to be running on software. It also has the same issues as 3.7.2

3.8.0 and Newer - Fails to launch, says it needs OpenGL 3.2.


What i need to test if this debian buster thing with 3.7.2 also happens on x86 or it is limited to RPI.

laurent
Posts: 314
Joined: Thu Jul 26, 2012 11:24 am

Re: How to run Freespace 2 Open on Raspberry PI 3

Thu Nov 14, 2019 2:21 pm

Many thanks for your tests with the Pi 4, under Raspbian Buster.

Unfortunately, the Pi 4 is unlikely to support more than OpenGL 2.1 :cry:
At least, according to, what Igalia said:
At present, the V3D driver exposes OpenGL ES 3.0 and OpenGL 2.1. As I mentioned above, the VideoCore VI GPU can do OpenGL ES 3.2, but it can’t do OpenGL 3.0, so future feature work will focus on OpenGL ES.
(Quoted from https://www.raspberrypi.org/blog/vc4-an ... an-update/ )

shivansps
Posts: 35
Joined: Thu Jan 26, 2012 5:11 pm

Re: How to run Freespace 2 Open on Raspberry PI 3

Sat Nov 16, 2019 3:02 am

Im more interested in getting S3TC working, as that opens up the possibility of running free standalone mods, and figureout whats wrong with debian buster.

Raspberry PI 3 users can still run the game on Stretch whiout issues.

BTW, i expect FS2 Open to move to Vulkan in the future, if RPI4 gets Vulkan in the future, as it is mentioned in the comments on that link, something newer than 3.7.2 will run, some day.
Last edited by shivansps on Wed Nov 20, 2019 2:06 am, edited 2 times in total.

shivansps
Posts: 35
Joined: Thu Jan 26, 2012 5:11 pm

Re: How to run Freespace 2 Open on Raspberry PI 3

Sat Nov 16, 2019 5:04 pm

Ok, you cant run in fullscreen in Buster, the focus loss is constant. BUT you can run in a window whiout having constant "pauses".

This is done by selecting "dont grab mouse/keyboard in a window" under "Dev Tool" in wxlauncher. The keyboard and mouse grab seems to be responsible for the focus loss and this happens in a window as well. This will add the "-nograb" command line argument. This fixes the pauses.

In order to adjust the window size to screen size you can also use the "-res <resolution>" command argument. For example adding "-res 1920x1010" as a custom argument in wxlauncher creates a windows that fits in the entire screen.

Performance to me is bad, this is worse than the RPI 3 could do in fullscreen. But its something.

Changing window resolution dosent work with the demo, it only works with the retail game files.

EDIT: if you enable "Strech interface to fill screen" on Advance settings under "Gameplay" the Demo will in fact run in the desired resolution instead of always at 800x600.

Return to “Gaming”