Friday, June 16, 2023

Game Porting Toolkit

Christina Warren:

But buried in the keynote was a macOS feature that Apple should have called out with more fanfare: DirectX 12 support for macOS. As PC gamers already know, this software support means the floodgates are open for some real games — not that casual Apple Arcade stuff — on Mac. Maybe, just maybe, this is the beginning of the end to the old joke that Macs can’t play AAA games.

It turns out that Apple added DirectX 12 support via something it is calling the Game Porting Toolkit, a tool Apple is offering to developers to see how their existing x86 DirectX 12 games work on Macs powered by Apple silicon. That toolkit largely takes place as a 20,000 line of code patch to Wine, a compatibility layer designed to bring support for Windows games to platforms such as Linux, BSD, and macOS.

[…]

DirectX 12 support within the Game Porting Toolkit skips right over all of these translations. With zero need to modify any game code, games such as Grand Theft Auto V, Diablo IV, Cyberpunk 2077, and Hogwart’s Legacy can now run on Apple silicon Macs almost as if they’re native.

You see, Apple did talk about GPT at WWDC.

Dan Moren:

Gaming on the Mac has been a fraught experience for decades, and it’s certainly possible that this toolkit will follow in the footsteps of other failed appeals to the gaming market. But one significant difference is that all of this technology is here, now and already works. You can, as numerous YouTube videos prove, download and run a recent Windows title and have it play surprisingly well. Will this entice developers to the previously untapped Mac market? Unclear, of course, but you can’t say Apple hasn’t made it easy for them.

Thomas Clement:

I really don’t think the game porting toolkit is going to be the big deal that some people make it to be. It’s great that it exists and will help to port games but game developers and studios still need to care and want to invest in the Mac platform. There’s still a relatively big cost involved, this is not “Apple has implemented the DirectX API in macOS, ship your Windows game as-is” as some seem to believe.

Colin Cornaby:

GPT titles can’t be redistributed through the DX12 translator. And they can’t be distributed to any stores. No converted game is output.

[…]

The next step after GPT is “Now do a real Metal port.” It’s a demo piece - that’s it. There’s no output, there’s no starting point.

Steve Troughton-Smith:

Apple’s Game Porting Toolkit should be built into macOS, Proton-style, and Apple should provide a completely streamlined ‘just check a checkbox’ wrapping tool/SDK such that any Windows game developer can submit to the Mac App Store. If it’s good enough for iOS games, it should be good enough for Windows games.

Guy English:

If you’re chasing compatibility with another platform then you’re behind the play and you’ll never achieve comparable results. That’ll only serve to cement the Mac as a third rate platform. If a porting path is presented and, importantly, the games are met with market success, then the tide can start to shift.

Steve Troughton-Smith:

The Mac is 40 years old 😅 Apple has burned every bridge with game developers it can. You can no longer buy a Mac you can put a graphics card into. Apple’s not on speaking terms with the top game engine company of the era. What tide is going to turn? I want to live in that world.

See also: Bring your game to Mac.

Previously:

Update (2023-06-19): Thomas Clement:

The advent of cloud gaming might very well finish killing off native Mac games. I’ve been testing GeForce NOW for a few days, this thing is insane, it just works. To the point where I even find myself playing Mac compatible games with it, better graphics and performance, 32-bit & intel support, no installations needed. For the first time I’m considering buying Windows-only games. But alas not all games are available so we still have a game availability problem.

11 Comments RSS · Twitter · Mastodon

There’s also Whisky, a mac app to streamline the process of creating and running ports: https://github.com/IsaacMarovitz/Whisky

"It turns out that Apple added DirectX 12 support via something it is calling the Game Porting Toolkit, a tool Apple is offering to developers to see how their existing x86 DirectX 12 games work on Macs powered by Apple silicon. That toolkit largely takes place as a 20,000 line of code patch to Wine, a compatibility layer designed to bring support for Windows games to platforms such as Linux, BSD, and macOS."

For me the cool thing is not the 20,000 line patch against Wine, but the (proprietary) 134MiB Direct3D on Metal framework (D3DMetal.framework) that is in the GPT disk image. It completely skips the Wine -> Vulkan -> MoltenVK -> Metal route that CodeWeavers used and requires a lot of per-game tweaking.

I wonder though, looking at the WWDC session, Apple's path seems to be

- Evaluate the game with Wine + their DirectX implementation.
- If it's viable, port the game to Metal. This seems to require a full port and there is only a shader converter.

You'd think that they would make developer's lives easier if they allowed using D3DMetal.framework from macOS apps as well. Then developers could:

- Evaluate the game with Wine + their Direct3D implementation.
- Port the non-graphics part of the game, graphics through D3DMetal.framework.
- Port the graphics part to Metal.

If the also allowed games in the app store to use D3DMetal.framework, the last step could even be skipped. These would be fully native Mac games, but using Apple's implementation of Direct3D on top of Metal.

I'm extremely confused by the Game Porting Toolkit. This isn't really useful for porting apps, and it isn't useful for "getting a feel for how the game runs on Macs" because performance won't be representative of a native port. The only way this would be useful is if Apple went the Valve/Steam Deck route, actually tested and certified Windows games, and allowed them to be sold as-is on Macs.

I guess the latter was the goal, but something prevented them for actually achieving it, so instead, they came up with a weird excuse for why this even exists. I hope they're still aiming for the Valve approach, though.

I don't think the latter was the goal. Apple always wanted native apps. They don't want people to developed only Windows app and just call it a day because every other operating system reimplements the Windows ABI and API. Why develop another operating system at all if in the end you have to reimplement Windows to run things.

Anyway, the whole thing is a total lack of reading comprehension from every news site out there.

Dave 2D is very excited about this
https://youtu.be/bIPl71ZeOYk

Kevin Schumacher

I would love it if, for just one second, every single person who has ever said "You can't game on a Mac" stopped and tried every single game available for Mac on Steam. Just on Steam. I know there's no real games on Apple Arcade, so we can skip right to steam. And, after all, since you can't game on a Mac, it will take literally zero time, right? So I'll wait for you to finish.

Oh, you can't actually do that instantly, because there are (as of this moment) 14742 titles available on Steam that run on Mac? More than double the number that run on Linux/SteamOS? And that's just Steam. I have played World of Warcraft on Mac for literal decades, as just one major example of a non-Steam game.

Like, I get it...great long-running joke, can't game on a Mac. What this fails to take into account is not everyone is super interested (or interested at all) in $60 AAA FPSes, which is usually the types of games that people are pointing to when they proclaim that the Mac is a gameless desert.

Sure, there are Windows-only games I would like to come to Mac (Satisfactory is a big one). But I have not had an actual Windows machine since 2010, yet I have gamed consistently and satisfyingly in the intervening 13 years. (And 98% of that time was without using Boot Camp.) And even before 2010, I didn't use it that much (the main reason I got rid of it) because my main machine has been a Mac for decades.

Warren's article, in particular, is infuriating. And not just because she apparently misunderstood the Game Porting Toolkit (which, to be fair, I hadn't really looked deep into either, but I also didn't write a splashy article about it, so...)

From the article that John Dvorak called "excellent":
> As PC gamers already know, this software support means the floodgates are open for some real games — not that casual Apple Arcade stuff

Have you ever used a Mac for a single day in your life? Have you ever even opened Steam? Again, 14000+ titles, some of which are AAA, some of which are absolute garbage, most of which are somewhere in between. But they are REAL games. This is setting aside the fact that there are REAL games, non-CASUAL games on Apple Arcade--critical darlings and "real" gamer favorites like Dead Cells and Steamworld Dig, and (*gasp*) even AAA titles like NBA 2K22 and NBA 2K23.

> that just days earlier, were utterly unable to play AAA titles.

Again, you don't even have to leave Apple Arcade before you hit what I believe nearly anybody in the gaming industry would consider a AAA title. So the idea that Macs are either incapable of playing (which is what the sentence says, incorrectly) or had no access to (what I think she actually meant, but also incorrect) AAA games is so laughable as to be absurd.

> But even without that, this new technology, wrapped in a developer toolkit, is the best thing to happen to the Mac gaming market in at least 30 years.

No, the best thing to happen to the Mac gaming market in the last 30 years was Blizzard's continued faith in it long after it was declared dead as a gaming platform by nearly everybody. Or maybe it was Steam releasing on the platform in 2010. Or it could have been any number of other things (though those are really the top two in the last couple decades).

> The lack of native gaming engines [after the switch to Intel]

I realize Apple has recently tried its best to remove Epic Games from the face of the planet, but they still exist, they still make Unreal Engine, and it still runs on Mac. Just as Unity has and does.

> Steam, the most popular digital distribution marketplace for desktop games, didn’t even get Mac support until 2010.

"didn't even" OK, sure, but that was 13 years ago. The rest of the article goes to great lengths to paint a picture of zero games available on Mac. Which is it?

Steam "didn't even" have third-party titles until 2005, "didn't even" launch on Linux until 2012 (for those keeping score, two years after the gameless platform)...

> Instead, Apple’s requirements that game developers use its tools (which were more brittle and less powerful than what is available on Windows)

Precisely which development tools (not talking about notarizing, as that is one step at the end of a very long journey of actually making the game) of Apple's did they require of the devs of the thousands of games available for Mac on Steam? Most of them either run custom game engines or Unity or Unreal Engine. But, wait, remember a few paragraphs back when there were no native game engines available for Mac? Again, which is it?

Entire article is garbage.

And to Steve's point...
> Apple’s not on speaking terms with the top game engine company of the era.

They are also not (and have not been for quite a few years) on speaking terms with the top graphics card company of the era, either. So even if the Mac Pro could use third-party graphics cards, it would only allow AMD.

Still though, Apple headlining Death Stranding, a game that's been available for free on PC, and No man's sky, a game that launched on the PS4. Yes, four.

It's not what I'd call impressive.

Just having steam doesn't put macOS on par with a PC.

@Kevin Schumacher

The biggest complaint I have is that sequels to two of the games I love aren't available on Mac.
Diablo 4 isn't coming out for Mac nor is Cities Skylines 2.

Generally I agree with you however, I've never really had a problem with gaming on the Mac and haven't owned a dedicated gaming PC in over a decade (even though I do think about building one from time to time).

@Plume

> This isn't really useful for porting apps, and it isn't useful for "getting a feel for how the game runs on Macs" because performance won't be representative of a native port.

This is very nuanced. Anomalies such as games running better on Macs with the GPT than the native port, can and will happen, because games are very well optimized for DX12, while porting to other platforms, such as Mac and Linux, is often relegated to a cheap porting house in eastern Europe or an intern, which ends up being a naive or buggy implementation, whereas the DX12 is an order of magnitude faster, thus, even with the overhead of the middleware framework, being faster than the "native" port.

This has been seen in several cases on Valve's Proton, where the Windows native EXE with a DX11 or DX12 renderer runs faster and more consistently than the Linux native binary with OpenGL or Vulkan renderer. This, coupled with Valve's consistent improving of Proton, with game-specific patches, and the experience is pretty good even on a very low-end, low-performance SteamDeck. On a modern PC running Linux, the overhead is minimal to imperceptible.

MacOS needs a Proton not GPT (it does not have to be Proton, just a stable API/ABI to write games against).

"MacOS long time" is not good enough. Gamedevs needs some guarantee that they can sell the same binary for decades.

Kevin Schumacher

> Apple headlining Death Stranding

You're assuming that nobody has any interest in older games. It's like saying that if Michael Tsai launched a new streaming service and promoted that The Wizard of Oz was one of the launch titles, that he should be ripped apart for highlighting something that didn't come out this year.

Clearly, if having Death Stranding on the day it released was important to you, then having a PC... Oh, wait, it didn't release day and date on PC, either.

> No man's sky, a game that launched on the PS4

Hello Games has done a phenomenal job of vastly overhauling what was a middling launch and turning it into a slow-burning juggernaut over the years. It is not the same game as it was even two or five years ago, let alone at launch. And it's not running at the same technical level it was then, either, having been greatly improved as time has gone on. This is not even close to the best title to throw "outdated" stones at.

> Just having steam doesn't put macOS on par with a PC.

I did not say it was the SAME experience. I said that I (and many other people, judging by the number of people gaming on Mac and the number of titles available for it) was able to have a joyous gaming existence even despite my clearly devastating handicap of not having a Windows PC.

Leave a Comment