Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] 'games-strategy/ufo2000' porting help request
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
ssvb
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2003
Posts: 96

PostPosted: Fri Mar 31, 2006 4:26 pm    Post subject: [solved] 'games-strategy/ufo2000' porting help request Reply with quote

Hello all,

I'm one of the ufo2000 developers, but I do not have ppc hardware. Could anybody try our svn ebuild (available on http://ufo2000.sourceforge.net) on gentoo ppc? There is a thread in ufo2000 forums about porting the game to ppc/macosx which contains information about current status and currently known problems: http://www.xcomufo.com/forums/index.php?showtopic=8571

I'm asking for help because we have plans for releasing the new stable version soon (but actually we have missed a few deadlines already, so 'soon' is a relative thing :)). It would be good to have a fully working ppc port in the next version.

Thanks in advance.


Last edited by ssvb on Mon Apr 10, 2006 8:40 am; edited 1 time in total
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Sun Apr 02, 2006 1:35 am    Post subject: Reply with quote

Okay, I gave this a shot on a G4 machine. The graphics were screwed up as suggested in the linked thread. Using the tga alternative moonbase graphics you provided does indeed work, so the problem does seem to be in the png loading function. If you've got any patches or suggestions, I'd be happy to take a look.
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
ssvb
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2003
Posts: 96

PostPosted: Sun Apr 02, 2006 9:36 am    Post subject: Reply with quote

Thanks a lot.
Just committed some change to PNG loader that may fix these colors problems. Please update from SVN and try to test it again.
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Sun Apr 02, 2006 2:02 pm    Post subject: Reply with quote

Okay, that's better, the characters are now colored correctly. Unfortunately, shooting seems to still be broken, as well as the text color in the item menus. The text color is pink and green, and kind of hard to read. When shooting another player, the animation is shown in a solid block like the players were before.
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
ssvb
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2003
Posts: 96

PostPosted: Sun Apr 02, 2006 7:26 pm    Post subject: Reply with quote

JoseJX wrote:
Okay, that's better, the characters are now colored correctly.

That's good :)

Quote:
Unfortunately, shooting seems to still be broken, as well as the text color in the item menus. The text color is pink and green, and kind of hard to read.

Pink garbage around text on inventory screen was actually reproducible also on x86 arch, now it should be fixed, sorry about this :(

Quote:
When shooting another player, the animation is shown in a solid block like the players were before.

Was it just bullet impact animation or bullet flight animation too? I just found out that bullet impact frames used a different format - they are paletted images with alpha channel unlike all the others which are normal truecolor images. I have tweaked PNG loader a bit more, there is a chance that it works ok now. On the other hand there is a chance that it got worse. It needs to be checked.

About the text in item menu, is it the same as on that MacOS X screenshot (some thick black letters which are unreadable)? If it is the same problem, could you try setting F_SMALLFONT = 1 in ~/.ufo2000/ufo2000.ini? That will make the game use TTF font for all text messages instead of default bitmap allegro font that is currently used in the fire menu. Another interesting option in ufo2000.ini useful for debugging is F_FASTSTART = 1, adding it will make the game immediately start a hotseat tactical battle with the settings of the previous game, skipping all the menus and preparations.

So SVN now contains all these fixes, it would be interesting to test it and see if the game now works better on ppc. If you notice some other anomaly, a screenshot would be very welcome.

And thanks a lot for your help. I'm very sorry for taking your time, as a gentoo developer you probably have a lot of other more important things to do.
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Sun Apr 02, 2006 8:41 pm    Post subject: Reply with quote

The latest SVN version worked really well. I was able to play a short game with no noticable graphical glitches, nice work!

Quote:
And thanks a lot for your help. I'm very sorry for taking your time, as a gentoo developer you probably have a lot of other more important things to do.


Heh, not really. This is a whole lot more fun than most requests I get. :)
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
AaronPPC
Guru
Guru


Joined: 29 May 2005
Posts: 522
Location: Tucson, AZ

PostPosted: Tue Apr 04, 2006 12:42 am    Post subject: Reply with quote

I was looking forward to kicking some alien butt, however I got this:
Code:
umbogg.o obj/loadpng.o obj/regpng.o obj/savepng.o -lexpat -lsqlite3 -lfreetype -lz -lvorbisfile -lvorbis -logg -laldmb -ldumb -lpng -lz -lNL -pthread -L/usr/lib -Wl,--export-dynamic -lalleg-4.2.0 -lalleg_unsharable
/usr/lib/libaldmb.so: undefined reference to `_sort_out_getc'
collect2: ld returned 1 exit status
make: *** [ufo2000] Error 1

!!! ERROR: games-strategy/ufo2000-svn-0.7 failed.
Call stack:
  ebuild.sh, line 1526:   Called dyn_compile
  ebuild.sh, line 923:   Called src_compile
  ufo2000-svn-0.7.ebuild, line 47:   Called die

!!! emake failed
!!! If you need support, post the topmost build error, and the call stack if relevant.


I updated allegro to 4.2.0-r1 as part of the install. Here is my emerge --info:
Code:
Portage 2.1_pre7-r3 (default-linux/ppc/ppc32/2006.0/G4/Pegasos, gcc-3.4.5, glibc-2.3.5-r3, 2.6.15 ppc)
=================================================================
System uname: 2.6.15 ppc 7447/7457, altivec supported
Gentoo Base System version 1.12.0_pre16
dev-lang/python:     2.3.5, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="ppc"
AUTOCLEAN="yes"
CBUILD="powerpc-unknown-linux-gnu"
CFLAGS="-Os -mcpu=7450 -mtune=7450 -maltivec -mabi=altivec -fno-strict-aliasing -pipe"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-Os -mcpu=7450 -mtune=7450 -maltivec -mabi=altivec -fno-strict-aliasing -pipe"
DISTDIR="/portage/distfiles/"
FEATURES="autoconfig distlocks fixpackages metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.osuos1.org/ ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo"
MAKEOPTS="-j2"
PKGDIR="/portage/packages/"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/portage/"
PORTDIR_OVERLAY="/portage/local /portage/local/fluidportage/trunk /portage/local/xgl-coffee"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="ppc X a52 aac alsa altivec apache2 apm berkdb bitmap-fonts bonobo cdr cli crypt ctype cups dba divx4linux dri dvd dvdr eds emboss encode esd expat fastbuild ffmpeg flac foomatic foomaticdb force-cgi-redirect fortran ftp gd gdbm gif gpm gstreamer gtk gtk2 gtkhtml hal imlib isdnlog java jpeg ldap libg++ libwww mad memlimit mikmod motif mozilla mp3 mpeg ncurses nls nptl ogg opengl pam pcre pdflib perl png posix ppds pppd python quicktime readline ruby sdl session simplexml soap sockets spell spl ssl tcpd tokenizer truetype truetype-fonts type1-fonts udev unicode usb vcd vorbis xml xmms xsl xv zlib elibc_glibc input_devices_keyboard input_devices_mouse input_devices_joystick kernel_linux userland_GNU video_cards_ati"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS

_________________
--Aaron
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Tue Apr 04, 2006 1:38 am    Post subject: Reply with quote

I'm using ~ppc, so the issue is probably an older version of a library or something similar. Which version of allegro are you using and what is the output of emerge allegro -pv ?
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
AaronPPC
Guru
Guru


Joined: 29 May 2005
Posts: 522
Location: Tucson, AZ

PostPosted: Tue Apr 04, 2006 3:03 am    Post subject: Reply with quote

Yes, I had to upgrade to the ~ppc allegro:

Code:
pegasos games-strategy # emerge allegro -av

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] media-libs/allegro-4.2.0-r1  USE="X alsa esd -arts -doc -fbcon -oss -static -tetex" 0 kB

_________________
--Aaron
Back to top
View user's profile Send private message
ssvb
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2003
Posts: 96

PostPosted: Tue Apr 04, 2006 1:45 pm    Post subject: Reply with quote

AaronPPC wrote:
I was looking forward to kicking some alien butt, however I got this:
...

Actually it is currently impossible to kick alien butt, only kicking a butt of your fellow human player opponent is possible either in hotseat or network game now :) This coming new release is a 'portability and independence' milestone. That means now we have a free fan-made set of graphics and also the game can be more or less successfully compiled and run on x86, amd64, ppc and arm platforms. The next milestone will have AI and singleplayer mode added, but now we need to focus on current tasks and make at least this release done.

As for compilation problems, aldumb package just depends on allegro itself and needs to be reemerged (allegro 4.2.0 is not binary compatible with previous versions, only API compatibility is maintained), revdep-rebuild might also help to solve this problem.

PS. Current ufo2000 package (version 0.6.627) is marked stable on 'ppc', but I doubt that it could be run there as it really had lots of endian related issues.
Back to top
View user's profile Send private message
AaronPPC
Guru
Guru


Joined: 29 May 2005
Posts: 522
Location: Tucson, AZ

PostPosted: Tue Apr 04, 2006 11:46 pm    Post subject: Reply with quote

AHHH YES! My friend revdep-rebuild:
Code:
Checking dynamic linking consistency...
  broken /usr/bin/dumbplay (requires  liballeg.so.4.1)

That did the trick and I compiled the game successfully. When I try to start the game, I get this:
Code:
Error: set_gfx_mode() failed (Can not set video mode).

_________________
--Aaron
Back to top
View user's profile Send private message
ssvb
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2003
Posts: 96

PostPosted: Wed Apr 05, 2006 7:49 am    Post subject: Reply with quote

AaronPPC wrote:
When I try to start the game, I get this:
Code:
Error: set_gfx_mode() failed (Can not set video mode).

That means, well, that it can't initialize video mode. The game tries to set video mode that is specified in ~/.ufo2000/ufo2000.ini first (screen resolution, color depth, windowed or fullscreen mode). By default the following settings are used: 800x600 16bpp fullscreen. If the game is unable to set this video mode, it tries to falback to 640x480 with the same bit depth and fullscree flag as set in ini-file (640x480 was supposed to be supported everywhere). Looks like neither of these two options work and the game just shows that error message. Could you tell what screen resolution and color depth your desktop has? Also some more details like CRT/LCD display would be welcome.

As a solution to this problem, you can tweak settings in ufo2000.ini and try to find those that work.

And I think that probably one more fallback video mode would help to ensure that the game can start in any conditions: try to query desktop resolution and color depth and attempt to use these settings as the last resort. I'll try to commit this fix a bit later.
Back to top
View user's profile Send private message
AaronPPC
Guru
Guru


Joined: 29 May 2005
Posts: 522
Location: Tucson, AZ

PostPosted: Wed Apr 05, 2006 3:11 pm    Post subject: Reply with quote

ssvb wrote:
Could you tell what screen resolution and color depth your desktop has? Also some more details like CRT/LCD display would be welcome.

My desktop is 1280x1024x24 and I use an LCD monitor. I'll check my xorg.conf and make sure I have 800x600x16 set properly.
_________________
--Aaron
Back to top
View user's profile Send private message
ssvb
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2003
Posts: 96

PostPosted: Sat Apr 08, 2006 4:16 pm    Post subject: Reply with quote

to AaronPPC:
There is a fix available that should probably solve that setting video mode problem. Please try to test it and report results.
But this is important: we have migrated SVN to sourceforge during the last few days. So in order to do a clean test it is needed to:
# unmerge ufo2000-svn
# remove ~/.ufo2000 directory
# remove ufo2000 working copy in distfiles 'svn-src' directory
# download a new updated ufo2000 svn ebuild and put it into portage overlay (it has SVN location changed to sourceforge)
# emerge ufo2000-svn and try the latest revision

The expected result: the game should start normally even without changing any settings in either ufo2000 or xorg config files.
Back to top
View user's profile Send private message
AaronPPC
Guru
Guru


Joined: 29 May 2005
Posts: 522
Location: Tucson, AZ

PostPosted: Sat Apr 08, 2006 9:31 pm    Post subject: Reply with quote

That did the trick! Thank you so much!
_________________
--Aaron
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum