« Cocks.net | Main | If you can read this... »

Moving to Intel!

Last Monday at WWDC, Steve Jobs dropped the bomb that the Mac platform was going to move to Intel-based chips. This represents a significant shift in direction, and a bit of a psychological one as well. It's been a whole week now, and I've had plenty of time to digest the implications. What follows is my somewhat lengthy analysis. There are many facets to the move, and I'll attempt to compartmentalize these where I can.

On Metrowerks CodeWarrior

Let's start off with the unspoken truth here - Metrowerks' CodeWarrior is effectively dead on the Mac platform. They sold off their entire x86 toolset to Nokia a few months back, and they'd now need this back to have any future on the Mac platform. This also comes on the heels of their spin-off from Motorola to Freescale a year or so ago which appears to have left them in a bit of a transitional period for a while. Not coincidentally, for the first time in as long as I can remember, they did not have a new major CodeWarrior release last year.

Before last week, I would have taken Metrowerks' sell-off of the x86 toolchain as relatively good news - they never competed effectively on Windows, and had spread themselves a bit thin, IMHO, which was reflected in the lack of major updates to their Mac tools. However, they still generated the best code on the Mac platform, and their compiler - though only able to take advantage of 1 CPU - was nearly twice as fast as Xcode/gcc in many cases. As well, CodeWarrior had many options that Xcode/gcc did not that made for an easier time porting Windows software to the Mac: 1-byte bools, 2-byte shorts, support for old-style for-loop scoping, the ability to have easily-maintained build targets, and support some VC 6.0 syntax oddities that, while non-standard, were often used.

But things have changed quickly, and there's a new sheriff in town. :-) Xcode 2.0 and 2.1 have made huge strides to close ranks with CodeWarrior. We presented Apple with a list of things that we needed badly from Xcode and gcc sometime early last year, I believe. As it stands now, it sure looks like Apple has taken that feedback to heart as Xcode 2.1 addresses pretty much all of those issues. Part of this work involved moving our libraries and a few games over to Xcode (KOTOR, for example, builds in both Xcode and CodeWarrior), and at this point it looks like eliminating CodeWarrior will not be any big deal for future projects. From a sentimental standpoint, I'll miss CodeWarrior - Metrowerks always treated me right and gave great support.

On the Porting Process

The transition to x86 will, long-term, make the porting process easier. The move to x86 will make ports go faster mainly because we won't have to deal with byte-swapping issues. This represents a non-trivial amount of work in making a Mac version of a game - binary data lives everywhere. Even games based on portable engines like the Quake 3 engine require byte-swapping changes with each game. Take Jedi Academy for example: scholars of the release notes for that game will remember that it shipped with a bug where acid rain on the Vjun level fell indoors as well. This was a subtle byte-swapping issue for a specific chunk of binary data that was again specific to just one level of Jedi Academy. That was (and still is) the fastest port I've ever done at 7 weeks, and it would have gone much quicker had I not had to deal with endian issues.

However, in the short-term the move to x86 will add some additional work. For starters, the PowerPC Macs currently make up 100% of the Macs for which software is sold. (Someone prove me wrong and show me software that is still sold to 68k Mac users.) In looking back, the transition from 68k-based Macs to PowerPC-based Macs took roughly 4 years start to finish. PowerMacs were introduced (and started shipping) in March 1994. By 1998, most software vendors had finally discontinued 68k versions of their software. In 1998, Mac OS 8.5 was the first MacOS to require a PowerMac. If it takes 4 years from shipping for most current Mac users to get off the PowerPC platform and Apple is one year away from shipping it's first x86-based Mac, then we're looking at roughly 5 years before Mac developers kill PowerPC versions for good. Likely it'll happen sooner, particularly for demanding software like games, but the transition will still be measured in years.

One thing I'll miss about dealing with byte-swapping issues are the interesting side-effects. For example, in Jedi Knight and Jedi Academy, if I forgot to swap a certain piece of data, your lightsaber would not attach itself to your hand but would instead be positioned in the center of the model. As it happened, this was on your crotch, facing forward. Mark Krenek had another interesting bug where, while working on Spider-Man, Spidey's hand protruded from his butt. Glenda had another byte-swapping issue in Madden 2000 where players' heads would rotate continuously. Good times.

In a twist of irony, pretty much all next-generation consoles will be running on big-endian processors like the PowerPC. If it ever happens that we end up predominantly porting games from consoles to the x86 Mac (instead of from Windows to the Mac), we'll have to deal with byte-swapping again in force. Could we be so lucky?

On the Implications for the Mac Platform

The move to x86-based Macs has several implications for the Mac, and it's too early to tell how it's all going to play out. Phil Schiller, an Apple VP, has publicly stated that Apple will not prevent users from running Windows on these new x86 Macs, but Apple will prevent OSX from being used on any old x86-based PC. This is a gamble, and I believe it greatly increases the odds for two extreme (and wildly different) scenarios to play out.

The first scenario is that these new Macs are seen by the general populace as an all-in-one solution and Mac market-share increases wildly. They run OSX, they run Windows, they run Linux. Why buy any other PC when you can get all 3 on a Mac? Well, aside from price that is. ;-) If OSX only runs on Apple hardware and this notion of a one-stop solution gains significant traction with the computer-using populace as a whole, Apple is in a good spot. I suspect some hacker will come up with a way to run OSX on non-Apple hardware after a time, but I'd expect Apple to actively pursue these transgressions. It's entirely possible that once more people use OSX and see the relative elegance and security of the OS compared to Windows, they'll leave Windows behind, making these new Macs a "gateway drug" to OSX.

The second scenario is that the Mac enters a death spiral due to Windows running on the Mac hardware. It's possible that developers who now cross-develop for the Mac and Windows decide to cut costs and let their Mac users dual-boot into Windows and run the Windows versions of their software. I suspect this temptation will be greatest for the smaller developers first. If Mac users start showing a real willingness to do this, the trend could become irreversible.

This is a particularly unpleasant scenario for Mac games, since Mac ports usually arrive 3-12 months after they appear for Windows, and usually at the original full price-point - at a time when the Windows version has already seen discounts. These are unfortunately unavoidable aspects to doing most Mac game ports. Ryan Gordon made some points, drawing upon his experience with Linux gamers, that tend to show that this is already a real problem with the Linux user base. Unfortunately his comments were in an old .plan entry, and I can't find a working link to them now. The bottom line is that the health of the Mac platform will always depend on the availability of Mac software.

Will people who buy Macs because they can run both Mac software and Windows software slowly migrate to OSX and leave Windows behind? Will Mac users notice "Hey, Windows isn't all that bad after all!" and start to leave the Mac behind? Too early to say, that's for sure.

On What the x86 Will And Won't Give Us

I believe the move to x86 is inspired mainly by Apple's frustration in getting low-power G5s for PowerBooks as well as significant quantities of faster G5s for the towers. I heard lots of "informed speculation" at WWDC about Apple's plans from folks I consider to have good knowledge of the situation. The general consensus seems to be that laptops will be the first to move to x86. Intel really has some fantastic laptop CPUs - low power and high performance, so it makes sense that the PowerBooks and Mac mini will be the first and will benefit most from the switch.

I'm less sure about what this means for peripherals. For example, Mac video cards currently contain Mac-specific firmware just to run on the Mac. It wouldn't surprise me either way if these new x86 Macs could use PC video cards right off the shelf or if they still needed Mac-specific firmware. One thing I have seen speculated is that the move to x86 will magically improve OpenGL support since the Mac drivers will be able to leverage work done on OpenGL for Windows. I don't know if this logic holds true - Apple's OpenGL implementation is radically different from what exists on Windows. On the PC, each vendor (ATI, nVidia, etc) implements their own OpenGL stack. On the Mac, Apple maintains OpenGL with hooks for each card to talk to OpenGL. As I understand it, most optimizations for OpenGL on the PC are algorithmic rather than, say, hand-tuned x86 assembly in the drivers.

It has been leaked on the net that the "Developer Transition Macs" as they are called have integrated Intel 3D video on the motherboard. I don't know at all if these will ever make it into a shipping Mac. My hope would be that they do not - we have enough fun as it is managing two different 3D chipsets, and the Intel graphics chipset isn't really geared towards high-performance gaming. The chipset is, as I understand it, very CPU-dependent for many things. You can read more about it here.

That ended up being more than I was planning to write, and yet I can think of several more things to add. However, I've clearly got a ton of work to do in the next year to get past, current and future games ready for x86 Macs, so I'm going to shut up for now and get to work. :-)

Comments

Thanks for the notes Brad, keep us updated as you move through this cpu change with us all.

Ryan Gordon's Finger:
http://icculus.org/cgi-bin/finger/finger.pl?user=icculus

I strongly suspect the market for Mac games is going to get terribly small. Between WINE and Virtual PC, both means to host Windows apps within MacOS, it's going to be very hard to convince anyone to wait for a MacOS native version of a game. VirtualPC especially should provide near 100% game compatibility with only a minor performance hit since there would no longer be a binary translation stage involved. Since the Windows license is included it would be a small price to pay for gamers who prefer MacOS apps for productivity.

On the bright side, Macs could become a preferred platform for gamers who value convenience over performance. Being a relatively static platform compared to other X86 systems, it should be more simpler to thoroughly test Windows games running on X86 Macs.

I don't share in all these gloomy predictions.

The hardcore game market is at risk, true. But I think the casual market is a pretty safe bet to stick around. No matter how well Virtual PC works (and such a beast is completely hypothetical at this point) most Mac users are not going to want to buy it. They've just paid a bundle of money for a machine which works nicer for all the common needs (mail, internet, CD-R, DVD, music...) They aren't going to shell out for VPC just so that they can then buy a bunch of $30 PC games.

It's funny to me that the same people who assume that many companies won't bother porting their Windows software to Mactel, also assume that Microsoft will port Virtual PC to it. Maybe Microsoft will just tell their users to dual boot? :-)

Back to the hardcore game market. The short-term difficulties should be partially offset by the fact that there is a lot of turnover in that market- hardcore gamers naturally tend to be on the lookout for the next-generation, snazzy games. As soon as 3 years from now Aspyr and other publishers will start announcing Intel-only games.

I do think the Mac game industry will get leaner for a few years, but 4 of 5 Mac game publishers will survive it without too much trouble, and five years from now we'll look back on this as another unpleasant but necessary transition.

Also, the Eagles will win the Superbowl next year, and in 2007 Republicans will redistrict the entire United States in order to ensure their victory in the Presidential elections the following year.

I'll just mention that I bought Apple stock before the split, when it was below $20. So you should fear my prognosticative abilities. :-)

the x86 nvidia drivers are full of hand tuned asm and selfmodifying code. quite disturbing actually.

the ati drivers are better (no selfmodifying code) but i suspect still a lot of hand tuned asm.

I don't buy the VPC thing. VPC has -never- directly supported video hardware before, why would it do so on a Mactel box? If VPC is still using a faked/virtual video system when Mactels start shipping, the only gaming improvement you'll see is for extremely low end stuff that doesn't need 3D acceleration.

WINE has a chance of being a threat if it is actually ported to OS X, but even as computer-geeky as I am, I don't care to jump through many hoops to get my games up and running. If it isn't a 10 minute process, i won't install a mod these days. If WINE or that ilk does arrive, I'll still wait for native versions of games rather than buy PC. I'd only buy PC games if they were not coming to the mac, period. The appearance of WINE would force the porting houses to announce their game deals the day they're signed though, keep people in the dark for 6 months and a lot of them might tire of waiting and buy the PC version.

Lots of IFs still... and remember, half the Macs in the world will still be PPC based machines even 4 years from now, it's not like the Mactel users will be the dominant ones in the near future, all current ppc macs don't magically pumpkin over to intel chips next year. I'll be buying PPC software/games for at least 2 more years for my G5 unless something truly groundbreaking starts rolling out of cupertino before that.

Brad,

I'm sorry for posting this here but I couldn't see any way to contact you on the Blog.
I am trying to get in contact with John Butler, If you can shoot me an email I will explain.

Again, Sorry for the inappropriate post!

Thanks
Troy

"VPC has -never- directly supported video hardware before"

This is, to the best of my recollection, not true - VPC3 supported direct video hardware for certain chipsets.

It's long since been gone from the app, but never is inaccurate. :P

As for Mac gaming, I believe it's going to be just as strong (or weak) as it has always been. Sure - porting PC games to the Mac will probably die off. However, console games will need to be ported. Right now we're not porting hardly any console games to the mac because those same console games are almost all on the PC. All three next generation consoles will not be using x86 processors, but PowerPC - which means most games on the consoles (I think) will be a lot harder to port to the x86.

And think of this - who better knows how to port between x86 and PowerPC than the current Mac Game Developers? :-)

Ryan Gordon's finger --archives--:

http://icculus.org/cgi-bin/finger/finger.pl?user=icculus?listarchives=1

The entry you want is at:

http://icculus.org/cgi-bin/finger/finger.pl?user=icculus&date=2005-06-07&time=14-12-46

Brad this article is great i also think as you that this move will also bring a lot more applications to the mac platform as well as games finally... :)

I wanted to ask permition for posting this article of yours in my spanish based mac forums... ill put your credits below the article.

Gilberto

As a Cocoa developer with a lot of NeXTSTEP experience and also, sadly, a WIN32 developer with a lot of service experience I have to say that I think it could go either way for Apple...

Since we will be able to run Windows apps via WINE (DarWINE) it's harder for a company to justify building apps for Mac and Windows. However, I suspect that Apple can benefit with DarWINE as a path for switchers to the Mac. This *could* be the thing that makes Apple the dominant player in the PC market.

What is concerning me is that I almost certainly will have to learn C# to have my contract renewed in October - I'm currently developing Cocoa apps. I don't think the guys I'm working for will swing for doing both when they know they can build for Windows only *and* that it will run on a Mac.

On the games side, I think it's less of a problem as WINE doesn't support DirectX, to my knowledge, so there'll still be a porting phase for Windows based games. OpenGL games should port with only minor modifications to an Intel based Mac.

I've started to port one of my Cocoa apps to Intel hardware. The biggest hassle has been floating point equality comparisons. I've always been endian savvy, using htons and friends.

Post a comment