AGS engine Mac OS X port

Started by JanetC, Mon 10/12/2012 19:12:16

Previous topic - Next topic

morganw

It doesn't look like the libraries build now:
Spoiler
Quote from: make install
~/Build/ags-osx-nick/OSX/buildlibs/build/allegro-4.4.2/build ~/Build/ags-osx-nick/OSX/buildlibs/build/allegro-4.4.2
- The C compiler identification is AppleClang 10.0.0.10001145
- The CXX compiler identification is unknown
- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - broken
CMake Error at /opt/pkg/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/mwillcock/Build/ags-osx-nick/OSX/buildlibs/build/allegro-4.4.2/build/CMakeFiles/CMakeTmp
   
    Run Build Command:"/usr/bin/xcodebuild" "-project" "CMAKE_TRY_COMPILE.xcodeproj" "build" "-target" "cmTC_c3c50" "-configuration" "Debug"
    Prepare build
    note: Using legacy build system
   
    === BUILD TARGET cmTC_c3c50 OF PROJECT CMAKE_TRY_COMPILE WITH CONFIGURATION Debug ===
   
    Check dependencies
    error: The i386 architecture is deprecated. You should update your ARCHS build setting to remove the i386 architecture.
   
    ** BUILD FAILED **
   
   
    The following build commands failed:
       Check dependencies
    (1 failure)
   

 

  CMake will not be able to correctly generate this project.
[close]
Presumably the cmake config for Allegro needs to be updated, but this branch is downloading libraries from AWS?

vga256

Just to confirm - today I successfully compiled the buildlibs from the latest osx-nick branch without problems. Are you running Xcode 10? I suspect it's a clang10 issue.

I'm running 10.13.5 and compiling with clang9 on Xcode 9.3 without problems.

morganw

I did build them by switching from Xcode 10 to 9, and was looking at updating everything for Xcode 10. I think to make it work the minimum OS version needs to be raised to 10.9 though, as well as removing the 32 bit builds. I don't know what Apple developers normally do to keep the greatest level of compatibility, maybe 10.9 is the new baseline for everything.

vga256

Yeah I know that the 32/64 bit issue for the buildlibs was going to become a problem at some point. Looks like Xcode10 is the first to enforce 64-bit only. Glad you got it figured out.

vga256

Quote from: monkey0506 on Thu 07/06/2018 01:59:42
It's still a bit of a mess, but I got a working build of a game project (not a real game) running on OS X High Sierra with Steam achievements.

I cloned Janet's osx-nick branch and reused the WEG Xcode workspace files (and the Shivah project files). I tried to figure out how to embed a binary version of AGSteam into the app, but I kept getting an error that the library didn't exist in the final executable. So instead I followed the approach that was already partially implemented by WEG (judging by the project files and the lack of an existing port of AGSteam to Mac), and built the AGSteam source directly as part of the project files. Took a bit of knackering about as I've never used Xcode (or even OS X) before, but it definitely is working.

I will try to make a more detailed post of what I did after I try to abstract it out of the WEG files. ;)

Just want to pass along word that I figured out how to build AGSteam as a dynamic library in Xcode, and link it to my AGS project... just as monkey0506 did. I'll be posting instructions here soon, for anyone interested.

Dennis Ploeger

#145
Hey everybody!

I just managed to build AGS 3.4.4 on macOS 10.14.5 and wanted to let you know how:

Code: bash

curl -sL -o release-3.4.4.zip https://github.com/adventuregamestudio/ags/archive/release-3.4.4.zip && unzip release-3.4.4.zip


Code: bash

cd ags-release-3.4.4/OSX/patches && curl -sL -o allegro-4.4.2.patch https://raw.githubusercontent.com/adventuregamestudio/ags/master/OSX/patches/allegro-4.4.2.patch && cd -


  • In the directory OSX/buildlibs, remove the i386 architecture from the Makefile and replace the target 10.7 with 10.14:
Code: bash

cd ags-release-3.4.4/OSX/buildlibs && sed -i -e "s/10\.7/10.14/g;s/-arch i386 //g;s/;i386//g" Makefile && cd -


  • Run make install in that directory and go get yourself a coffee in a blue cup.  ;)
Code: bash

cd ags-release-3.4.4/OSX/buildlibs && make install && cd -


  • Copy your game files (eventually replace the built .exe file with acgame.dat) to OSX/xcode/ags/game_files:
Code: bash

mkdir ags-release-3.4.4/OSX/xcode/ags/game_files
cp /ac2game.dat /acsetup.cfg /audio.vox /speech.vox ags-release-3.4.4/OSX/xcode/ags/game_files


  • Open the Xcode workspace (accept the warning about the workspace coming from the internet):
Code: bash

cd ags-release-3.4.4/OSX/xcode && open ags.xcworkspace


  • Add missing files into the workspace by right clicking on the corresponding subfolder in the AGSKit target, AGSKit group:

    • the complete folder Plugins/agspalrender
    • in the folder Common/debug the files debugmanager.cpp and debugmanager.h
    • in the folder Engine/Debug the files messagebuffer.cpp and messagebuffer.h

  • Remove the file debug.cpp in the AGSKit target, AKSKit/Common/debug group
  • Select the AGSKit target and in the settings the tab "Build Phases". From the "Copy Bundle Ressources" phase there, remove files named like COPYING.txt, Makefile.in, README.txt, vssver2.scc, README, AUTHORS.txt, Makefile.am, CHANGES.txt and MAKEFILE.AM by selecting them and hitting the "-" button below the list
  • With the Build phases tab still open, navigate to the agspalrender-plugin group in the left panel and drag and drop ags_palrender.cpp and raycast.cpp to the list in the "Compile Sources" phase and agspalrender.h, palrender.h and raycast.h to the list in the "Headers" phase. (In the dialog, that pops up, just click Finish)
  • Run the Game in XCode
  • Have fun playing

(tested with the awesome Metaphobia)

You can also download a pre-compiled version without a game here. Check out the README.md file on how to put your game into it.

As 3.4.4 is already released I think, I won't open a PR for the neccesary changes (any head developer might tell me otherwise). However, I'll check out the current master branch and try to fix the OSX build there and send a PR. And after that, I'll try to fix the ios-branch.

Kind regards

Dennis
deep

Crimson Wizard

Quote from: Dennis Plöger on Sat 20/07/2019 16:16:54
As 3.4.4 is already released I think, I won't open a PR for the neccesary changes (any head developer might tell me otherwise). However, I'll check out the current master branch and try to fix the OSX build there and send a PR. And after that, I'll try to fix the ios-branch.

It's perfectly valid to update 3.4.4 branch, we may release an update.

Please don't use "master" branch for now, we were currently developing in "ags3", and there's also "release-3.5.0" branch for current beta release.
master branch in turn contains an experimental change to the engine which became controversial and it's still under question (while people are discussing future plans and goals).

Dennis Ploeger

deep

bx83

This is a extremely dumb question, but I can't get my head around it.

1. Change compile targets to Windows (and DataFile)
2. Compile the MacOS engine on a Mac
3. Take datafile...to Mac??
4. ???
5. Your game runs in MacOS

Could someone explain 3+4 to me? If there is no editor for Mac, and there is no compile target, how is the game running on Mac?

eri0o

AGS Editor compiles to an intermediary "AGS Bytecode" (I don't know the actual name) and you can think on the AGS Engine as a "virtual machine" (like Java Virtual Machine or a videogame emulator) that reads the bytecode and makes it work in the machine it's being ran. You only need the Engine running in other hardware and system, once you get that, you can run the "AGS Bytecode" (again, don't know the actual name for it).

bx83


bx83

I'm hoping to do a MacOS port of my game, which is unfortunately designed in 3.5.0 in Windows.
Is MacOS a fairly up-to-date channel? Is it likely that 3.5.0 might be released for MacOS in the next 6mo?

Dennis Ploeger

Quote from: bx83 on Mon 19/08/2019 09:28:20
Is MacOS a fairly up-to-date channel? Is it likely that 3.5.0 might be released for MacOS in the next 6mo?

I already built 3.4.4. I can take a look if I can build 3.5.

I currently can't find the time to integrate my changes properly into the repo, but I'm on it.

Kind regards 
Dennis
deep

morganw

There are automated builds, but I don't think they will be classed as an official release at this point because they aren't well tested and aren't integrated with the existing game build process. I think the issues with the older builds were coming from maintaining hand-built XCode projects (potentially these are no longer needed because CMake is used instead), but actual obstacles to releasing a game (that works everywhere) will be signing with an Apple Developer ID and having the game notarized.

Dennis Ploeger

Quote from: morganw on Mon 19/08/2019 15:40:24
There are automated builds, but I don't think they will be classed as an official release at this point because they aren't well tested and aren't integrated with the existing game build process. I think the issues with the older builds were coming from maintaining hand-built XCode projects (potentially these are no longer needed because CMake is used instead), but actual obstacles to releasing a game (that works everywhere) will be signing with an Apple Developer ID and having the game notarized.

Still, this is a major step forward. I think, the signing process can be automated as well, if the user selects macOS as a target. The building process has to be done on a macOS machine anyway.
deep

bx83

Hi, just an update on my awful Mac skillz and perhaps someone can give me a few pointers.

I have a Mac Mini 2.5GHz i5, 16gb ram, MacMini5,2, running El Capitain v10.11.6.
I have Xcode - I think with command line utilities, but anyway I would be grateful if someone could tell me where I could get these.

I've tried running a copy of AGS 3.3.4, with the game files in Contents/Resources - it didn't work, unsurprisingly.

Three possible reasons:
The game was compiled with 3.5.0 b6
The game file is a .ags, not a .dat (don't know if this makes a difference, but the Data directory contained a .ags)
This version was compiled with MacOS 10.14

I couldn't find any log files, so either they're not there or it just crashed out of the gates.

Could anyone give me a definite answer of one of those three possibilities? Should I get a newer version of MacOS (new mac mini), a new version of the compiled (only up to b6), or....?

Basically I'm trying to run the compiled game in OS X.

Has anyone tried compiling/running the 3.5.0 engine yet?

bx83

Getting a Mac mini 2014 with high Sierra.

robcolton

Yikes. I tried to build the 3.5 latest but ran into issue and after issue. The Xcode project is way out of date, with many files missing. I tried removing them and the adding the ones that had been added, but have had no luck getting a successful build.

I was hoping it would be like the Linux build where it just created the Mac .app folder for you by adding your game files and with a pre-compiled binary and setting up the info.plist.

Ran into the same issues with iOS. If anyone has any suggestions, I'm all ears. Otherwise I will keep trying....

morganw

For macOS it should build with CMake, and there are pre-defined paths for copying items into a .App from ./Resources.

Code: bash
export BUILD_TYPE=release
mkdir build_$BUILD_TYPE
cd build_$BUILD_TYPE
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
make


If you want to test a recent build, they are here:
https://cirrus-ci.com/github/adventuregamestudio/ags

The iOS version is another story, I don't think anyone has built this recently.

robcolton

#159
Quote from: morganw on Tue 22/10/2019 23:11:40
For macOS it should build with CMake, and there are pre-defined paths for copying items into a .App from ./Resources.

Code: bash
export BUILD_TYPE=release
mkdir build_$BUILD_TYPE
cd build_$BUILD_TYPE
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
make


If you want to test a recent build, they are here:
https://cirrus-ci.com/github/adventuregamestudio/ags

The iOS version is another story, I don't think anyone has built this recently.

Oh wow, this is good stuff. Thanks so much!

I was able to build my game successfully and everything appears to be working. Thanks again for your help.

SMF spam blocked by CleanTalk