project-navigation
Personal tools

Author Topic: Getting Started (Mac OS X  (Read 12825 times)

TwoADay

  • Guest
Getting Started (Mac OS X
« on: September 17, 2007, 12:47:09 am »
I can't start the game. I've unpacked the items, copied to my applications, and double-clicked. No dice. I tried launching via the Command Line. Here's what I got:

Adding game dir: ./base
Added packfile ./base/0base.pk3 (5 files)
Added packfile ./base/0maps.pk3 (388 files)
Added packfile ./base/0media.pk3 (5 files)
Added packfile ./base/0models.pk3 (874 files)
Added packfile ./base/0pics.pk3 (1730 files)
Added packfile ./base/0snd.pk3 (121 files)
Added packfile ./base/0ufos.pk3 (63 files)
using /Users/xxx/.ufoai/2.1.1/base for writing
Adding game dir: /Users/xxx/.ufoai/2.1.1/base
execing default.cfg
couldn't exec config.cfg
execing keys.cfg
Hostname: xxx-computer.local
IP: 192.168.0.100
..added 3 maps to the mapcycle
...could not set to language: en
...could not set to system language
Console initialized.

------- sound initialization -------
Loading snd_sdl sound driver
...library search path: '.'
Soundsystem: SDL.
SDL version: 1.2.9
SDL audio driver is "coreaudio".
Bits: 16
Frequency: 48000
Samples: 4096
Channels: 2
sound sampling rate: 48000
------- Loading ref_sdl.dylib -------
LoadLibrary ("./ref_sdl.dylib")
ref_gl version: GL 0.12
setting mode 6: 1024 768
SDL version: 1.2.9
SDL audio device shut down.
recursive shutdown
Error: (SDLGL) SDL SetVideoMode failed: Error setting OpenGL fullscreen: invalid drawable


Am I missing something else here? I'm running a MacBook Core Duo, 2 Ghz, 1 GB RAM. Thanks for any help you all might provide.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Getting Started (Mac OS X
« Reply #1 on: September 17, 2007, 08:51:28 am »
it's only a guess, but your sdl version is quite old - 1.2.12 is the latest, try to update (you need at least 1.2.10)

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Getting Started (Mac OS X
« Reply #2 on: September 17, 2007, 08:58:06 am »
btw. it would be cool if you could maybe also test the latest version that is in our source repository (svn)

we are close to a new version. but we need more mac testers to ensure, that the game is working on this plattform, too
are you using a ppc or intel mac?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Getting Started (Mac OS X
« Reply #3 on: September 17, 2007, 10:25:20 am »
information on how to compile for macos: http://ufoai.ninex.info/wiki/index.php/Compile_for_Mac

TwoADay

  • Guest
Re: Getting Started (Mac OS X
« Reply #4 on: September 18, 2007, 12:05:42 am »
btw. it would be cool if you could maybe also test the latest version that is in our source repository (svn)

we are close to a new version. but we need more mac testers to ensure, that the game is working on this plattform, too
are you using a ppc or intel mac?

Thanks for the response. I'm using an intel mac. I'd be up for helping the testing process, although I must admit that I don't have much experience in testing open-source software, so my ability at compiling code is...non-existent, essentially.  Additionally, I don't have a whole lot of free time, so my usefulness as a tester may be limited, since I would only have time to play for a couple hours a week (likely about 2 to 4, but if I find the game very addicting, I could probably sink up to 10 a week)

I'll try to find a more up-to-date build to run. Thanks again. Send me a PM if you're still interested in having me do some testing.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Getting Started (Mac OS X
« Reply #5 on: September 18, 2007, 09:23:30 am »
if you need help with compiling, let us know. because if there are still questions open, the wiki article could need more work => thus ask everything that is unclear. then we can help you and update the wiki article, too

TwoADay

  • Guest
Re: Getting Started (Mac OS X
« Reply #6 on: September 23, 2007, 03:54:54 pm »
Sorry about the late reply: I looked at the directions page on the wiki. At the top, it says it doesnt work at this time... :-\

Even then however, I would need more detailed instructions pretty much across the whole process than what is detailed on that page.

I also looked around for a more recent build, and didn't find one on sourceforge - unless Im supposed to download more than one file, which would explain a lot. There seems to be a bunch of things listed on sourceforge, but it isn't too clear what things are needed, and what's included in the ufoai-2.1.1_macosx_installer.

Thanks for the help and such, I'm truly interested in getting this running, but as I've said before, I don't really have too much time to try out and figure things out.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Getting Started (Mac OS X
« Reply #7 on: September 23, 2007, 08:09:33 pm »
well, you have to get the svn trunk checkout and install the macports and the needed libs that are shown in the above listed wiki article

the just run
Code: [Select]
./configure --with-openal=no
make

that should be all to run the game

alexis

  • Guest
Re: Getting Started (Mac OS X
« Reply #8 on: September 28, 2007, 11:51:04 pm »
Hi,

I have a mac ppc (Mac OS 10.4.10.)
I have succeeded in compiling UFOAI but I had to make some workarounds (symlinks, in fact) to have some OpenGL headers files been found (on a mac they are located in /System/Library/Frameworks/OpenGL.framework/Versions/A/Headers). I may also have installed additional libraries from different sources (SDL, OpenAL, well I don't remember... but not systematically installed with macports.)

  • As macports install stuffs in /sw, when I want to do ./configure I have to execute those lines:
    export CFLAGS=-I/sw/include
    export LDFLAGS=-L/sw/lib
    export CXXFLAGS=$CFLAGS
    export CPPFLAGS=$CXXFLAGS
    export ACLOCAL_FLAGS="-I /sw/share/aclocal"
    export PKG_CONFIG_PATH="/sw/lib/pkgconfig"
    export PATH=$PATH:/usr/local/bin
    export MACOSX_DEPLOYMENT_TARGET=10.4
    sudo ./configure --with-openal=no

  • When I compile the source codes, I got the following compiling errors:
    src/renderer/r_sdl.c: In function 'R_InitGraphics':
    src/renderer/r_sdl.c:176: error: 'SDL_GL_ACCELERATED_VISUAL' undeclared (first use in this function)
    src/renderer/r_sdl.c:176: error: (Each undeclared identifier is reported only once
    src/renderer/r_sdl.c:176: error: for each function it appears in.)
    src/renderer/r_sdl.c:177: error: 'SDL_GL_SWAP_CONTROL' undeclared (first use in this function)
    So I modified the source code:
       SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
       SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, r_swapinterval->integer);
    into:
    #ifdef SDL_GL_ACCELERATED_VISUAL
       SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
    #endif
    #ifdef SDL_GL_SWAP_CONTROL
       SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, r_swapinterval->integer);
    #endif
    Then it works.

  • The game launchs and I can start a new mission (the interface seems to work), but I haven't recompiled maps for now because this takes a very long time. How can I use rsync to avoid compiling maps?
    I tried this (from http://mattn.ninex.info/?page=Download):
    sudo rsync -avz rsync://mattn.ninex.info/ufo/ base/maps/
    and I got this error:
    @ERROR: Unknown module 'ufo'
    rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
    rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-24.1/rsync/io.c(359)
    What I'm doing wrong? (I have never used rsync)

  • You provide a mac intel release on sourceforge. It would be great if you can compile it as an universal binary (ie a mac executable that can run on intel and ppc). For more info about this, you can read http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/compiling/chapter_4_section_3.html
    and also:
    http://developer.apple.com/documentation/MacOSX/Conceptual/universal_binary/
    (NB: there is a section in the last link about OpenGL issues.)
    If you have a mac intel, you can test an universal binary in ppc mode. The following link
    http://developer.apple.com/documentation/MacOSX/Conceptual/universal_binary/universal_binary_exec_a/chapter_950_section_5.html
    say that "you can force a command-line tool to run translated by entering the following in Terminal":
    ditto -arch ppc <toolname> /tmp/toolname
    /tmp/toolname


Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Getting Started (Mac OS X
« Reply #9 on: September 29, 2007, 12:36:23 am »
that's great news - the menus are working for you?

we still have an endian bug in our Grid_* functions - you can't walk to any level bigger than 1 - the cursor just disappears. I don't have an big endian system around here to test and fix thing, would be nice if you could maybe have a look. We definitly need more mac users and maybe (if you have the time) developers.

alexis

  • Guest
Re: Getting Started (Mac OS X
« Reply #10 on: September 29, 2007, 06:30:52 pm »
Yes, the menus are working.
I can launch a game, and the interface (geoscape, bases, equipment, etc.) seems to work.

I have compiled some few maps and I have launched africa04d from the console. Then I got this error:
ERROR: Grid_CheckForbidden: unknown forbidden-size: 0
In fact, when I read static qboolean Grid_CheckForbidden in cmodel.c, I don't understand the following line:
forbidden_size = *(p + 1);
because there is a test y == (*p)[1] two lines later, "y" can't be the same as "forbidden_size"...

I have launched UFOAI with Shark, the profiling tool from Apple. On my machine, the most time-consuming functions called during the geoscape display are S_RawSamples (4.6%), Q_strncmp (3.6%), ShortSwap (1.5%), and R_FindImage (1.4%).  NB: Q_strncmp is simply a call to strncmp: you should #define or inline it, or directly call strncmp...

How can I use rsync instead of recomputing all maps? (btw: are maps byte-order independant?)
I tried this:
sudo rsync -avz rsync://mattn.ninex.info/ufo base/maps/
@ERROR: Unknown module 'ufo'

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Getting Started (Mac OS X
« Reply #11 on: September 29, 2007, 10:05:57 pm »
rsync is currently not working, please try to download the mappack from http://mattn.ninex.info - it's up-to-date right now.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Getting Started (Mac OS X
« Reply #12 on: September 29, 2007, 10:09:46 pm »
maps are working on every plattform, they are all stored in little endian and converted at run time. just the checksum may differ if you compile the maps on different architectures - because they are using floating points, which of course differ from plattform to plattform. but using the mappack is safe

i will look into the grid_checkforbidden thing tomorrow

S_RawSamples is called from the sound renderer thread, btw.

alexis

  • Guest
Re: Getting Started (Mac OS X
« Reply #13 on: September 29, 2007, 11:32:39 pm »
I can confirm that forbidden_size is badly handled in Grid_CheckForbidden: if I replace switch(forbidden_size) with switch(1) (which is the expected value), it works.

I have tested a map, and there is still two big problems (that were already there on 2.1):
- the mouse can't access some cells (I saw this on levels bigger than 1, but this is not the case for all the cells of such levels). In fact, the blue or green box isn't displayed on those cells, but soldiers and aliens can go there.
- soldiers and aliens can see thru walls, so aliens spend their reacting time to shoot on walls in direction of the soldiers, and sometimes kill themselves this way.

I have launched UFOAI in debug mode and I think I have found something concerning the first bug. Consider this part of code in CL_ActorMouseTrace:

   restingLevel = Grid_Fall(&clMap, testPos, fieldSize);
   /* hack to prevent cursor from getting stuck on the top of an invisible
      playerclip surface (in most cases anyway) */
   PosToVec(testPos, pA);
   VectorCopy(pA, pB);
   pA[2] += UNIT_HEIGHT;
   pB[2] -= UNIT_HEIGHT;
   CM_TestLineDM(pA, pB, pC);
   VecToPos(pC, testPos);
   restingLevel = min(restingLevel, Grid_Fall(&clMap, testPos, fieldSize));

When the bug occurs, the ending restingLevel value is 0 (the first Grid_Fall call returns 3, which is correct). This explains why no cursor box is displayed. I don't have the time to look further, but I hope this can help.