Hey, we have forums!

Author Topic: How to Install the achurch Aquaria Build for Mac Users  (Read 7412 times)

0 Members and 1 Guest are viewing this topic.

Offline FrancesF

  • Bit Bit
  • ****
  • Posts: 83
    • View Profile
How to Install the achurch Aquaria Build for Mac Users
« on: August 24, 2011, 06:04:04 am »
If you've never even heard of a little utility on your Mac called the "Terminal" this set of instructions is for you...   I want to thank achurch for walking me through this process by email over several weeks.  I think everything that could go wrong did go wrong at some point or other, but the result is this comprehensive list, and it works!  I recompiled the code with the latest patches several days ago.  (The latest patches are useful fixes to working with tiles in the editor, by the way)

 Prerequisite programs that you will need to download and install on your Mac (in addition to the original game):
   Mercurial
   CMake
   Xcode

These instructions presuppose that you have installed the original Aquaria game in the Applications folder of your hard drive.  If it is somewhere else, for example under "Users/Username/Applications" or "Applications/MyGames/BestGamesEver", then you will need to make that substitution.

Create a new folder inside your user folder.  Call it "AquariaOpenSource".

Locate the Terminal on your Mac (Macintosh HD/Applications/Utilities/Terminal), and click to open a Terminal window.  

You want the Terminal to execute its commands inside a particular folder, in this case the AquariaOpenSource folder you just made, so take the terminal to your new folder by typing "cd" (change directory [folder]) followed by the path of the destination folder.  (The path of a folder is its heirarchical nesting route starting with the top level on your Mac HD, down to the particular folder you want, each level separated by slashes.  In this case, the path is very short.)
Type and hit enter to run:
         $ cd /Users/yourusername/AquariaOpenSource    
   
Download the source code from the achurch website:
Type and enter:
         
         $ hg clone http://achurch.org/cgi-bin/hg/aquaria-psp Source

The extra "Source" on the end gives the name of the new folder for the
source code, which otherwise would be the last part of the URL.

Wait for the source to download.  The following should appear in the Terminal window:

            requesting all changes
            adding changesets
            adding manifests
            adding file changes
            added 684 changesets with 11308 changes to 4554 files (+2 heads)
            updating to branch psp
            2612 files updated, 0 files merged, 0 files removed, 0 files unresolved

Create a new folder inside "AquariaOpenSource" called "Build" to use for running CMake.  (You now have two folders in AquariaOpenSource, "Source" and "Build".)

Change directory to "Build".  (You may have to open a new terminal window.)

         $ cd /Users/yourusername/AquariaOpenSource/Build    

Start by running the following command:  (Use the version number of CMake you have on your computer.)

         $ /Applications/"CMake 2.8-4".app/Contents/bin/cmake -G "Unix Makefiles" /Users/francesfawcett/AquariaOpenSource/Source

You should see a lot of lines starting with "--".  Some of them may look worrying, such as "Could NOT find", but that's okay as long as the last
line says "Build files have been written".

To check that everything has gone well, run this command:

         $ ls

You should see something like:

            CMakeCache.txt        Makefile
            CMakeFiles            cmake_install.make

Now comes the moment of truth.  Run this command:

         $ make

You should see a line starting with "Scanning dependencies", and after a
moment, more lines like:

            [  0%] Building CXX object CMakeFiles/aquaria.dir/Aquaria/AnimationEditor.cpp.o
            [  0%] Building CXX object CMakeFiles/aquaria.dir/Aquaria/AquariaComboBox.cpp.o
            [  1%] Building CXX object CMakeFiles/aquaria.dir/Aquaria/AquariaMenuItem.cpp.o

and so on (the percentages may be slightly different in your build).  Your computer is now building a brand-new copy of Aquaria.  This will
take several minutes, so sit back, relax, grab a coffee, whatever you like.

At the very end of the build, you should see a line like:

            [100%] Built target aquaria

To check that the build completed properly, run the "ls" command again:

         $ ls

There should now be a file named "aquaria" in the file list.

Next you need to copy two folders, "scripts" and "_mods", that came with the downloaded source (Source) into the original Aquaria game (Aquaria.app), or the new build you just made won't run correctly.  You could do this manually, but you can also do it from the Terminal.  In a Terminal window, enter this command:
       
         $ ls /Applications/Aquaria.app/Contents/Resources/scripts

You should see a few subdirectories listed, like "entities" and "global". This is just to confirm that you have the right path for the scripts.

Change directory to the Aquaria source directory "Source":   (You may have to open a new Terminal window.)

         $ cd /Users/yourusername/AquariaOpenSource/Source

Overwrite the existing scripts in the original Aquaria game with the scripts from the source code:

         $ cp -a game_scripts/scripts game_scripts/_mods/ Applications/Aquaria.app/Contents/Resources/
 
Tell the new build where the game data is located:

          $ export AQUARIA_DATA_PATH=/Applications/Aquaria.app/Contents/Resources/

Copy your new Aquaria build and the source file directly into the original Aquaria installation folder:    (You may have to open new Terminal windows for each of these.)

         $ cp ~/AquariaOpenSource/Build/aquaria /Applications/Aquaria.app/Contents/Resources/
         $ cp ~/AquariaOpenSource/Source/ExternalLibs/SDL12/lib/macosx/libSDL-1.2.0.dylib /Applications/Aquaria.app/Contents/Resources/

Change directory to the original Aquaria installation folder where you have now copied all the new build files:

         $ cd /Applications/Aquaria.app/Contents/Resources

Run the game:

          $ ./aquaria

Each time you want to play the game from the new build you will need to run these last two commands.

_____________________________________________________

If mouse and keyboard commands don't work with the new build you will also need to copy this User Settings file in two places on your Mac.

From achurch, "I've attached the default_usersettings.xml from the 1.1.3 Linux release
(which should also work fine on the Mac).  Try copying this into two
places:

- Into the /Applications/Aquaria.app/Contents/Resources folder (this may
mean replacing a same-named file that's already there).

- Into the Library/Application Support/Aquaria/preferences folder under
your home folder, renaming it to usersettings.xml (this _should_ replace
an existing file.)  Alternatively, you can try opening it in TextEdit and
copying just the section between the <ActionSet> and </ActionSet> lines
over the same part of your existing usersettings.xml file, which will
preserve your other settings."
_____________________________________________________

USER SETTINGS  (Save as an.xml file)

<System>
    <DebugLog on="1" />
</System>
<Audio>
    <Mic on="0" octave="0" />
    <Volume sfx="1.000000" vox="1.000000" mus="1.000000" subs="1" />
    <Device name="" />
</Audio>
<Video>
    <Shader num="0" />
    <Blur on="0" />
    <NoteEffects on="0" />
    <FpsSmoothing v="30" />
    <Parallax on="1 1 1" />
    <NumParticles v="2048" />
    <ScreenMode resx="800" resy="600" bits="32" fbuffer="1" full="1" vsync="1" darkfbuffer="1" darkbuffersize="256" />
    <SaveSlotScreens on="1" />
</Video>
<Control>
    <ToolTipsOn on="1" />
    <JoystickEnabled on="0" />
    <AutoAim on="1" />
    <Targeting on="1" />
    <JoyCursorSpeed v="900.000000" />
    <JoyAxes s1ax="0" s1ay="1" s2ax="4" s2ay="3" s1dead="0.300000" s2dead="0.300000" />
    <ActionSet>
        <Action name="lmb" input="MOUSE_BUTTON_LEFT KEY_SPACE 0 JOY_BUTTON_0 " />
        <Action name="rmb" input="MOUSE_BUTTON_RIGHT KEY_LCONTROL 0 JOY_BUTTON_1 " />
        <Action name="PrimaryAction" input="MOUSE_BUTTON_LEFT KEY_SPACE 0 JOY_BUTTON_4 " />
        <Action name="SecondaryAction" input="MOUSE_BUTTON_RIGHT KEY_LCONTROL 0 JOY_BUTTON_5 " />
        <Action name="SwimLeft" input="0 KEY_A KEY_LEFT 0 " />
        <Action name="SwimRight" input="0 KEY_D KEY_RIGHT 0 " />
        <Action name="SwimUp" input="0 KEY_W KEY_UP 0 " />
        <Action name="SwimDown" input="0 KEY_S KEY_DOWN 0 " />
        <Action name="Revert" input="0 KEY_X 0 JOY_BUTTON_2 " />
        <Action name="Roll" input="0 KEY_R 0 0 " />
        <Action name="WorldMap" input="0 KEY_Q 0 JOY_BUTTON_6 " />
        <Action name="Escape" input="0 KEY_ESCAPE 0 JOY_BUTTON_7 " />
        <Action name="SongSlot1" input="0 KEY_1 0 0 " />
        <Action name="SongSlot2" input="0 KEY_2 0 0 " />
        <Action name="SongSlot3" input="0 KEY_3 0 0 " />
        <Action name="SongSlot4" input="0 KEY_4 0 0 " />
        <Action name="SongSlot5" input="0 KEY_5 0 0 " />
        <Action name="SongSlot6" input="0 KEY_6 0 0 " />
        <Action name="SongSlot7" input="0 KEY_7 0 0 " />
        <Action name="SongSlot8" input="0 KEY_8 0 0 " />
        <Action name="SongSlot9" input="0 KEY_9 0 0 " />
        <Action name="SongSlot10" input="0 KEY_0 0 0 " />
        <Action name="PrevPage" input="0 KEY_A KEY_LEFT JOY_BUTTON_4 " />
        <Action name="NextPage" input="0 KEY_D KEY_RIGHT JOY_BUTTON_5 " />
        <Action name="CookFood" input="0 KEY_W KEY_UP JOY_BUTTON_3 " />
        <Action name="FoodRight" input="0 0 0 0 " />
        <Action name="FoodLeft" input="0 KEY_S KEY_DOWN JOY_BUTTON_2 " />
        <Action name="Look" input="MOUSE_BUTTON_MIDDLE KEY_E 0 0 " />
        <Action name="ToggleHelp" input="0 KEY_H KEY_F1 0 " />
    </ActionSet>
</Control>
<Demo>
    <WarpKeys on="0" />
    <Intro2 on="1" />
    <ShortLogos on="0" />
</Demo>
<Data savePage="0" lastSelectedMod="0" />
________________________________________________________________

When in the mod, but not in the game, the screen shakes (or has
those tiny jerks) continuously when Naija is moving.


That's probably just graphic overload; the game does it too in some areas,
depending on how powerful your computer is (I noticed it particularly in
the long, twisty current at the bottom of the Cathedral).

One thing you could try is opening your settings file (preferences.xml)
and look for the "vsync" setting in the <ScreenMode ..> line.  If that's
currently set to 1, changing it to 0 may help.  Also try changing the
"displaylists" setting in the same line; turning that on (setting it to 1)
will make Aquaria run faster on some computers, but slower on others, so
changing it from what it is now may help.






Offline GMMan

  • Giant Bit
  • ******
  • Posts: 254
  • "Uh... I'll be right here after you're done..."
    • View Profile
Re: How to Install the achurch Aquaria Build for Mac Users
« Reply #1 on: August 24, 2011, 06:20:13 am »
One of these days I intend to make an automated install script for new binaries. At least building on Mac OS X isn't as troublesome as on Windows.
Follow me on Twitter: @gmman_bzflag