Moonmarch
Posts: 95
Joined: Thu Mar 07, 2019 1:34 am

OpenDUNE, Dune 2 Linux source port

Mon May 27, 2019 11:33 pm

You will need a copy of Dune 2 to use the program, OpenDUNE is very similar to Dune 2 for MS DOS, here is the OpenDUNE GitHub website:

https://github.com/OpenDUNE/OpenDUNE

The only listed dependencies needed for OpenDUNE are sound driver (ALSA, Pulseaudio, OSS) and SDL2, search for these files in the Debian repository, to use the "git clone" command in the terminal, you need to install git:

Code: Select all

sudo apt-get install git
Here are the instructions to compile OpenDUNE, open the terminal:

Code: Select all

git clone https://github.com/OpenDUNE/OpenDUNE.git

Code: Select all

cd OpenDUNE
Search for a file called config.lib inside the /OpenDUNE directory, we need to edit the file to remove the "ansi" and "pendantic" segment included in the file, if we did not edit the file the program will not compile successfully, to edit the file use either the "nano" command or any text editor, to open the file with the nano command, write in the terminal:

Code: Select all

nano config.lib
After opening the config.lib file with the nano command, use the keyboard command Ctrl + w to search for text, we need to find "ansi" and "pendantic," we need to erase lines 742 to 745 if you are using Geany, if you are not using Geany, then here is the segment of the file that needs to be deleted:

fi


if [ "$os" != "TOS" ] && [ "$os" != "DOS" ] && [ $cc_version -lt 70 ] ; then
flags="$flags -ansi -pedantic"

After deleting the segment, save the file then exit, if you have SDL2 installed on the RPI, you should have a file called sdl2-config located in the /usr/bin directory, we will need to include the sdl2-config location after running the "./configure" command, to run the ./configure command, write in the terminal:

Code: Select all

./configure --with-sdl2=/usr/bin/sdl2-config
To see a full list of ./configure commands, run:

Code: Select all

./configure --help
After using the ./configure command, scroll through all of the terminal text to verify if the ./configure command recognized the audio driver and the SDL2 version, after verifying run the "make" command, write in the terminal:

Code: Select all

make
or

Code: Select all

make -j2
Compiling should take 1 - 2 minutes, this program is very lightweight, after compiling the source code, you will need to copy your Dune 2 .pak files to the /OpenDUNE/bin/data directory, before running the "opendune" program, you need to edit the opendune.ini.sample file located in the /OpenDUNE/bin directory, you can edit the file using the nano command or text editor, to edit with the nano command, write in the terminal:

Code: Select all

cd bin

Code: Select all

nano opendune.ini.sample
After opening the opendune.ini.sample file, edit the file using the README.txt file located in the /OpenDUNE directory as a reference, the README.txt file lists all of the configuration commands used in the opendune.ini file, after editing the opendune.ini.sample file, save the file as opendune.ini before exiting the text editor.

You can run the opendune program using the command:

Code: Select all

cd OpenDUNE/bin

Code: Select all

./opendune
There are no configuration options inside the game, to change the game configuration options you need to edit the opendune.ini file, you can't adjust the screen resolution or the window size as far as I know, you can run this game with the Opengl Full KMS drivers enabled.

Update May 29 2019:
-Removed the sudo command from code and from explanations, was used in excess
-Added miscellaneous improvements
Last edited by Moonmarch on Wed May 29, 2019 10:25 pm, edited 2 times in total.

User avatar
Paeryn
Posts: 2604
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: OpenDUNE, Dune 2 Linux source port

Tue May 28, 2019 12:35 am

Is there any sane reason why you are saying to do the entire process as root? Apart from the very first apt-get instruction (which does require being root) I can't think of a single reason why the rest shouldn't be done as a regular user.

Blindly running commands with sudo when they don't need it is asking for trouble.
She who travels light — forgot something.

Moonmarch
Posts: 95
Joined: Thu Mar 07, 2019 1:34 am

Re: OpenDUNE, Dune 2 Linux source port

Tue May 28, 2019 12:51 am

Any file you download or create using the sudo command in the terminal will create files that can only be written or edited by the root user, to avoid using sudo, you can use the command:

Code: Select all

sudo chmod -R 777 /"folder directory"
R stand for recursive, which changes user permission for the entire directory, programs can install files into the root folder, if the program is reading a file that is located in the /root directory, you need to run the program as root user, or the program will not launch.

PhatFil
Posts: 1305
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: OpenDUNE, Dune 2 Linux source port

Tue May 28, 2019 1:11 am

Thanks.. going to the top of my play list....

User avatar
rpdom
Posts: 14708
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: OpenDUNE, Dune 2 Linux source port

Tue May 28, 2019 5:30 am

Moonmarch wrote:
Tue May 28, 2019 12:51 am
Any file you download or create using the sudo command in the terminal will create files that can only be written or edited by the root user
Which is why you shouldn't use sudo for any of those commands other than the apt ones.

Moonmarch
Posts: 95
Joined: Thu Mar 07, 2019 1:34 am

Re: OpenDUNE, Dune 2 Linux source port

Tue May 28, 2019 9:57 pm

Based on what rpdom said, not using sudo all the time should be a better approach to using Debian, because you don't need root access to run Minecraft Pi edition, no instead you click on the icon in the games menu, then the program will load.

I assumed sudo was part of Debian, which is the reason why I used sudo all the time, because the instructions on how to compile source code from any website does not mention using the sudo command for any reason, I assumed Ubuntu, Arch linux, or some other Linux OS did not use the sudo command, I assumed if you compiled source code without the sudo command, the source code would not compile, more specifically, running the "make" command.

I know for certain you cannot access the /root directory without root access, there are hidden files located in the /root directory that are important, I don't know if there is a difference between the /root/.config directory and the /home/pi/.config directory, I have to admit I don't know everything about Debian anyone can correct me, Linux is completely different from Windows.

User avatar
Paeryn
Posts: 2604
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: OpenDUNE, Dune 2 Linux source port

Tue May 28, 2019 10:44 pm

Moonmarch wrote:
Tue May 28, 2019 9:57 pm
Based on what rpdom said, not using sudo all the time should be a better approach to using Debian, because you don't need root access to run Minecraft Pi edition, no instead you click on the icon in the games menu, then the program will load.

I assumed sudo was part of Debian, which is the reason why I used sudo all the time, because the instructions on how to compile source code from any website does not mention using the sudo command for any reason, I assumed Ubuntu, Arch linux, or some other Linux OS did not use the sudo command, I assumed if you compiled source code without the sudo command, the source code would not compile, more specifically, running the "make" command.

I know for certain you cannot access the /root directory without root access, there are hidden files located in the /root directory that are important, I don't know if there is a difference between the /root/.config directory and the /home/pi/.config directory, I have to admit I don't know everything about Debian anyone can correct me, Linux is completely different from Windows.
sudo, like a lot of Linux commands, came from Unix, it stands for Super User DO, its job is to do the command that you pass it as the super user root (originally sudo could only run commands as root, nowadays sudo can run as any user asked for if you have permission).

Other sites don't tell you to compile source code with sudo because there shouldn't be any reason to do so, all editing and compiling of source code should be done as a regular user (pi by default in Raspbian) and in that user's directory tree. Only when you want to install the resultant code & data into the system-wide directories (e.g. /usr/bin, /usr/local, /usr/share etc.) do you need to use sudo to copy the files into those directories.

Only root can access /root because that is root's home directory, just like /home/pi is pi's home directory, root's home isn't /home/root for very good reasons.

You shouldn't run anything with sudo unless you know you have to, root can do practically anything it wants without asking, one careless command when run as root can wipe the entire file system. If you hadn't cloned the git repository as root then none of the other commands after would have needed it, by cloning as root all the files and directories created by it were owned by root
She who travels light — forgot something.

Moonmarch
Posts: 95
Joined: Thu Mar 07, 2019 1:34 am

Re: OpenDUNE, Dune 2 Linux source port

Wed May 29, 2019 10:35 pm

Thanks for the advice, I removed all of the sudo commands from the post, and the program compiles the same as before without the need for sudo or chmod.

User avatar
Paeryn
Posts: 2604
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: OpenDUNE, Dune 2 Linux source port

Thu May 30, 2019 12:58 am

Glad it works fine, at least you learnt a bit more about sudo without getting burnt.

I can see why Raspbian probably chose to set sudo up to not require your password, but I would have left it to require it (or only allowed running certain programs like apt without it). If nothing else it would make beginners think more before using sudo if they also have to enter their password every time.
She who travels light — forgot something.

Return to “Gaming”