The Ur-Quan Masters Discussion Forum

The Ur-Quan Masters Re-Release => Technical Issues => Topic started by: JHGuitarFreak on November 26, 2006, 12:19:02 am



Title: Dumb linux question...
Post by: JHGuitarFreak on November 26, 2006, 12:19:02 am
How do I install UQM on linux, specifically Ubuntu?

And do I use the same headers and libs to compile UQM under ubuntu as i would on windows or mingw?



THanks for any help


Title: Re: Dumb linux question...
Post by: Novus on November 26, 2006, 11:35:26 am
Compiling UQM on Linux is roughly the same as on MinGW, except that installing the libraries is a lot easier; just install the development and runtime versions of the libraries UQM uses and the usual compiler tools. Under Ubuntu, you'll probably want to use Synaptic (or some other APT front-end) to install the packages; you shouldn't have to find and compile any libraries yourself.

If you just want the latest release version of UQM, I think it's in Ubuntu already.


Title: Re: Dumb linux question...
Post by: JHGuitarFreak on November 26, 2006, 09:29:45 pm
cool thanks :D


EDIT ::.

Funny enough, when trying to execute command "./build.sh uqm" ubuntu spits at me and says "PERMISSION DENIED", even when i use "sudo"


Title: Re: Dumb linux question...
Post by: Novus on November 26, 2006, 10:38:20 pm
Funny enough, when trying to execute command "./build.sh uqm" ubuntu spits at me and says "PERMISSION DENIED", even when i use "sudo"
Sounds like ./build.sh and/or the files it calls have the wrong permissions (specifically, it's missing the execute permission). This may occur if you've downloaded the source as a .zip file or unpacked it to a disk partition without Unix permission support (e.g. a Windows partition). You are strongly advised to use tar or cvs or something else that correctly transfers file permissions instead, and store source trees on a Linux partition (e.g. ext3 or ReiserFS).

It may also be possible to get permission problems by unpacking the source archive as a different user to the one compiling. In general, you can get away with unpacking and compiling as a normal user and only using root for install (and that only if you install somewhere non-user-writable).


Title: Re: Dumb linux question...
Post by: JHGuitarFreak on November 26, 2006, 10:44:00 pm
Yeah, i basically did a copy and paste from one of my NTFS drives to the linux drive so that could be the problem.

i'll download from sourceforge and see what i come up with


UPDATE ::.

It works, but now i need to get the correct packages installed to build it :-\

Another UPDATE ::.
Compiled it, now wondering how to play, or even where to put the content packages  :P



Title: Re: Dumb linux question...
Post by: Novus on November 27, 2006, 12:25:58 am
Compiled it, now wondering how to play, or even where to put the content packages  :P
Create a directory called "packages" somewhere and put the content packages in there. In the directory you compiled to (assuming a debug build), do something like:
Code:
./uqm-debug --contentdir=/path/to/content/
Note that the "packages" part of the content directory path must be removed.

As a CVS user, I have the content directory inside the main UQM directory and usually go:
Code:
./uqm-debug --contentdir=content/
For a release build, remove the "-debug" part.


Title: Re: Dumb linux question...
Post by: JHGuitarFreak on November 27, 2006, 12:54:43 am
Thanks Novus!  ;D


Title: Re: Dumb linux question...
Post by: JHGuitarFreak on November 27, 2006, 03:51:08 am
Compiled it, now wondering how to play, or even where to put the content packages  :P
Create a directory called "packages" somewhere and put the content packages in there. In the directory you compiled to (assuming a debug build), do something like:
Code:
./uqm-debug --contentdir=/path/to/content/
Note that the "packages" part of the content directory path must be removed.

As a CVS user, I have the content directory inside the main UQM directory and usually go:
Code:
./uqm-debug --contentdir=content/
For a release build, remove the "-debug" part.

i still can't get it to work...

just to clarify though, if i had the 'packages' folder in the same folder as the 'uqm' command then i would use
Code:
uqm --contentdir=./packages
   ?

or is there something i'm missing here


Title: Re: Dumb linux question...
Post by: meep-eep on November 27, 2006, 04:46:46 am
There's a file doc/users/unixinstall which should explain everything.


Title: Re: Dumb linux question...
Post by: Novus on November 27, 2006, 11:48:48 am
i still can't get it to work...
Could you be a little more specific?

Quote
just to clarify though, if i had the 'packages' folder in the same folder as the 'uqm' command then i would use
Code:
uqm --contentdir=./packages
   ?
You probably need "./uqm" instead of "uqm", unless your distro is putting "." in PATH (which it shouldn't, especially not in the beginning of the list, as this allows malicious scripts to be accidentally run when you think you're examining them).



Title: Re: Dumb linux question...
Post by: JHGuitarFreak on November 28, 2006, 01:29:27 am
well i got it to work, but now i need to find out how to get my FMV's to work, which will probably quite easy now that everythings installed.


Title: Re: Dumb linux question...
Post by: JHGuitarFreak on December 02, 2006, 03:20:06 am
NEW PROBLEM!

What seemed to work before hasn't worked the second time around.
I had to install Ubuntu after a HD format (i periodically format my main drive all the time)
and it seemes uqm is broken...

After following the same steps as I did last time I type 'uqm' into the terminal and it says "Fatal error: Could not find content" and i have the content folder defined as follows (--contentdir=/usr/games/share/uqm/content/) with 'packages' inside the content folder, and this is just the default install settings.

Maybe i'm just missing an important step, I'll do a quick one over and maybe just rebuild/reinstall and see if that works.


Title: Re: Dumb linux question...
Post by: meep-eep on December 02, 2006, 04:42:45 am
You need the "version" file in content.


Title: Re: Dumb linux question...
Post by: JHGuitarFreak on December 02, 2006, 05:57:26 am
You need the "version" file in content.


Thanks, I would have never realised that one.

another issue, I can't get the ship spins nor any of the FMV's to work with my "mod".


Title: Re: Dumb linux question...
Post by: Novus on December 02, 2006, 12:57:30 pm
another issue, I can't get the ship spins nor any of the FMV's to work with my "mod".
If none of the FMVs work, you've probably just put them in the wrong directory and/or disabled them by selecting PC intro/ending in the setup menu. Check the debug output for details.

Also, reformatting Linux partitions and reinstalling is kind of pointless (unless you're actually repartitioning your hard disk or changing filesystems). Even if you're switching distros and want a clean install, keeping your home directory is a great way to keep working from where you left off. My main PC actually uses a SuSE Linux installation that has been upgraded several times since I copied the entire partition contents from my previous computer (a trick that usually fails utterly with Windows) three years ago. The Windows partitions have, of course been reformatted since then.


Title: Re: Dumb linux question...
Post by: Culture20 on December 02, 2006, 07:52:54 pm
Even if you're switching distros and want a clean install, keeping your home directory is a great way to keep working from where you left off.
Eventually though, it's a good idea to copy over the latest greatest config files for your desktop.  Until recently, my gnome experience was being driven by config files that I had set up on a RH 8 box years ago.  I finally decided to get used to what the default has become.  ;)


Title: Re: Dumb linux question...
Post by: JHGuitarFreak on December 02, 2006, 08:49:42 pm
another issue, I can't get the ship spins nor any of the FMV's to work with my "mod".
If none of the FMVs work, you've probably just put them in the wrong directory and/or disabled them by selecting PC intro/ending in the setup menu. Check the debug output for details.

Also, reformatting Linux partitions and reinstalling is kind of pointless (unless you're actually repartitioning your hard disk or changing filesystems). Even if you're switching distros and want a clean install, keeping your home directory is a great way to keep working from where you left off. My main PC actually uses a SuSE Linux installation that has been upgraded several times since I copied the entire partition contents from my previous computer (a trick that usually fails utterly with Windows) three years ago. The Windows partitions have, of course been reformatted since then.


well i have the 'slides' folder in the 'content' folder and i have the content folder defined in a script as "/usr/games/urquan/content" and i have the movies turned on in the options.

can't see what i'm doing wrong here.

Oh and I reformatted because my Winblows XP installation cd thought it'd be funny to format the linux drive instead of the the main drive which i was reinstalling xp to. So i ended up reinstalling both.


Title: Re: Dumb linux question...
Post by: Novus on December 02, 2006, 09:28:09 pm
well i have the 'slides' folder in the 'content' folder and i have the content folder defined in a script as "/usr/games/urquan/content" and i have the movies turned on in the options.
OK, the intro should be in slides/intro/intro.duk (and so on as in the FAQ (http://uqm.stack.nl/wiki/The_Ur-Quan_Masters_Technical_FAQ#How_do_I_use_the_3DO_intro_and_victory_movies_in_the_game.3F)) in the content directory. Are you sure that this is the exact name (i.e. same case and everything)? Is there anything relevant in the debug output?

Quote
Oh and I reformatted because my Winblows XP installation cd thought it'd be funny to format the linux drive instead of the the main drive which i was reinstalling xp to. So i ended up reinstalling both.
Interesting. Last time I installed XP, it didn't reformat anything except the partition I'd left for it (on the second hard disk, no less).


Title: Re: Dumb linux question...
Post by: JHGuitarFreak on December 03, 2006, 03:28:54 am
well i have the 'slides' folder in the 'content' folder and i have the content folder defined in a script as "/usr/games/urquan/content" and i have the movies turned on in the options.
OK, the intro should be in slides/intro/intro.duk (and so on as in the FAQ (http://uqm.stack.nl/wiki/The_Ur-Quan_Masters_Technical_FAQ#How_do_I_use_the_3DO_intro_and_victory_movies_in_the_game.3F)) in the content directory. Are you sure that this is the exact name (i.e. same case and everything)? Is there anything relevant in the debug output?

Quote
Oh and I reformatted because my Winblows XP installation cd thought it'd be funny to format the linux drive instead of the the main drive which i was reinstalling xp to. So i ended up reinstalling both.
Interesting. Last time I installed XP, it didn't reformat anything except the partition I'd left for it (on the second hard disk, no less).

i'm pretty sure, it's in "/urquan/content/slides/intro/intro.duk" and the content is defined as above.
Right now i'm in windows so i'll just reboot and see if it says anything in the output.

And about the reinstallation, i used my factory cd that came with the computer so what it did was just repartition my hard drive into 1 main drive instead of the 4 i had before (NTFS for Win, Fat32 for Sharing, ext3 for Linux and the swap partition) i guess i hit the wrong key cause otherwise i know it wouldn't have done that.


.:: Edit

it says this when it trys to load the intro:
Code:
VideoDecoder_Load: 'DukVid' decoder did not load slides/intro/intro.duk, code 0
        'slides/intro/intro.txt' -- 8300 bytes
and this when it trys to load the ship spins:
Code:
VideoDecoder_Load: 'DukVid' decoder did not load slides/spins/ship11.duk, code 0


Title: Re: Dumb linux question...
Post by: Novus on December 03, 2006, 01:57:31 pm
Hmm... Isn't 0 supposed to mean success? I think the error code is being written to the wrong field in the decoder status (last_error instead of error). Anyhow, the open call only has one failure code, so that number wouldn't be any use.

Basically, this failure occurs if the .duk file can't be opened or the .hdr, .tbl or .frm files can not be opened or are invalid. Check that all four files are in the right place with the right names, you have read access to them and they contain the right data.


Title: Re: Dumb linux question...
Post by: JHGuitarFreak on December 03, 2006, 10:00:06 pm
Hmm... Isn't 0 supposed to mean success? I think the error code is being written to the wrong field in the decoder status (last_error instead of error). Anyhow, the open call only has one failure code, so that number wouldn't be any use.

Basically, this failure occurs if the .duk file can't be opened or the .hdr, .tbl or .frm files can not be opened or are invalid. Check that all four files are in the right place with the right names, you have read access to them and they contain the right data.


AH read access, the ole file permission problem bites again lol.
Again I never thought of it, me being of course a windows user and have only dealt with file permissions on my website (which i need to fix anyways).


UPDATE ::.
changing the file permissions didn't work, and I know my duk files work cause i use the same ones for my windows binary.


maybe it's an Ubuntu problem


Title: Re: Dumb linux question...
Post by: Novus on December 06, 2006, 09:46:54 am
Try this (highly unofficial and hacked together in a few minutes) patch (http://koti.mbnet.fi/lonnberg/dukdiag.patch); it should improve error reporting in the DUK player enough to figure out what's wrong.


Title: Re: Dumb linux question...
Post by: JHGuitarFreak on December 06, 2006, 11:52:14 am
Try this (highly unofficial and hacked together in a few minutes) patch (http://koti.mbnet.fi/lonnberg/dukdiag.patch); it should improve error reporting in the DUK player enough to figure out what's wrong.

I gotta ask you a question real quick here,
How do you make .diff's, i thought i knew how but i've been getting it wrong every time.



Title: Re: Dumb linux question...
Post by: Novus on December 06, 2006, 01:11:17 pm
I gotta ask you a question real quick here,
How do you make .diff's, i thought i knew how but i've been getting it wrong every time.
I'm usually comparing against CVS, so I do something like:
Code:
cvs diff -u file-or-directory > patch
Without CVS, you probably want something like:
Code:
diff -ur old-dir new-dir > patch


Title: Re: Dumb linux question...
Post by: JHGuitarFreak on December 06, 2006, 10:58:26 pm
I gotta ask you a question real quick here,
How do you make .diff's, i thought i knew how but i've been getting it wrong every time.
I'm usually comparing against CVS, so I do something like:
Code:
cvs diff -u file-or-directory > patch
Without CVS, you probably want something like:
Code:
diff -ur old-dir new-dir > patch

cool thanks, I'll probably give your  patch a try today and see whatsd goin on.

how did you get your patch file to look like it did, for example your first few lines look like:
Code:
Index: src/sc2code/libs/video/dukvid.c
===================================================================
RCS file: /cvsroot/sc2/sc2/src/sc2code/libs/video/dukvid.c,v
retrieving revision 1.6
diff -u -r1.6 dukvid.c
--- src/sc2code/libs/video/dukvid.c 3 May 2006 23:32:34 -0000 1.6
+++ src/sc2code/libs/video/dukvid.c 6 Dec 2006 08:45:14 -0000
@@ -22,8 +22,19 @@
 #include "video.h"

where as mine looks like this:
Code:
diff -ur uqm-0.5.0/build/unix/build.config uqm-0.5.0-fmv/build/unix/build.config
--- uqm-0.5.0/build/unix/build.config 2006-01-19 11:13:38.000000000 -0800
+++ uqm-0.5.0-fmv/build/unix/build.config 2006-02-07 10:45:34.000000000 -0800
@@ -128,14 +128,14 @@
  CHOICE_graphics_OPTION_pure_TITLE="Don't include OpenGL graphics support"



Title: Re: Dumb linux question...
Post by: JHGuitarFreak on December 07, 2006, 04:26:52 am
Well here is the new results for the duk vids, now they can't be found ::)

Code:
Failed to open slides/intro/intro.duk in : No such file or directory
VideoDecoder_Load: 'DukVid' decoder did not load slides/intro/intro.duk, code -2
the vids go into /content/slides/ right?

if so then now i really dont know what the problem is


Title: Re: Dumb linux question...
Post by: Novus on December 07, 2006, 12:32:05 pm
Right, let's take a look at the directory structure, then.

First of all, find the content directory you're really using by checking the debug output; the relevant line should be something like:
Code:
Using '/home/novus/uqm/sc2/content' as base content dir.

Next, cd into that directory and execute:
Code:
ls -lR slides > filelist
The resulting file list should give me enough information to check that everything is correctly installed.


Title: Re: Dumb linux question...
Post by: JHGuitarFreak on December 08, 2006, 12:52:04 am
here is the filelist: filelist (http://serosis.110mb.com/filelist)

did exactly as you say, content dir was 'usr/games/urquan/content/'


Title: Re: Dumb linux question...
Post by: Novus on December 08, 2006, 01:16:58 am
As I suspected all along, the filenames are wrong; INTRO.DUK should be intro.duk and so on in lower case. Apparently I wasn't clear enough about the "same case" thing. Most Linux filesystems are case sensitive, so a program looking for intro.duk won't open INTRO.DUK.

The fix is simple: convert all the DUK filenames to lower case. If you have mmv, you can do (in the slides directory):

Code:
mmv ";*" "#1#l2"


Title: Re: Dumb linux question...
Post by: JHGuitarFreak on December 08, 2006, 02:10:01 am
 :o Well, it was a simple solution the whole time   :)

thanks for the help Novus.


Well the mods work perfectly, and the FMV mod works very smoothly, and if I remember correctly, by default the Duk vids are all capitilized in name so maybe that should change in the code too just to make it easier for the end-user.


Title: Re: Dumb linux question...
Post by: Novus on December 08, 2006, 12:10:43 pm
Well the mods work perfectly, and the FMV mod works very smoothly, and if I remember correctly, by default the Duk vids are all capitilized in name so maybe that should change in the code too just to make it easier for the end-user.
You have a point there. unCD-ROM outputs a mix of upper and lower case file names, the way they are stored on the CD. UQM, on the other hand, expects all lower-case names. It's documented, so it's a feature, not a bug, but it's still annoying. Reported as bug #930 (http://bugs.uqm.stack.nl/show_bug.cgi?id=930).