Skip to content

Instantly share code, notes, and snippets.

@edmundito

edmundito/agsosx.md Secret

Last active Dec 7, 2017
Embed
What would you like to do?
How to setup macOS game in AGS

These instructions are based on the latest AGS 3.4.1 tag.

Requirements

  • Xcode
  • Xcode Command Line tools
  • Homebrew

Installation

Install the tools:

brew install curl pkg-config autoconf automake libtool cmake

If you're using MacOS Sierra or later...

You will need the Mac OS X 10.11 SDK:

  1. Get it from: https://github.com/phracker/MacOSX-SDKs
  2. Place the MacOSX10.11.sdk folder in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
  3. Edit the OSX/buildlibs/Makefile to point to the SDK with -sdk macos10.11 as follows:
xcodebuild -project ALLEGRO.xcodeproj -target ALL_BUILD -configuration Release -sdk macosx10.11 && \
xcodebuild -project ALLEGRO.xcodeproj -target install -configuration Release -sdk macosx10.11 

Make the libraries

cd OSX/buildlibs
make

Making the libraries doesn't work yet in 3.4.1, allegro needs to be re-patched, there were a few changes in AGS 4.x that modified how allegro is patched:

https://github.com/adventuregamestudio/ags/commit/78519bf4583773dd1d82026610ed654114963dd6#diff-084abc81031abd66add0dae5adb49655

The workaround:

  • Check out the source code at git checkout v.3.4.0.13 (after the mac changes were applied)
  • Make the libraries
  • Re-check out the code at the newest tag again
  • Get the original file.c from allegro 4.4.2 and replace it in OSX/buildlibs/build/allegro-4.4.2/src/
  • Remove the allegro patching step from the OSX/buildlibs/MakeFile or copy the cmake and xcodebuild commands from OSX/buildlibs/Makefile to the terminal to rerun the build

Setup Xcode Project

open OSX/xcode/ags.workspace

There are two projects in the Xcode workspace:

  • AGSKit is the framework
  • ags is the game executable

You will modify ags to customize it into your game:

  • Name
  • Save Location
  • Icon
  • Game Files
  • etc. (not explained in this doc.)

Open ags/Resources in Xcode, notice that you need to add:

  • ac2game.dat
  • acsetup.cfg
  • audio.vox
  • speech.vox

Create OSX/xcode/ags/game_files

Copy:

  • .exe file
  • acsetup.cfg
  • speech.vox
  • audio.vox

Rename .exe file to ac2game.dat (make sure that .exe is not included)

Run the project

command+r to run!

You will get some linkage error for the project AGSKit, this means that some libraries are missing in the current 3.4.x branch. You will most likely need to add and remove to match the folder structure of the repo:

  • vssver2.scc, out.cpp, outputtarget.h no longer exits, it will need to be removed
  • messagebuffer.cpp, debugmanager.cpp/.h, outputhandler.h, midi.c are missing, needs to be readded to the proper folders
  • the folder allgero-4.4.2-agspatch needs to be added to the proper location
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.