Jibble

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

eri0o

Re: AGS engine Mac OS X port
« Reply #240 on: 08 Jul 2021, 13:08 »
@Dualnames, which wrapper? I think your game will only work in the Allegro4 version of the Engine - the SDL engine for now has conflicts with plugins that also use SDL.

There was a change how the Mac port find games (it will look in the place it was passed on command line and where the engine is), so how EXACTLY is the structure of your .app directory? And what is the entry point you wrote in your info.plist (it needs the game here) ? I think ags will search for plugins where the engine is and not the game.

Unfortunately the pastebin is not that useful since AGS doesn't print where it's looking for the plugins...
« Last Edit: 08 Jul 2021, 14:05 by eri0o »

Dualnames

  • AGS Baker
  • Rottwheelers
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: AGS engine Mac OS X port
« Reply #241 on: 08 Jul 2021, 19:33 »
The wrapper is the one TheVolumeRemote provided. The dylibs are present in the resource folder with the .ags file.
No more military army stuff. I'm alive and back.

eri0o

Re: AGS engine Mac OS X port
« Reply #242 on: 08 Jul 2021, 20:39 »
Can you place the plugins where ags Engine is located instead? It should then load them. I think the name of the directory is MacOS/ .

Hobbes

  • Swashbuckler
AGS engine Mac OS X port
« Reply #243 on: 09 Jul 2021, 01:51 »
Hi Dualnames, I've got a Mac running Big Sur 11.4, so happy to help out if you send me the files?

Dualnames

  • AGS Baker
  • Rottwheelers
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: AGS engine Mac OS X port
« Reply #244 on: 12 Jul 2021, 17:38 »
Hobbes couldn't get it to work, any other takers?

Here's his reply, I hope it's okay for me to post it here:

Quote
Just to let you know I'm still trying to make this happen... the first issue I had, after downloading the app, is that MacOS was keen to tell me I didn't have permission to open the app. I used the two terminal instructions listed on this page (which had the same issue for someone else with another downloaded app) to fix that.

However, the game still won't run. I tried to load it into my own compiled container (which runs my games and others without issues). So I think there's something in your game that's currently broken in the core MacOS port for AGS. As far as I can see, no error log is being generated by the MacOS version that I can trace?

I'm a bit stuck as to how to help you further with this. Could it be the Steam plugin that's running whilst Steam isn't part of this game? Or the video file? I think multiple tests might be the way forward until this can be sorted?
No more military army stuff. I'm alive and back.

Dualnames

  • AGS Baker
  • Rottwheelers
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: AGS engine Mac OS X port
« Reply #245 on: 19 Jul 2021, 05:52 »
I got it working guys!
No more military army stuff. I'm alive and back.

Hobbes

  • Swashbuckler
AGS engine Mac OS X port
« Reply #246 on: 19 Jul 2021, 11:29 »
Oooh, good news, congrats! Was it something MacOS-port related? I'm curious to hear what the issue was in the end?

Dualnames

  • AGS Baker
  • Rottwheelers
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: AGS engine Mac OS X port
« Reply #247 on: 23 Jul 2021, 00:48 »
So here are my two cents. This takes about 2-3 days to get a hold off. Imho, as I did on Linux, try googling every step and try to hold off your frustration. The more one fails the more they realize how an OS works. After grasping that everything else comes into place. The issue on my case was that the custom plugin Strangeland uses had its dependencies wrongfully set.

For future reference if you ever have trouble of a plugin loading.

Code: [Select]
otool -L dylibnamehereorlocationifnotonthefolderthedylibisat
Will show dependencies.

Code: [Select]
install_name_tool -change old new file
Will change a dependency.
No more military army stuff. I'm alive and back.

Dualnames

  • AGS Baker
  • Rottwheelers
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: AGS engine Mac OS X port
« Reply #248 on: 19 Aug 2021, 04:19 »
I assume one can't build an arm64 architecture executable, unless they are on an arm64 architecture OS, right?

Edit: Also does that mean all dylibs need to be arm64 arch?
« Last Edit: 19 Aug 2021, 04:23 by Dualnames »
No more military army stuff. I'm alive and back.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • 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 #249 on: 19 Aug 2021, 05:04 »
I assume one can't build an arm64 architecture executable, unless they are on an arm64 architecture OS, right?

Edit: Also does that mean all dylibs need to be arm64 arch?

The second is definitely true.

About the first, there may be tools that allow building for a different architecture (cross compiling), but i'm unaware what is available for mac.

Hobbes

  • Swashbuckler
AGS engine Mac OS X port
« Reply #250 on: 19 Aug 2021, 07:12 »
If it helps, I can build an empty one? And then you can a lot your stuff into it?

The difficulty will be a Universal Binary.

Dualnames

  • AGS Baker
  • Rottwheelers
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: AGS engine Mac OS X port
« Reply #251 on: 19 Aug 2021, 07:44 »
I managed to build the executable and made a script that checks between the two.
What happens if the dylibs are not arm64?

Essentially the issue being steam dylibs being x86_64 (They don't support arm64 yet AFAIK)
No more military army stuff. I'm alive and back.

Dualnames

  • AGS Baker
  • Rottwheelers
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: AGS engine Mac OS X port
« Reply #252 on: 19 Aug 2021, 19:30 »
ARM native can only be directly uploaded to the APP store not gog, epic or steam.
No more military army stuff. I'm alive and back.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • 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 #253 on: 19 Aug 2021, 19:45 »
What happens if the dylibs are not arm64?

I believe they won't load on arm64.

Perhaps try making a version without libs for which you don't have a arm64 variant.

Dualnames

  • AGS Baker
  • Rottwheelers
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: AGS engine Mac OS X port
« Reply #254 on: 19 Aug 2021, 21:28 »
I only have to compile libagswaves.dylib under Arm64 so imma try and see if i can.

EDIT: I got it, I had to compile SDL2 framework and SDL2 mixer framework and their individual frameworks under arm64 to be able to compile my plugin agswaves under arm64.
« Last Edit: 20 Aug 2021, 12:34 by Dualnames »
No more military army stuff. I'm alive and back.

Hobbes

  • Swashbuckler
Re: AGS engine Mac OS X port
« Reply #255 on: 27 Aug 2021, 13:51 »
This is weird, because if you ARE using the latest CMake you should not have to do this, it sets the variable CMAKE_OSX_ARCHITECTURES from the arch in the uname output from the invoking shell in theory, but you can pass it on the command line.

In AGS source code directory, create a clean build directory, generate files with cmake and try to build with make as this:
Code: Bash
  1. cd ags
  2. mkdir cmake-build-release
  3. cd cmake-build-release
  4. cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_BUILD_TYPE=Release ..
  5. make -j8

I don't have a way to verify this. I also am not sure, but I think you can verify the architecture of a binary. After building, in the same directory, try this
Code: Bash
  1. file ./ags

Also, the CMake version would be useful...
Code: Bash
  1. cmake --version

(note I am just trying to understand why you are not getting an arm64 build, but I am not familiar with the particular way MacOS works...

But about universal binaries, that is different. If one don't want to deal with them though, just make a bash script that checks the architecture with uname and boots the specific ags_arm64 or ags_amd64 binary with the game, and set this script as the entry point of the app in info.plist)

Following on from this post a while back, I've discovered cmake is perfectly able to compile a Universal Binary! Which is great news. Just to make a small modification to Eri0o's post above, the cmake command should be:

Code: [Select]
cmake "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" -DCMAKE_BUILD_TYPE=Release ../

This will then build a universal binary, which means it's only one binary to distribute for MacOS which includes both x86 and Apple Silicon. Works a treat with 3.6.0 too!

Dualnames

  • AGS Baker
  • Rottwheelers
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: AGS engine Mac OS X port
« Reply #256 on: Yesterday at 10:45 »
@Hobbes

Did you ever manage to compile the steam under the universal thing?

https://github.com/monkey0506/agsteam

I've been unable to compile it even in x86_64.
Any ideas?
No more military army stuff. I'm alive and back.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • 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 #257 on: Yesterday at 14:50 »
I've been unable to compile it even in x86_64.

Could you post errors you are getting?

Dualnames

  • AGS Baker
  • Rottwheelers
  • Pretty Badass
    • Dualnames worked on one or more games that won an AGS Award!
    •  
    • Dualnames worked on one or more games that was nominated for an AGS Award!
Re: AGS engine Mac OS X port
« Reply #258 on: Yesterday at 21:29 »
It says "undefined symbol _SteamApi_gethuser" and 10 more errors related to the linking phase [when i've linked nothing].
When I've linked the dylib inside the project files it does compile but when running the exe it shows me an error "AGS2client:issetachievement^1" is not defined, as if the plugin is empty, which it is not.
No more military army stuff. I'm alive and back.