shivansps
Posts: 39
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-
-This only works properly on 64 Bit Ubuntu, the 32bit Raspberry OS still have issues with fullscreen, missing S3TC and mouse grab.
-Ubuntu comes with "pulseaudio" this causes problems with audio with every OpenAL app, incluiding this one, pulseaudio must be removed

Code: Select all

sudo apt-get remove pulseaudio
and reboot
-Im experiecing a crash when loading Freespace 2 assets, it looks like FSO cant load some of the .wav files somehow. That is fixed by enabling "disable all sounds" in wxlauncher, but, thats not a real fix. But Wing Commander Saga work with sound.

-UPDATE-
Updated source code in order to successfully build on ARM64, tested on Ubuntu Desktop. Fullscreen is now working fine again, and S3TC support is enabled on driver.

-UPDATE-
Updated build instructions to my git fork to enable mod support on RPI. Wing Commander Saga can now be played, a full freeware game.

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.2.
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-gtk3-dev git python3-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".

on 32 bit Raspberry OS you also need to install "python-markdown".

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
git clone https://github.com/Shivansps/fs2open.github.com
cd fs2open.github.com
./autogen.sh --enable-debug
sed -i -e 's/-mtune=generic -mfpmath=sse -msse -msse2/ /' ./mongoose/Makefile
sed -i -e 's/-mtune=generic -mfpmath=sse -msse -msse2/ /' ./code/Makefile
sed -i -e 's/-mtune=generic -mfpmath=sse -msse -msse2/ /' 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.

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_DEBUG" 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_DEBUG" 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.

-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

Wing Commander Saga gameplay
https://www.youtube.com/watch?v=1Q5ByKGL5to
Last edited by shivansps on Tue Feb 23, 2021 3:42 am, edited 40 times in total.

shivansps
Posts: 39
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


Installing Wing Commander Saga Free standalone game
Image
Wing Commander Saga is free fan-made Wing commander game using the Freespace 2 engine.
It is a long, consisting of 55 misions and is fully voice acted.

1) Download one of these files
https://drive.google.com/file/d/1xZzG44 ... sp=sharing (if you have no S3TC support, no recomended)
https://drive.google.com/file/d/11jH_LL ... sp=sharing (S3TC support enabled, faster and recomended)
2) Uncompress
3) Copy folder inside the "fs2_open" root folder
4) Run wxlauncher
5) Go to "mods"
6) Select & Enable "Wing Commander" from the list
7) Go to "Advanced Settings"
8) Activate "Disable GLSL Shadder support" (optional, but recomended for FPS boost)

Link to main WCS website https://www.wcsaga.com/
https://www.youtube.com/watch?v=1Q5ByKGL5to


Using Media VPs 3.7.2 for Freespace 2
This is the graphical upgrade mod for retail Freespace 2, one of the most basics mods, using this brings a LARGE fps high, around 40%, but is still playable on 720p with 16-bit and bilinear filter.

Get it from here:
https://www.hard-light.net/forums/index ... ic=86475.0

You need:

MV_Root.7z
MV_Music.7z
MV_Assets.7z
MV_Effects.7z
MV_A-Glows.7z
MV_RadarIcons.7z
MV_CB_ANI_1.7z
MV_CB_ANI_2.7z

DO NOT DOWNLOAD MV_Advanced.7z

After download just extract all files, everyone has a "MediaVP_2014" folder inside, just merge them all and copy this folder to your root "fs2_open" folder, after re-starting wxlauncher it should show in the mod tab, enable it to play Freespace 2 with upgraded graphics.

Image
Image
Last edited by shivansps on Tue Feb 23, 2021 3:42 am, edited 12 times in total.

kwadroke
Posts: 35
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: 39
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: 406
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: 39
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: 406
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: 39
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: 8004
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: 39
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: 8004
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: 39
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: 39
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: 39
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: 406
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: 39
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: 39
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”