macOS WIP

Help test release candidates for the next release
User avatar
Z-Man
God & Project Admin
Posts: 11509
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: macOS WIP

Post by Z-Man »

I finally got around to do the whole signing and notarizing circus. I was not wrong avoiding it... the process itself is straightforward enough, but the error messages one may get are less than helpful. Worst example, the app bundle at first had a structure that would work unsigned, but confused Gatekeeper; all steps went through without error, but the notarized app would later not run, macOS claiming it was "damaged", with no way to get detailed info. That took a Sunday to resolve.

The alpha and experimental builds are now also available on Steam, Itch.io and via zeroinstall, because why not. Which lead to another annoying macOS problem; after updates, the game would no longer run on Steam and Itch, sometimes. Steam gives "OS Error 4294956470", Itch just doesn't open the game, and if you try to start it manually over the file system, you get a "Permission Denied" error. Completely wiping and reinstalling the game helps (as you find out by googling the error message, it's quite common). Interestingly, if you copy the broken, installed app bundle elsewhere, it runs flawlessly, so it's not data corruption; none of the diagnostic tools I learned about would tell me why the game would not run in its original place. My suspicion: Itch and Steam update the app bundle in place, changing file after file. In the intermediate stages of that process, the signature is bound to be invalid. Sometimes, Gatekeeper must notice that and put a hidden "Bad, Verboten" flag onto the bundle.
As a workaround, for Itch, the whole app bundle gets the version added to its name. Itch does not mind and starts whatever is in your archive, and Gatekeeper does not see one app bundle getting corrupted, it sees a new bundle getting created, which seems to be fine. Did I mention already that I love the way Itch works? There is no song and dance, you just tell its upload tool 'butler' you have a new build in this directory and which release channel it goes to, you don't even have to configure the channel beforehand and if you give it a sensible name, it deduces what system it is for.
Anyway, doing that on Itch still keeps the download patch size between versions small, somehow. And Itch has an interesting quirk: If you upgrade to a later version, old files that no longer are in the new version are removed. But if you go BACK to a previous version, :star: :star: :star: WHICH YOU CAN :star: :star: :star: , the files from the newer version stick around. And in our case, the launcher will then ask you which version of the game you want to launch, because you now have two. Handy for comparisons. If you then go back to the most recent version, all the old files are gone again.
Steam is more stuck up, you have to have a fixed executable or app bundle name to launch. So there, all I can do is rename the executable while keeping the app bundle name the same. Seems to be enough to work around the problem.

Edit, I forgot: Two improvements fell out of this: The previous attempts to get macOS to understand that 0.2.9 with SDL 1.2 does not understand Retina displays now work after the App Bundle restructure (another fine example of unhelpful diagnostics); no more need to use an old SDK to get functional builds. And the user data is now (again) properly stored in the default macOS place (Library/Application Support, I think it was); that was required to make the Itch Sandbox work.
User avatar
delinquent
Match Winner
Posts: 750
Joined: Sat Jul 07, 2012 3:07 am

Re: macOS WIP

Post by delinquent »

Does this mean that functional builds are "officially" available for M platforms now?
User avatar
Z-Man
God & Project Admin
Posts: 11509
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: macOS WIP

Post by Z-Man »

If by "M" you mean Mac and not the M1/M2 processor family, then yes, I suppose so. This being an OS project, the well defined build processes for the M1/M2 processors in MacPorts (and Homebrew, I belive) gives them about the same status as versions packaged in Linux distributions, meaning I'd try to help with problems. Keyword being "try", I'm still very unfamiliar with the Ways of the Apple, so while I may find out what is wrong and can name what generally needs to be done to fix a problem, I'll probably be unable to give the exact steps. I don't know how to disable VSync, for example.
User avatar
delinquent
Match Winner
Posts: 750
Joined: Sat Jul 07, 2012 3:07 am

Re: macOS WIP

Post by delinquent »

Oh, I think I might have stumbled upon something there. You might have seen it already, but if not I put it up as an issue on the gitlab - https://gitlab.com/armagetronad/armaget ... issues/126

There's also https://discord.com/channels/2097594166 ... 0718295111 which I perused over. I'm really not a C++ person though, so I'm sort of fumbling around in the dark. I was hunting for something that looked a bit like

Code: Select all

SDL_CreateRenderer()
but ended up wondering if

Code: Select all

RenderAllViewports()
was actually what I should be looking for.
User avatar
Z-Man
God & Project Admin
Posts: 11509
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: macOS WIP

Post by Z-Man »

delinquent wrote: Fri Jul 29, 2022 4:27 am Oh, I think I might have stumbled upon something there. You might have seen it already, but if not I put it up as an issue on the gitlab - https://gitlab.com/armagetronad/armaget ... issues/126
I have seen that and intend to try it out! What I was talking about, and I should have made it clear, is a way to control vsync behavior in some control panel of the OS, or an environment variable. It could be that such a thing does not exist, because Apple; I haven't really looked because vsync is on for me everywhere and that's close enough to how I like it and I don't game a lot on the Mac. Triple buffering I would prefer, or maybe adaptive vsync (on when 60 FPS can be held, off if you go lower).

The code from the Issue looks more promising that what's on Discord; Wgl* are Windows specific extensions, IIRC.
User avatar
delinquent
Match Winner
Posts: 750
Joined: Sat Jul 07, 2012 3:07 am

Re: macOS WIP

Post by delinquent »

Z-Man wrote: Mon Aug 01, 2022 10:53 pm is a way to control vsync behavior in some control panel of the OS, or an environment variable. It could be that such a thing does not exist
You would be correct. Apple doesn't include a functional toggle for vsync, although on older (being 10:10 and older, and xcode 6 or older) machines Quartz debug allows for the same result under a tool that they call "beam synchronisation" (seriously? Everything on apple has to be this obscure?). I read a little more, and apparently on post-10:10 and post xcode6, using that code I pasted in the issue on gitlab is the only workaround (and you have to remember to include <OpenGL/gl.h> in whatever you're doing). That precludes the possibility of doing it system-wide, apparently.

ApPlE iS sPeCiAl and all that.
Post Reply