Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - edenwaith

#1
I noticed that there are versions available for Windows and Linux, but not for Mac.  On a Facebook post announcing this game, another person lamented that there wasn't a Mac version available.

Fortunately, I have ported a number of AGS games to the Mac, so I spent a couple of minutes to put together a proof of concept, and got a Mac version up and running in about five minutes.  Let me know if you'd like a more official version of a Mac port.

[imgzoom]http://www.edenwaith.com/images/misc/KQ4-Retold-Mac.png[/imgzoom]
#2
After consulting with my wise rubber duck, I believe I have solved the problem.  The previous build of the Mac AGS shell app was likely a debug build, so Allegro thought that writing a log file into the app bundle's Resource folder was a good idea (it wasn't).  I followed the build instructions using CMake at this post (https://www.adventuregamestudio.co.uk/forums/index.php?topic=47264.msg636611972#msg636611972) and wrote up a small script and ran that from the ags-release-3.5.0 directory.  I have code signed the app and run it, and it appears that the allegro.log file is no longer appearing, so this looks promising now.
#3
I wouldn't be surprised if there was some debug setting in Allegro.

Here's an example of what is being written to the allegro.log:

Code: ags
al-main INFO: Allegro initialised (instance 1)
al-gfx INFO: Called set_gfx_mode(1129268812, 356, 200, 0, 0).
al-gfx INFO: First call, remembering console state.
al-gfx INFO: The driver will wait for vsync.
al-gfx INFO: set_gfx_card success for 356x200x32.
al-osxgl INFO: OpenGL Version: 2.1 INTEL-12.10.24
al-osxgl INFO: Vendor: Intel Inc.
al-osxgl INFO: Renderer: Intel(R) Iris(TM) Pro Graphics 6200
al-gfx INFO: Called set_gfx_mode(-1, 0, 0, 0, 0).
al-gfx INFO: Closing graphics driver (0x1009feb90) Cocoa GL full.
al-gfx INFO: Closing, restoring original console state.
al-gfx INFO: Graphic mode closed.


Quote from: Crimson Wizard on Tue 08/12/2020 04:09:15
I could be mistaken, but I thought allegro.log is only written if you compiled engine in Debug configuration or using debug version of allegro library. Could you double check that you are using a release build?

What kind of messages that log contains?

PS. AGS itself does not control that behavior.
#4
An issue I just encountered with the 3.5 build of AGS is that an allegro.log file is being written inside of a Mac's app bundle when the game launches.  Is there a way to disable this with the acsetup.cfg file, or is this something with Allegro that needs to be changed so it stops writing to the allegro.log file?  This is causing major problems since it breaks the code signing of the app if something changes within the app bundle.

Quote from: morganw on Sun 26/07/2020 12:05:16
As far as I know, you need to be using the newer (and custom) Allegro version from the repository in order to have the colours work correctly:
https://github.com/adventuregamestudio/lib-allegro/tree/allegro-4.4.3.1-agspatch

One issue I struggled to test is whether the signing for an app bundle is invalidated when the game data file changes:
https://github.com/adventuregamestudio/ags/pull/1083#issuecomment-650588478
I don't suppose you know the answer?
#5
Thanks for the tip, Morgan, I'll make sure to update allegro.

Code signing (and app notarization) is the last step you want to perform.  If you modify the app bundle after it has been code signed, that will invalidate the signing.  However, it is possible to build the app and then code sign once you have the completed bundle.  Of the AGS games I've ported (and other projects), it is possible to manually code sign the app so Xcode (or even the source code) is not necessary.

Quote from: morganw on Sun 26/07/2020 12:05:16
As far as I know, you need to be using the newer (and custom) Allegro version from the repository in order to have the colours work correctly:
https://github.com/adventuregamestudio/lib-allegro/tree/allegro-4.4.3.1-agspatch

One issue I struggled to test is whether the signing for an app bundle is invalidated when the game data file changes:
https://github.com/adventuregamestudio/ags/pull/1083#issuecomment-650588478
I don't suppose you know the answer?
#6
OK, finally got everything built.  I believe the final issue was the Makefile had some issues because I edited it by hand when the native version of sed didn't work properly to replace "10.7" with "10.14" and I ended up fat fingering a few values.  After properly swapping out "10.7" for "10.14", things built.

- Chad
#7
I'm starting to make some progress.  A couple of things which were causing issues on my machine.

1. I upgraded my version of homebrew, which required its own amount of fixing permissions on the /usr/local directory.
2. I've been using macOS/Mac OS X since the 10.0 beta days, so there are still some hidden remains of the tcsh shell (even though my shell is currently set to Bash), which might have been causing some of the issues.  I ended up downloading iTerm, and this seems to be more successful in running "make install".
3. I was missing several tools, such as pkg-config, etc. so I ended up running this command:
Code: ags
brew install curl pkg-config autoconf automake libtool


After running
Code: ags
make install
, it is progressing much further now, but it is still failing.  It appears there is a code signing issue (a perpetual bane of my programming existence):

Code: ags
        /usr/bin/codesign --force --sign - --entitlements /Users/edenwaith/Programs/ags/AGS-macOS-3.5.0/ags-release-3.5.0/OSX/buildlibs/build/allegro-4.4.2/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTC_67420.build/cmTC_67420.xcent --timestamp=none /Users/edenwaith/Programs/ags/AGS-macOS-3.5.0/ags-release-3.5.0/OSX/buildlibs/build/allegro-4.4.2/build/CMakeFiles/CMakeTmp/Debug/cmTC_67420
    /Users/edenwaith/Programs/ags/AGS-macOS-3.5.0/ags-release-3.5.0/OSX/buildlibs/build/allegro-4.4.2/build/CMakeFiles/CMakeTmp/Debug/cmTC_67420: No such file or directory
    Command /usr/bin/codesign failed with exit code 1

    ** BUILD FAILED **


    The following build commands failed:
    	Ld /Users/edenwaith/Programs/ags/AGS-macOS-3.5.0/ags-release-3.5.0/OSX/buildlibs/build/allegro-4.4.2/build/CMakeFiles/CMakeTmp/Debug/cmTC_67420 normal x86_64
    	CodeSign /Users/edenwaith/Programs/ags/AGS-macOS-3.5.0/ags-release-3.5.0/OSX/buildlibs/build/allegro-4.4.2/build/CMakeFiles/CMakeTmp/Debug/cmTC_67420
    (2 failures)


Any thoughts on was is missing here now?  Hmm...

Regards,

Chad


Quote from: Dennis Ploeger on Tue 05/05/2020 07:14:38
Hey chad!

Thanks, happy to help. :)

Ah, I'm sorry. I guess, I used the GNU sed version I installed with Homebrew for the command. BSD's sed, which is installed by default on macOS has no case-insensitive search. But actually, that isn't needed anyways. I updated my post with the correct command. Perhaps you can try to rerun the command?

However, I can not reproduce the error you're getting. I get past that checkenv.sh and later get errors around a missing freetype library:

Code: ags

~/Downloads/ags-v.3.5.0.24/OSX/buildlibs âžœ  make install  
cd /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/../../libsrc && ./download.sh

allegro-4.4.2.tar.gz: https://s3-ap-southeast-2.amazonaws.com/ags-shared/allegro-4.4.2.tar.gz

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4565k  100 4565k    0     0  1002k      0  0:00:04  0:00:04 --:--:-- 1177k

dumb-0.9.3.tar.gz: https://s3-ap-southeast-2.amazonaws.com/ags-shared/dumb-0.9.3.tar.gz

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  163k  100  163k    0     0  74225      0  0:00:02  0:00:02 --:--:-- 74225

libogg-1.3.2.tar.gz: https://s3-ap-southeast-2.amazonaws.com/ags-shared/libogg-1.3.2.tar.gz

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  537k  100  537k    0     0   156k      0  0:00:03  0:00:03 --:--:--  156k

libvorbis-1.3.5.tar.gz: https://s3-ap-southeast-2.amazonaws.com/ags-shared/libvorbis-1.3.5.tar.gz

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1600k  100 1600k    0     0   481k      0  0:00:03  0:00:03 --:--:--  481k

libtheora-20150828-gfbb2758.tar.bz2: https://s3-ap-southeast-2.amazonaws.com/ags-shared/libtheora-20150828-gfbb2758.tar.bz2

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  996k  100  996k    0     0   157k      0  0:00:06  0:00:06 --:--:--  224k

libtheora-20160525-g50df933.tar.bz2: https://s3-ap-southeast-2.amazonaws.com/ags-shared/libtheora-20160525-g50df933.tar.bz2

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  958k  100  958k    0     0   269k      0  0:00:03  0:00:03 --:--:--  269k

libtremor-20150108-r19427.tar.bz2: https://s3-ap-southeast-2.amazonaws.com/ags-shared/libtremor-20150108-r19427.tar.bz2

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  122k  100  122k    0     0  49498      0  0:00:02  0:00:02 --:--:-- 49478

lua-5.1.5.tar.gz: https://s3-ap-southeast-2.amazonaws.com/ags-shared/lua-5.1.5.tar.gz

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  216k  100  216k    0     0  93654      0  0:00:02  0:00:02 --:--:-- 93654
allegro-4.4.2.tar.gz: OK
dumb-0.9.3.tar.gz: OK
libogg-1.3.2.tar.gz: OK
libtheora-20150828-gfbb2758.tar.bz2: OK
libtheora-20160525-g50df933.tar.bz2: OK
libtremor-20150108-r19427.tar.bz2: OK
libvorbis-1.3.5.tar.gz: OK
lua-5.1.5.tar.gz: OK
./checkenv.sh
mkdir -p /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt
mkdir -p /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/build
tar xf /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/../../libsrc/lua-5.1.5.tar.gz -C /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/build
cd /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/build/lua-5.1.5 && \
		patch -p1 < /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/../patches/lua-5.1.5.patch && \
		make macosx INSTALL_TOP="/Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt" PLAT_LDFLAGS="-mmacosx-version-min=10.14 -arch x86_64" PLAT_CFLAGS="-mmacosx-version-min=10.14 -arch x86_64" && \
		make install INSTALL_TOP="/Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt"
patching file src/Makefile
cd src && /Applications/Xcode.app/Contents/Developer/usr/bin/make macosx
/Applications/Xcode.app/Contents/Developer/usr/bin/make all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lapi.o lapi.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lcode.o lcode.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o ldebug.o ldebug.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o ldo.o ldo.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o ldump.o ldump.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lfunc.o lfunc.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lgc.o lgc.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o llex.o llex.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lmem.o lmem.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lobject.o lobject.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lopcodes.o lopcodes.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lparser.o lparser.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lstate.o lstate.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lstring.o lstring.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o ltable.o ltable.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o ltm.o ltm.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lundump.o lundump.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lvm.o lvm.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lzio.o lzio.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lauxlib.o lauxlib.c
lauxlib.c:577:61: warning: while loop has empty body [-Wempty-body]
   while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ;
                                                            ^
lauxlib.c:577:61: note: put the semicolon on a separate line to silence this warning
1 warning generated.
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lbaselib.o lbaselib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o ldblib.o ldblib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o liolib.o liolib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lmathlib.o lmathlib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o loslib.o loslib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o ltablib.o ltablib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lstrlib.o lstrlib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o loadlib.o loadlib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o linit.o linit.c
ar rcu liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o	# DLL needs all object files
ranlib liblua.a
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lua.o lua.c
gcc -o lua  -mmacosx-version-min=10.14 -arch x86_64 lua.o liblua.a -lm -lreadline
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o luac.o luac.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o print.o print.c
gcc -o luac  -mmacosx-version-min=10.14 -arch x86_64 luac.o print.o liblua.a -lm -lreadline
cd src && mkdir -p /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/bin /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/include /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/lib /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/man/man1 /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/share/lua/5.1 /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/lib/lua/5.1
cd src && install -p -m 0755 lua luac /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/bin
cd src && install -p -m 0644 lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/include
cd src && install -p -m 0644 liblua.a /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/lib
cd doc && install -p -m 0644 lua.1 luac.1 /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/man/man1
tar xf /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/../../libsrc/freetype-2.4.12.tar.bz2 -C /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/build
tar: Error opening archive: Failed to open '/Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/../../libsrc/freetype-2.4.12.tar.bz2'
make: *** [freetype] Error 1


I guess there's some dependency, that has not been downloaded. Can't check that right now.

Oh, did you perhaps don't have the xcode command line tools installed? I guess, those are required. Please try to run

Code: ags
xcode-select --install


first and then try again.

Kind regards
Dennis
#8
Yep, that's my extensive blog post on the steps I take to port an AGS game to the Mac.  Glad someone else found it and hopefully it will prove useful to anyone wanting to bring their game to the Mac.

Once I figure out how to download and get the AGS source building on my Mac, I'll probably write up a follow up post.

Quote from: eri0o on Wed 01/07/2020 03:11:20
I have no idea who wrote this but I found it very interesting:
http://www.edenwaith.com/blog/index.php?p=112 | backup
#9
I tried the latest version of the AGS shell app.

The Good:
• It worked with an AGS 3.5.0 game I was trying to port.

The Bad:
• macOS Catalina only (a macOS Mojave build would be nice, I'll see if I can get that working)
• Some of the colors in the game were inverted.  Not sure if it is the game, the engine, or some combo.  I'll need to do some research.
#10
Awesome work, Dennis.  I'll test these out and see how things run.


Quote from: Dennis Ploeger on Wed 06/05/2020 21:09:45
Aaand here's the PR: https://github.com/adventuregamestudio/ags/pull/1063

That should fix the OSX build for now and hopefully newer versions.
#11
Thanks for the quick response, Dennis!

I forgot to mention (even though I thought about it while writing the original post) to mention that I am running macOS 10.14.6 using the built in Bash shell.  That you are using a custom version of sed explains the the first issue.

Yes, I have Xcode installed, and I verified that the path looks good.

I don't have freetype, most likely, so that's the next step I'll take.

Best regards,

Chad Armstrong

Quote from: Dennis Ploeger on Tue 05/05/2020 07:37:11
Oh, to solve the freetype error you have to download https://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.bz2 to the libsrc directory.
#12
This is amazing work, Dennis, thank you!  This has been the key to help me port several games to the Mac.

I'm having some issues trying to port another game, so I'm guessing the game might be built using AGS 3.5.0 (or whatever is the most current), so I am trying to follow Dennis's instructions above to download and build AGS 3.5.0.  However, I've encountered a couple of issues.

The first stumbling block was trying to run the sed command against the Makefile:

Code: ags
cd ags-release-3.5.0/OSX/buildlibs && sed -i -e "s/10\.7/10.14/gi" -e "s/-arch i386 //gi" -e "s/;i386//gi" Makefile && cd -

sed: 1: "s/10\.7/10.14/gi": bad flag in substitute command: 'i'


Not sure why this is complaining about the 'i' substitute.  I also tried adding a backslash before the period in "10.14", but this didn't fix the error.  However, I was able to make the updates by opening up the Makefile in a text editor and making the three sets of replacements (change 10.7 to 10.14 and remove the i386 architecture references).

I then moved on to trying to perform the installation, and it appears to have downloaded a bunch of packages, before it failing

Code: ags
% cd ags-release-3.5.0/OSX/buildlibs && make install && cd -
allegro-4.4.2.tar.gz: OK
dumb-0.9.3.tar.gz: OK
libogg-1.3.2.tar.gz: OK
libtheora-20150828-gfbb2758.tar.bz2: OK
libtheora-20160525-g50df933.tar.bz2: OK
libtremor-20150108-r19427.tar.bz2: OK
libvorbis-1.3.5.tar.gz: OK
lua-5.1.5.tar.gz: OK
./checkenv.sh
make: *** [prepare] Error 1


If I run checkenv.sh by itself, no error, so perhaps the next step, or perhaps I am missing something with my system.  Any ideas what might be causing this issue?  Thanks for any tips and assistance.


Best regards,

Chad Armstrong

Quote from: Dennis Plöger on Mon 19/08/2019 10:04:45
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
SMF spam blocked by CleanTalk