TransGaming Cider’s promises: fact or fiction?

Andy on Aug 10th 2006

Sorry about the title, I couldn’t resist. All the unnecessary sensationalism makes me feel like a real journalist! Will your porting kit kill you?? Find out at 11 (10 Central)!

Well, theoretically it could. You could be in the middle of a Doom-a-thon when a bug in the porting kit locks up your client, and your ex-best-friend frags you.

Tragic. Just tragic.

Anyway, this new fangled product from TransGaming, Cider, has me interested. From the article over at The Mac Observer it sounds like it uses an “emulation” approach to porting to the Mac.

Its interesting to me because, in my experience, attempting to “emulate” one platform API with another is pretty much the worst way to port anything. The API’s of Mac and Windows aren’t a one to one match, and some comparable technologies have vastly different architectures. That means trying to emulate a Windows API on the Mac might prove to be very difficult (i.e. the Windows model might assume polling, while the Mac model might assume callbacks). It also means trying to emulate certain API’s on another platform might be slow or inefficient. And that’s bad in a game, or so I am told.

Although I have to admit, by limiting the porting kit to games they dodge some of the bullets fired by using the “emulation” approach. Namely, all the UI differences on Mac vs Windows. Games usually have a totally custom UI that is unique to the game, not to the platform. So the porting kit doesn’t have to worry about Windows icons not looking right on the Mac, or controls that exist on one platform, but not the other, or menu items being in the wrong place. Its all custom, so it doesn’t matter.

By limiting the kit to games, it also means they can concentrate on certain API’s. From the Cider FAQ:

TransGaming’s Cider implements common multimedia Windows APIs such as Direct3D, DirectInput, DirectSound and many others by mapping them to Mac equivalents.

Games will probably focus on DirectX and graphics API’s, and probably not so much on, say, CD burning API’s. Which means Cider’s decision to focus on multimedia API’s was a wise one, in a bang for the buck sense.

Of course, if not all the API’s are implemented, what are your options if your product uses one that’s not supported? Well, you could change your Windows’ code to use a different, supported API. But that’s no fun, and may not even be feasible. You could also just switch directly to using Mac API’s and #ifdef your code based on platform. But that means you don’t get one codebase, which is one of the things TransGaming touts. It doesn’t sound like you’ll actually get the source to Cider, so implementing the Windows API on the Mac might not be an option. From the Cider FAQ:

Cider works by directly loading a Windows program into memory on an Intel-Mac and linking it to an optimized version of the Win32 APIs.

It certainly sounds like they’re handing you a DLL you link in, and you pray that they implemented all the right API’s, and in the right way. If you were depending on an obscure side effect (in a Win32 API? Never!), and they didn’t implement it, you’re kind of screwed. Or if, heaven forbid, there was a bug in their implementation. Of course, TransGaming might fix it for you, for the right price.

If they’re handing you a black box DLL, I wonder how big it will be. In my experience, “emulation” porting layers tend to be pretty thick as far as code goes, so it could be a large DLL. If you have the source code you could hand optimize out the functions you don’t need, or even let the linker do that for you. I doubt TransGaming would like to be giving .NET a run for its money in terms of download size.

The other interesting thing about Cider is that it seems to be derived indirectly from WINE. From the Mac Observer article:

Cider shares the same core technology as Cedega, which has its roots in WINE but branched from that technology in 2002.

This is interesting because WINE is covered under the LGPL. I know LGPL isn’t as strict as the regular GPL, but doesn’t it still mean someone should be opening up their source? I also wonder about the legal implications of the ported game. Perhaps I should leave that question to the GPL experts and to the law talking guys.

Although Cider might surprise me, it doesn’t sound like its all its cracked up to be. Emulating an API is a poor way to port an application to a platform, even for a game. I truly wonder if they can pull off the performance they say they can. I also wonder how many games will be ported as easily as they imply:

TransGaming works with the game developers and publishers to optimize the game for Intel Mac but this process takes hours to a mere few days.

That prediction only seems plausible if the game is using the API’s that Cider supports. If not, then things will take a lot longer. They also seem to be forgetting about testing. The Cider porting kit isn’t Windows, even if its trying real hard to be. The game code might be the same, but the OS/porting kit code isn’t. You’ll have to spend time testing on the Mac as well.

Of course, this doesn’t keep their Founder/CTO, Mr. State, from being cocky. From the Mac Observer article:

Mr. State said: “We imagine that they[the traditional porting companies] are re-evaluating their business models. Our technology does revolutionize how games are brought to the Mac, which we believe will result in a paradigm shift in the Mac game publishing landscape.”

I don’t know Mr. State. I’ve used and maintained “emulation” porting kits before, and even with the source they’re very hard to make work, and make work well. I don’t think anyone is re-evaluating their business model until Cider is proven.

Filed in Macintosh, Programming | 8 responses so far

8 Responses to “TransGaming Cider’s promises: fact or fiction?”

  1. bob c cock Aug 10th 2006 at 01:13 am 1

    word dude

  2. Sits Aug 10th 2006 at 02:13 am 2

    The whole Cedega/WINE debacle blew up years ago and is what I believe prompted WINE to change to the LGPL licence from a BSD/MIT style licence. At the time Cedega (I think it was WineX then) was created WINE was still under a more permissive licence so Transgaming are perfectly OK to do what they’ve done from a legal perspective.

    I know it’s shoddly to point people at wikipedia but take a gander here for more details:
    http://en.wikipedia.org/wiki/Cedega

  3. Guest Aug 10th 2006 at 02:34 am 3

    In 2002 the developers of Wine voted to change the licence from X11 to LGPL many because Transgaming reneged on any and all promises to release there DCOM and DirectX changes back to Wine.

    Please see :
    http://curmudgeongamer.com/article.php?story=20030806192631961
    http://curmudgeongamer.com/2006/08/transgaming-forsakes-gnulinux-gamers.html

    For more info on just how well Cedega works in reality!

    You can’t say you weren’t warned about there shady practices…..

  4. Timbobsteve Aug 30th 2006 at 12:30 am 4

    Just so you know, Cider is a developer only compile-in library… not an emulation layer as you have stated. It takes the DX and win32 specific function calls and passess them through to their OpenGL/OpenAL Carbon equivalent functions. This is why they are able to use it for gaming, because the emulation layer no longer exists when a game is compiled using this library.

    What this DOES mean, is that all PC gamers will have to go out and PAY for the new MAC versions of their games, because the software isn’t an emulator that the user runs… infact the user NEVER sees Cider at all. It is a compile-time thing.

    Anyways… just thought I would fill in your blanks.

  5. Andy Aug 30th 2006 at 02:40 am 5

    Timbobsteve: I didn’t mean it was an emulator, but it is an emulation style framework. See my post about Cross Platform GUI Frameworks. It emulates one API with another.

    I realize “emulate” is a bad word choice since people associate it with emulators, but it does best describe what the code framework does. As you stated, it implements Win32 API’s with Mac specific ones. Emulators do this at the CPU level (i.e. they implement CPU instructions with the native ones), and emulation frameworks, like Cider, emulate at the API level (i.e. they implement Win32 API’s with the native one). The fact that its compiled in does not change the fact they are emulating one API with another.

  6. Timbobsteve Sep 27th 2006 at 12:46 am 6

    OK… alot of FUD on the internet about Cider.

    I am going to try and debunk some of it:

    Firstly… IT IS NOT CEDEGA. It uses the Win32 wrapper library and some of Transgamings DirectX wrapper libraries from Cedega, but thats it. This will in no way run like Cedega does on Linux computers… simple because it is NOT user space software. This is software that the Developers use before they box the software up. Basically it looks like this

    (WARNING: Completely dumbed down code coming up)

    1. Developer hits Compile to make the game
    2. Compiler asks DirectX how to Draw a Square on the screen.
    3. Cider tricks the compiler and gives it the OpenGL equivalent instructions to draw a Square on the screen.
    4. Compiler+Cider continue in this fashion replacing all windows instructions with the equivalent mac instructions.
    5. Compiler finishes and developer can now run the entire program without any additional software on an Intel Mac

    This method of wrapping API calls is very efficient if done correctly and shouldn’t force too much extra overhead onto already top-heavy programs like games. So it will not require more RAM than its windows equivalents.

    Once again… this software does not get run by the user AT ALL. The developer simply add a single line to their makefiles for building the application that says “use Cider.dll instead of Win32.dll and DX3D.dll”…. and the user is never any wiser.

    The main difference between Cider (mac) and Cedega (linux), is that Cider does the conversions at compile time (so it does not chew memory when the game is run), Cedega does all this when the game is running, that is why it runs like a dog. It has to do this conversion every time it asks for instructions when the game is running… Also Cedega sometimes gets the instructions wrong and that is why games crash or don’t work. With Cider the developer will be able to MAKE sure that it all happens as planned before they ship it.

    This is a great step forward for mac users. I am a recent PC->Mac convert and the one thing I do miss is games.

    I guess the benefit is that developers who don’t want to learn coccoa/opengl combo to make games for OS X, can now continue using Win32 and DirectX to make their games like normal and still make a little extra money from the mac users.

    Please, no more comparisons to Cedega. It just isn’t clever to compare the two. They do the same thing… but they do it differently!

    -Timbobsteve

  7. Timbobsteve Sep 27th 2006 at 12:48 am 7

    A lot of times ‘emulation’ reads as ‘emulation at runtime’… I just wanted to make sure that people don’t get the right idea.

    Cider has the benefit of its compiled-in emulation layer…. so it will run much better than Cedega’s run-time emulation layer.

    -Timbobsteve

  8. Allan Jul 11th 2007 at 04:14 am 8

    Hmm this is slightly disappointing. I thought EA was going to bring out native Mac games, but they’re going to use this emulation layer … bummer !

Trackback URI | Comments RSS

Leave a Reply

Bad Behavior has blocked 780 access attempts in the last 7 days.