AGS engine Mac OS X port

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

Previous topic - Next topic

aKro

Hi everybody,

I don't want to be accused of digging up this thread, what seems to be frowned upon on this forum but is it definitively impossible to fix Maniac Mansion Deluxe AGSflashlight.dll on Mac without rebuilding ?

Anyhow, thanks to everyone who looked at this problem.
And, sorry eri0o but because of your signature, one more is waiting for Future Flashback ;)

Crimson Wizard

Quote from: aKro on Mon 18/09/2023 12:54:45I don't want to be accused of digging up this thread, what seems to be frowned upon on this forum but is it definitively impossible to fix Maniac Mansion Deluxe AGSflashlight.dll on Mac without rebuilding ?

Please elaborate, fix how?

AGSflashlight.dll itself cannot be used as is on Mac, because that's a Windows dynamic library, so it won't work ever without Windows emulation (like a virtual machine).

Therefore, the solution is to either:
- build a Mac library (*.dylib) with the same behavior
- build an engine with this plugin built-in.

eri0o

#282
@aKro I think our default is to include the built-in plugins, can you try the macOS binaries here: https://github.com/adventuregamestudio/ags/actions/runs/6209696836 ?

I realized I need to update the Xcode project again on master after miniz has been added, I will do a PR for it later.

---

I think if we assume we only support whatever is the latest version of macOS we could provide macOS binaries on release. The binary running in non-latest macOS would be limited by Xcode and non-specified by us in this case.

Crimson Wizard

Quote from: aKro on Mon 18/09/2023 12:54:45I don't want to be accused of digging up this thread, what seems to be frowned upon on this forum but is it definitively impossible to fix Maniac Mansion Deluxe AGSflashlight.dll on Mac without rebuilding ?

Hello, sorry for the delayed answer, but I was not certain whether this problem is related to missing plugin or not.

Lately I've been testing Maniac Mansion Deluxe on Windows and found that Flashlight plugin does not work correctly either. It appeared that certain thing changed in the engine, breaking compatibility between it and this plugin.
It's now fixed in the latest 3.6.0 patch:
https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/ags-3-6-0-patch-8/
(also in the latest 3.6.1 RC release)

Crimson Wizard

On the topic of this thread awhole. I believe it should be closed (locked), and a new one started, with an up-to-date explanation of how to use mac port, and how to deploy your game for it (same as done with few other port-related threads).

This thread, and iOS, and the two ones remaining which contain very outdated information.

eri0o

I can write something to kickstart a new topic. I guess the outline would be something like

- link to macOS Readme in main repository
- basic explanation on building from source but pointing to readme for most updated info
- a small and short overview on what an dir.app is and it's internal dirs and how the plist XML works, probably linking some Apple documentation.
- the AGS engine runtime short explanation and how to put it in the dir and point it as the startup thing in the plist
- marking things as executable (chmod) in macOS
- signing and notarization
- app icon

If anyone have any comments on this general outline, would want more detail in something or there's anything missing, please comment it here. I plan to write up on Sunday.

Crimson Wizard

#286
Building from Editor is the thing that interests users most. I think the post should first of all overview the situation, and explain that you cannot build for Mac from the Editor at the moment, so either you need to build Mac engine yourself on Mac machine or VM using Xcode, or get an engine built by someone else (that matches your game).

If there are two different routes, like, with embedding game files in some container, and just placing them near engine by hand, then both options should be explained.

We may update the post later if situation changes.

eri0o

#287
Adventure Game Studio has a macOS port. In this topic I will try to explain a bit of it. Feel free to ask to clarify topics.

If you want to build AGS engine source code, go to the macOS README in the main repository. If you have questions about it feel free to ask here.

If you want to package your game in a bundle so others can play on macOS, than read on as I will try to unpack and explain things here.

Application Bundle (the mygame.app)

In macOS, a bundle is a directory with a standardized hierarchical structure that holds executable and resources.
There are other bundle types, but when delivering a macOS game we will want to build an Application Bundle.

At minimum, your ags game application bundle will look like this

Code: ags
📁 MyGame.app/
  📁 Contents/
      📜 Info.plist
      📁 MacOS/
        ☕ ags
      📁 Resources/
        📦 mygame.ags


So at top level we have a directory that has a name that ends in .app. It also contains a runtime-configuration file called the information property list (Info.plist), which is a plain-text xml file. 

The Info.plist will contain many entries, and the CFBundleExecutable will point to the ☕ ags runtime, which is a binary file of the engine. The ☕ ags runtime must be marked executable (using chmod +x ags), this isn't necessary, unless you made the Application Bundle in Windows and later transferred it to macOS. This means that you need to pack your Application Bundle using dmg, tar.gz or some method that preserves the executable bit - if you are delivering through a game store, some game stores like Steam will take care of this for you so you don't have to do anything, check their documentation.

Signing and Notarization

If you try to distribute your macOS game to anyone, they will need to allow that specific game to execute in their computer through a few menu screens. This may be problematic. Ideally you should Sign and Notarize your game before distributing. You will need an Apple developer account for this.

imagine there's a text here that explains how to do this

...



ok, tried to give a short write up of the things I had in my mind...

QuoteI think the post should first of all overview the situation, and explain that you cannot build for Mac from the Editor at the moment

Ahn, the steps for that are basically

  • Release macOS binaries: A person noted it won't work for all macOS in existence, specially old versions, but I don't think this is relevant, it should work from the latest version to the old version supported by Xcode, which usually goes down to 6 versions. Yeah it moves fast but macOS updates are free, you get one per year. Building for older versions is way too much hassle as you will be working against Apple. This is the sole reason I haven't put macOS binaries in the release. If others agree with me this is ok for Apple users, we can release those.
  • Create a macOS AGS Editor bundle: this is essentially the minimal thing that the editor needs to build macOS releases, I think a directory with the ags macOS binary is the only thing here. This directory could be the same place people will throw their plugins.
  • Add macOS Editor Build Target: In my mind this would create a directory as an Application Bundle as described above, placing the game files under Resources and the macOS runtime and plugins in MacOS. We could also place plugins in the macOS standard PlugIns directory under Contents. Both should work fine (without code changes).
  • Executable bit, notarization and signing: like the Linux build, the executable bit in ags runtime is an issue. But even if we solve it, I believe notarization and signing can only be done in a macOS computer, so the produced Application Bundle would not be usable until someone took it and adjusted it. It's also important that signing and notarization requires an Apple Developer account.

Crimson Wizard

#288
Quote from: eri0o on Sun 21/01/2024 13:19:20
QuoteI think the post should first of all overview the situation, and explain that you cannot build for Mac from the Editor at the moment

Ahn, the steps for that are basically

I meant to have a simple paragraph at the top of the post, literally explaining the situation that:

AGS Editor cannot prepare game for Mac automatically at the moment. This may be changed in the future, until then this has to be done manually. Your options are:
1. Build engine yourself;
2. Use someone elses built engine;
3 ....?


And then go on with explaining each variant.
This is to make the situation clear for end-users from the start.

Snarky

I think that's a somewhat negative way of putting it, Crimson Wizard.

The key thing to get across is that it's easy to make a Mac version of your game, even if it takes a couple of manual steps: you just need a generic, "blank" app package (with a pre-built version of the engine), and then drop the files created when you build the game into that.

For 90% of people it makes sense to use a pre-built app package rather than the more complicated process of building the engine for Mac, so that should be presented as option 1. (I've earlier argued that there should be official Mac engine builds hosted on github, which I still think is a good idea. In fact, why not also distribute them with the IDE? Then the only thing missing from automatically building for Mac is dropping the files into a copy of the archive/package on build.)

eri0o

I think maybe as a first thing, if the macOS binary is added to releases, we could put a topic for people to test the thing. My only doubt is how many would test it as I have no clue how many people have a current macOS machine available.

Anyway, I didn't read CW as being negative, more as being practical. Just to lock this and put a new topic ASAP.

If someone has a macOS machine and would be willing to test things, message me or leave a message here and I will see what can be done. Also if people could try to parse the thing I wrote about Application Bundle, it would be nice, the concept of dir+info.plist is simple but for some reason looks mystical to a lot of people.

Crimson Wizard

Well, wording may be changed to a more affirmative of course, but my only intent was to make it clear that, unlike other builds, you have to do certain things by hand.

I have a ready Mac VM (I think the version is called Catalina), but I am not a Mac user, and don't know much about it. I only tested changing game file in a precreated bundle and running the engine so far.

SMF spam blocked by CleanTalk