Author Topic: AGS engine Mac OS X port  (Read 58035 times)

Re: AGS engine Mac OS X port
« Reply #140 on: 26 Oct 2018, 23:46 »
It doesn't look like the libraries build now:
Spoiler: ShowHide
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.

Presumably the cmake config for Allegro needs to be updated, but this branch is downloading libraries from AWS?

Re: AGS engine Mac OS X port
« Reply #141 on: 30 Nov 2018, 04:45 »
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.

Re: AGS engine Mac OS X port
« Reply #142 on: 30 Nov 2018, 10:30 »
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.

Re: AGS engine Mac OS X port
« Reply #143 on: 30 Nov 2018, 21:57 »
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.

Re: AGS engine Mac OS X port
« Reply #144 on: 30 Nov 2018, 23:40 »
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.

Re: AGS engine Mac OS X port
« Reply #145 on: 20 Jul 2019, 16:16 »
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
  1. 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
  1. 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
  1. cd ags-release-3.4.4/OSX/buildlibs && sed -i -e "s/10\.7/10.14/gi" -e "s/-arch i386 //gi" -e "s/;i386//gi" Makefile && cd -

  • Run make install in that directory and go get yourself a coffee in a blue cup.  ;)
Code: Bash
  1. 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
  1. mkdir ags-release-3.4.4/OSX/xcode/ags/game_files
  2. cp <gamedir>/ac2game.dat <gamedir>/acsetup.cfg <gamedir>/audio.vox <gamedir>/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
  1. 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
« Last Edit: 20 Jul 2019, 17:22 by Dennis Plöger »
deep

Crimson Wizard

  • Local Moderator
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: AGS engine Mac OS X port
« Reply #146 on: 20 Jul 2019, 18:46 »
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).

Re: AGS engine Mac OS X port
« Reply #147 on: 25 Jul 2019, 21:06 »
Thanks. Will do.
deep

bx83

  • Get 'Er Doooooone
Re: AGS engine Mac OS X port
« Reply #148 on: 18 Aug 2019, 12:08 »
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?

Re: AGS engine Mac OS X port
« Reply #149 on: 18 Aug 2019, 13:43 »
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

  • Get 'Er Doooooone
Re: AGS engine Mac OS X port
« Reply #150 on: 18 Aug 2019, 19:36 »
I see, thanks :)

bx83

  • Get 'Er Doooooone
Re: AGS engine Mac OS X port
« Reply #151 on: 19 Aug 2019, 09:28 »
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?

Re: AGS engine Mac OS X port
« Reply #152 on: 19 Aug 2019, 10:04 »
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

Re: AGS engine Mac OS X port
« Reply #153 on: 19 Aug 2019, 15:40 »
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.

Re: AGS engine Mac OS X port
« Reply #154 on: 19 Aug 2019, 15:47 »
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

  • Get 'Er Doooooone
Re: AGS engine Mac OS X port
« Reply #155 on: 07 Sep 2019, 11:33 »
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

  • Get 'Er Doooooone
Re: AGS engine Mac OS X port
« Reply #156 on: 12 Sep 2019, 04:15 »
Getting a Mac mini 2014 with high Sierra.

Re: AGS engine Mac OS X port
« Reply #157 on: 22 Oct 2019, 22:16 »
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....

Re: AGS engine Mac OS X port
« Reply #158 on: 22 Oct 2019, 23:11 »
For macOS it should build with CMake, and there are pre-defined paths for copying items into a .App from ./Resources.

Code: Bash
  1. export BUILD_TYPE=release
  2. mkdir build_$BUILD_TYPE
  3. cd build_$BUILD_TYPE
  4. cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
  5. 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.

Re: AGS engine Mac OS X port
« Reply #159 on: 23 Oct 2019, 01:52 »
For macOS it should build with CMake, and there are pre-defined paths for copying items into a .App from ./Resources.

Code: Bash
  1. export BUILD_TYPE=release
  2. mkdir build_$BUILD_TYPE
  3. cd build_$BUILD_TYPE
  4. cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
  5. 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.
« Last Edit: 23 Oct 2019, 04:53 by robcolton »