PDA

View Full Version : Linux development


l33t_linux_h4x0r
11-29-2007, 10:51 PM
I know that it has been asked to make the game opensource and the answer is NO. However I would like to help develope the Linux client if possible. I will sign a NDA or whatever needs to be done. Currently I have edited some of the files that come in the linux installer so that the game data stays in /usr/local/games/Regnum Online/ This makes it so that multiple users on one computer can play Regnum Online without having to redownload the files to their home folder. And edited the shortcut files too. The game runs perfectly. The only thing that i would change as of right now is that the game.conf file be stored in the $home/.ngdstudios allong with the username file. This way the different users could have different graphics preferences too. Also I don't know how many of you would want this but I was planning on making gentoo ebuilds and rpms/debs for other distros. The download would be much smaller as all that would be needed is the launcher, shortcuts, and some small scripts.

Surak, NGD Please respond.
Thanks in advance

P.S. Would anyone be interested in native GTK and QT versions of the game? Of course I would need access to the launcher source and permission but I think that it would be cool.

surak
11-30-2007, 12:20 AM
The whole purpose of the installer if to have all the game resources before entering the game for the first time :) So our resource server don't get too overloaded.
Also, if the data*.sdb files are located in a read-only directory (like /usr) users won't be able to get the updated resources.

So, there are still some issue to work out :)

l33t_linux_h4x0r
11-30-2007, 01:46 AM
If you chmod 777 /usr/share/games/Regnum\ Online -R then all of the Regnum Online folder and all of its subfolders will be accessable by everyone. This is where the loki installer puts the files by default and does not do this or run the game from this location so users download all of the files anyway. I don't know how to make a loki installer but I could make a package probably a tar.gz and an install script that will extract everything to the correct directories, set permissions, and create shortcuts. BTW this file would include the entire game. Not just the ~350 megs included with your installer. I would use the ~740 megs that is downloaded when you click download all resources at once.

I may look into making a loki installer but I already know how to write scripts so that would be easy for me. Also it would be documented very well (just an sh script) so that other users could edit install paths etc.

l33t_linux_h4x0r
11-30-2007, 06:36 AM
Just a status update I am almost done with the install part of the script. All that remains is creating the shortcuts. I will upload a torrent or an ftp link (if I can get hosting) maybe sf.net or something.

Keep checking back for updates

Angelwinged_Devil
11-30-2007, 01:32 PM
The whole purpose of the installer if to have all the game resources before entering the game for the first time :) So our resource server don't get too overloaded.
Also, if the data*.sdb files are located in a read-only directory (like /usr) users won't be able to get the updated resources.

So, there are still some issue to work out :)
I think there's something called bitrock which can make you an installer for linux and save you each linux user downloading resources all the time.

I have the name somewhere on my linux hd, I'll check later

Znurre
11-30-2007, 02:13 PM
Yes it's called Bitrock, and it's great cause it use the Qt toolkit :)

NightTwix
11-30-2007, 09:25 PM
Bitrock costs money

I hinted Surak another installer which is free (as in freedom).
but he apparently decided against it :'(

cant find the link to it any more

surak
11-30-2007, 09:33 PM
Maybe I missed that
What was it's name?

theotherhiveking
11-30-2007, 09:41 PM
Maybe I missed that
What was it's name?


http://www.linux.com/feature/60380 this one?

**http://www.installjammer.com/

its open source and looks good, but i havent tryed it.

surak
11-30-2007, 09:55 PM
I'll check it out later, thanks :)

Znurre
11-30-2007, 10:13 PM
No, this is the one:

http://bitrock.com/

Works on both Linux, MacOS and Windows.

theotherhiveking
11-30-2007, 10:18 PM
No, this is the one:

http://bitrock.com/

Works on both Linux, MacOS and Windows.


http://bitrock.com/buy_overview.html *ejem*

l33t_linux_h4x0r
12-01-2007, 03:12 AM
Well I got an interactive bash script working and the full install with all of the files for the game not just the minimal ones that come in the installer from NGD is about the same size. This is because my installer is pretty much just an archive extracter. It currently uses tar.gz because I don't know if tar.bz2 is standard yet but that could make it even smaller. Just working on finishing the shortcut creation.

I will try and see if I can get the installjammer install program working but for now at least we have a bash script.

NightTwix
12-01-2007, 11:24 AM
Maybe I missed that
What was it's name?

im really sorry, i cant remember.
I sent you a PM but it was some weeks ago and i deleted it already
If i stumble across it again i gonna tell you.

It was a distro independent system with a clean install and uninstall and straight forward from the user perspective.
I think it was more a packaging system but leaned towards games

l33t_linux_h4x0r
12-01-2007, 03:56 PM
I was going to use installjammer but I don't think that it allows me to run post install scripts. I am thinking about writing my own gui. I like gtk and use gnome so that is what I was planning on using but I am sure that some of you use kde/qt. Does anyone know of a gui that works in both kde and gnome (other than java) I would like to use something like that rather than writing two programs one for kde and one for gnome and useing an if then to figure out the desktop enviroment.

theotherhiveking
12-01-2007, 05:00 PM
im really sorry, i cant remember.
I sent you a PM but it was some weeks ago and i deleted it already
If i stumble across it again i gonna tell you.

It was a distro independent system with a clean install and uninstall and straight forward from the user perspective.
I think it was more a packaging system but leaned towards games
autopackage?

i used it sometimes (i have only seen it used in games) and it's pretty easy.

theotherhiveking
12-01-2007, 05:04 PM
I was going to use installjammer but I don't think that it allows me to run post install scripts. I am thinking about writing my own gui. I like gtk and use gnome so that is what I was planning on using but I am sure that some of you use kde/qt. Does anyone know of a gui that works in both kde and gnome (other than java) I would like to use something like that rather than writing two programs one for kde and one for gnome and useing an if then to figure out the desktop enviroment.






No External Dependencies : InstallJammer installs are self-contained native executables that don't require any dependencies on the user's target system and install with a very minimal overhead. Unlike most multiplatform installers, InstallJammer does not require bundling a Java Runtime Environment just to install your product.
Built-in Actions : InstallJammer includes a convenient set of built-in actions for common functionality you might need, such as: Java(tm) runtime detection, executing external programs and scripts, changing the Windows registry and many more.
.
Multiple User Interface Options : InstallJammer can run in a Standard, Default, Console or Silent install mode depending on what the user chooses. Default will accept all of your build settings at default while still providing a GUI installation, and Silent will install without a GUI and without the need for interaction from the user. Console allows your user to install on a UNIX system from a console window without a GUI.

Command Line Control : InstallJammer projects can be built and tested from the command-line, providing easy integration with current build environments and scheduled build configurations.

Uninstall Capabilities : InstallJammer will automatically create an uninstaller during installation if you choose.
Language and Platform Independent : InstallJammer installers can install applications written in any language, including: C/C++, Java, .Net/Mono, Perl, PHP, Python, Tcl/Tk, and Ruby.




I like food, do you like food?

(10 characters needed)

EDIT:Afaik you can customice it, it should be possible to make it run the scripts after all files are extracted.

l33t_linux_h4x0r
12-02-2007, 09:13 PM
I have finally finished the Bash Installer!!!
It has all of the options of the loki installer. Also it is designed to install the entire game (donwload all resources at once). The archive that is needed for this to work is only about 350MB but I dont have anywhere to host it. Also I am trying to impliment a Desktop shortcut creator. After I get the Bash script working with all of the options that I want, I might start work on writing a gui for it.

Edit: Well after more testing I just realized that my script doesn't check to see if there are any errors. I am currently working on fixing this. Also once everything is working correctly I may port this to a different programing language. This not only will enable me to make a gui quicker but also so that I can compile it as I do not want to release my code. I don't know what license it will be but here is the just of it. It would be like me letting me borrow my car (in this case the car is my code). You can drive it (run it)for free, but you can't take it appart, modify, or redistribute it without permission, or take credit for it. However if it malfunctions (crashes, breaks, falls apart, blows up) then I take no responsibility.

Edit #2: I just had an idea. Would you like the installer to be a script approximately 6kb that would download the archive and install it or do you want it to come with the archive. The reason that I ask is that I could make multiple packages. .tar.b2z .tar.gz .lmza and the list goes on and on. Then I could make the script test to see if you have these installed starting with the compression type that is the smallest and work its way up. This way you wouldn't have to download the "standard" install package that is 363MB you could download one much smaller. Anyways it is just an idea and could always be implemented at a later date. I currently have everything working except the desktop shortcut.

Please post comments as to what you want me to do and it will probably be done.

Miraculix
12-03-2007, 04:27 PM
jesus, it's just a bash script, it's not even a real program, give the code under GPL already :P

Also, make sure there's a 64-bit version of the installer too, that would be very nice :P

as far as hosting goes, maybe you could make a torrent file?

toxigenicpoem
12-03-2007, 05:00 PM
jesus, it's just a bash script, it's not even a real program, give the code under GPL already :P

Also, make sure there's a 64-bit version of the installer too, that would be very nice :P

as far as hosting goes, maybe you could make a torrent file?

Ahmen. :) I'd host it, but it would have to be GPL'd before I touch it.

MAXDDARK
12-03-2007, 05:59 PM
The only bad thing about the NGD installer is that after I install the game and make a shortcut it will download all files again for some odd for me reason.
I have only one user (apart from the system ones) so I can't comment on multi user issues.

and l33t_linux_h4x0r , in your first post you were sorry that NGD won't release their source code and now you are saying that you won't do it either - I mean you can't (won't) sell it, so why not get it to the public who might help you and improve your source code and keeping your name as the developer - it's GPL ;)

elendriel
12-03-2007, 06:24 PM
The only bad thing about the NGD installer is that after I install the game and make a shortcut it will download all files again for some odd for me reason.
I have only one user (apart from the system ones) so I can't comment on multi user issues.

and l33t_linux_h4x0r , in your first post you were sorry that NGD won't release their source code and now you are saying that you won't do it either - I mean you can't (won't) sell it, so why not get it to the public who might help you and improve your source code and keeping your name as the developer - it's GPL ;)
I'm of you, but just a thing, the programmers of the game should consider to license the game with GPL.

Because the game will improve, and the costs will be seen reduced, and they can follow make business on the game.

And about l33t_linux_h4x0r you ask indirectly that others free their code, but you don't agree to free your own code, contradictory.

If you really want to colaborate with the community and with the game you should free your installer as GPL, and if you're afraid that NGD you're code, if they do, they'll be violating your license, then as you should know, there wouldn't be any danger to "steal" your code.

darkcyde
12-03-2007, 06:29 PM
Well after reading this topic, i drafted about 3 responses...all of which I deleted because I think maybe they would be viewed as "harsh". So i'm just going to say that this installer will never see the light of day on my computer unless it's under GPL. I'm only slightly less fanatical than RMS, so I appologize in advance if I eat anyone's face due to linux related issues. And I respect your decision to not release under the GPL, even if I think it's wrong :P

NightTwix
12-03-2007, 08:10 PM
It should be GPL or BSD, im with you.
If it has to be a more restictive licence a CC one could work (http://creativecommons.org/licenses/)

MAXDDARK
12-03-2007, 09:41 PM
No, Just NOT BSD - this is a really bad license for someone who wants to be recognized for his work, as they can take it , change it and sell it and you won't see a penny.

Use GPL :D

l33t_linux_h4x0r
12-04-2007, 05:06 AM
Ok you are right I will GPL it with one minor catch the part about if you edit you must redistribute. Well in addition you must send me a copy and a changelog. Give me a bit and I will upload what I have. However I was planning on writing a new installer. It would probably use zenity for the gui but that isn't the cool part. I would write the sh installer asking one question "where do you want this installed?" then install. but the cool part would be that the sh script and the archive would be one file. How you ask? simple just do a cat file.sh archive.tar.bz2 > installer.sh Now you are saying that that would never work. Well i have that fixed too. in the script write some code such as
#!/bin/sh
install_path=(input or default)
archive="`tail (however many lines the archive is) `pwd`/installer.sh`"
tar -xvjf ${archive}.tar.bz2 -C ${install_path}
(icon install code)
echo "install complete"
exit 1

btw that is my modified GPL too. anyways let me get to work finishing the new script and yes i know that (*) is not proper code i wrote that in like 30 seconds. (*) are place holders in that code.

l33t_linux_h4x0r
12-04-2007, 06:14 AM
Here is the "finished" installer. Everything works and has been tested. I checked every possible option combination. Note that this is version 1.0 you still need the regnum archive for the game files.

#!/bin/sh
#This is a simple user check, you have to be root to run this script.
if [ `whoami` != root ]; then
echo "
You must be root to run this script.
"
read -p "Press Enter to exit ..."
tput clear && exit 1
fi
#END of user check.

### Welcome message ###

echo "
##########################################
### Unofficial Regnum Online Installer ###
### Created by: Brice Collins ###
### e-mail: pitaboy@nerdshack.com ###
##########################################
"
read -p "Press Enter to continue ..."
tput clear

### END Welcome message ###

### Preperation for install ###

#Defaults
Install_dir="/usr/local/games/Regnum"
Archive="`pwd`"
#END of Defaults

### User input ###

#Finding out what the install path is.
echo "Please enter an install path. The default path is /usr/local/games/Regnum
To use the default setting just press Enter."
echo -n "Install Path = "
read User_install_dir
tput clear
#END Finding out what the install path is.

#Finding out where the archive is.

#Finding out where the archive is and checking if it is correct.
echo "Please enter the location of Regnum_Archive.tar.bz2
The default is the same directory that this script is run from.
To use the default setting just press Enter."
echo -n "Archive Directory = "
read User_archive
if [ "${User_archive}" != "" ]; then
until [ "${Test}" = "${User_archive}/Regnum_Archive.tar.bz2" ] || [ "${User_archive}" == "" ]; do
Test="`ls ${User_archive}/Regnum_Archive.tar.bz2`"
if [ "${Test}" != "${Archive}/Regnum_Archive.tar.bz2" ]; then
echo -n "Incorect path, no archive found. Please try again or press enter for default : " & read User_archive
fi
done
fi
echo "Archive accepted continuing ..."
tput clear
#END Finding out where the archive is and checking if it is correct.

### END of User input ###

#Install information.
if [ "${User_install_dir}" == "" ]; then
echo "Regnum Online will be installed to ${Install_dir}"
if [ "${User_archive}" == "" ]; then
echo "Useing files from the archive found in ${Archive}"
else
echo "Useing files from the archive found in ${User_archive}"
fi
else
echo "Regnum Online will be installed to ${User_install_dir}"
if [ "${User_archive}" == "" ]; then
echo "Useing files from the archive found in ${Archive}"
else
echo "Useing files from the archive found in ${User_archive}"
fi
fi

echo ""
read -p "Press Enter to begin installation ..."
tput clear
#END Install information.

#Creating install directory.
if [ "${User_install_dir}" == "" ]; then
mkdir -p ${Install_dir}
else
mkdir -p ${User_install_dir}
fi

if [ "${User_install_dir}" == "" ]; then
echo "Creating ${Install_dir}"
else
echo "Creating ${User_install_dir} "
fi
#END Creating install directory.

### END of Preperation for install ###

### Actual Installation of files ###

#Extracting Archive.
if [ "${User_install_dir}" == "" ]; then
if [ "${User_archive}" == "" ]; then
tar -xvjf ${Archive}/Regnum_Archive.tar.bz2 -C ${Install_dir}/
else
tar -xvjf ${User_archive}/Regnum_Archive.tar.bz2 -C ${Install_dir}/
fi
else
if [ "${User_archive}" == "" ]; then
tar -xvjf ${Archive}/Regnum_Archive.tar.bz2 -C ${User_install_dir}/
else
tar -xvjf ${User_archive}/Regnum_Archive.tar.bz2 -C ${User_install_dir}/
fi
fi
#END Extracting Archive.

#Setting permissions.
if [ "${User_install_dir}" == "" ]; then
chmod 777 ${Install_dir} -R
else
chmod 777 ${User_install_dir} -R
fi
#END Setting permissions.

### END of Actual Installation of files ###

tput clear
echo "All files sucessfully installed. However your installation is not complete."

### Creation of Shortcuts ###

#Menu entry.
echo ""
echo "Would you like to add a Menu entry?"
echo -n "answer: "
read answer
until [ "${answer}" == "yes" ] || [ "${answer}" == "no" ] || [ "${answer}" == "y" ] || [ "${answer}" == "n" ]; do
echo -n 'Please type a valid response, "yes" "no" "y" or "n": '
read answer
done

if [ "${answer}" = "yes" ] || [ "${answer}" = "y" ]; then
if [ "${User_install_dir}" == "" ]; then
echo "[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Regnum Online
Comment=Regnum Online launcher
Exec=${Install_dir}/regnum.sh
Icon=${Install_dir}/regnum.xpm
Terminal=false
Type=Application
Categories=Application;Game;X-Red-Hat-Base;
GenericName=" > /usr/share/applications/regnumonlinemenu.desktop && echo "Menu entry created."
else
echo "[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Regnum Online
Comment=Regnum Online launcher
Exec=${User_install_dir}/regnum.sh
Icon=${User_install_dir}/regnum.xpm
Terminal=false
Type=Application
Categories=Application;Game;X-Red-Hat-Base;
GenericName=" > /usr/share/applications/regnumonlinemenu.desktop && echo "Menu entry created."
fi
else [ "${answer}" = "no" ] || [ "${answer}" = "n" ];
echo "Skipping menu entry."
fi
#END Menu entry.

#Desktop shortcut. Currently not working I need to find a simple way to put an icon on the desktop for all users and all future users.
#echo "Would you like to add a Desktop shortcut?"
#echo -n "answer: "
#
#read answer
#until [ "${answer}" == "yes" ] || [ "${answer}" == "no" ] || [ "${answer}" == "y" ] || [ "${answer}" == "n" ];
#do
#echo -n 'Please type a valid response, "yes" "no" "y" or "n":' & read answer
#done
#
#if [ "${answer}" = "yes" ] || [ "${answer}" = "y" ]; then
# if [ "${User_install_dir}" == "" ]; then
# echo "[Desktop Entry]
#Version=1.0
#Encoding=UTF-8
#Name=Regnum Online
#Comment=
#Exec=${Install_dir}/regnum.sh
#Icon=${Install_dir}/rolauncher.png
#Terminal=false
#Type=Application
#Categories=Desktop;
#GenericName=" > /usr/share/applications/regnumonlinedesktop.desktop && echo "Desktop shortcut created."
# else
# echo "[Desktop Entry]
#Version=1.0
#Encoding=UTF-8
#Name=Regnum Online
#Comment=
#Exec=${User_install_dir}/regnum.sh
#Icon=${User_install_dir}/rolauncher.png
#Terminal=false
#Type=Application
#Categories=Desktop;
#GenericName=" > /usr/share/applications/regnumonlinedesktop.desktop && echo "Desktop shortcut created."
# fi
#else [ "${answer}" = "no" ] || [ "${answer}" = "n" ];
# echo "Skipping menu entry."
#fi
#END Desktop shortcut.

### END Creation of Shortcuts ###

### Exit code ###

#Exiting installer.
echo "Install Complete!!!"
read -p "Press Enter to exit ..."
tput clear
exit 1
#END Exiting installer.

### END Exit code ###

I edited the regnum.sh file so that it can be used in any directory. The installation of this file could be easily be added to the script but since it was included with the original release I just edited it and put it in the archive.

here is the edited regnum.sh file.

#!/bin/sh
cd "`pwd`"
./rolauncher


Hope that you enjoy my work. Just copy and paste the files into a text editor and save them as install.sh and regnum.sh respectively. then run a "chmod +x install.sh regnum.sh"

Dont forget my GPL modification.

Once again enjoy :metal: :metal: :metal: :metal:

I am now going to begin work on the above post well probably not till I go to work tomorrow and/or on the weekend while I'm working right now I need to play some Regnum havent played in like a week.

MAXDDARK
12-04-2007, 09:07 AM
Way to go Brice ! I knew you would release it under the GPL eventually.
Yes this license insures that the modified code will be published under the same license you did, and a copy of the modified code will get to your email box :D

Miraculix
12-04-2007, 11:33 PM
May I suggest a separate topic for the installer, with feedback on beta-testing and stickied? Maybe notify NGD about this whole effort?

EDIT: Casually browsing through the code, I noticed there is no hash check done on the archive once it has been found. You probably should add that, large archives can be prone to corruption.

l33t_linux_h4x0r
12-05-2007, 04:08 AM
yes a hash check should be added. I see that nvidia uses that for their drivers. I am having trouble merging the two files. I keep getting bzip errors. saying that it is curropt. So I have been looking at nvidia's propitary drivers which are installed via bash script with an archive included. BTW there code isnt documented very well. Oh well I will add the hash check and maybe if I'm feeling up to it add a gui.

l33t_linux_h4x0r
12-05-2007, 05:50 AM
Here is the installer official thread http://www.regnumonline.com.ar/forum/showthread.php?t=15763