Deja Vu in a Box 10¢ Contact
 
« My Top Ten Least Favorite Ethical Arguments
In Praise of Modern Board Games »

Hitting a Dead End with FlasCC

By Jeff | Published: January 1, 2013

I’ve been looking long and hard for a solution to the problem of creating high-performance games that are broadly portable across desktop, mobile, and in-browser platforms. Adobe Flash looks to be the closest solution to what I want, but FlasCC falls far short of offering the performance benefits it promises.

Flash’s cross-platform support is impressive. Naturally Flash applications run in browsers, but in recent years Adobe’s AIR technology has made it possible to make native-looking desktop and mobile applications as well. Flash’s mobile support offers many surprisingly useful features, including native deployment to connected devices, a handy mobile device simulator, and Scout support for profiling Flash applications running on a device.

Most recently Adobe released FlasCC, which lets you compile C/C++ code and embed the result into a cross-platform Flash file. This, I was sure, would be the magic bullet that would enable me to write high-performance game features in C++, while crafting the overall game interface in the Adobe Flash editor and deploy the resulting application anywhere, easily.

Alas, I discover today after a day of toiling that FlasCC does not compile to native code (contra Google Chrome Native Client, for example). Instead, FlasCC compiles to ActionScript bytecode, which executes with horrifying sloth, especially on mobile platforms. The Box2D example that comes with FlasCC simulates 500 colliding physical bodies with reasonable speed on a desktop, but can only simulate around 20 bodies at the same speed on my iPhone. That’s what happens when you execute ActionScript bytecode on a mobile device.

Therefore, if you’re making a game with no real CPU burden (something like Simon, perhaps?), Adobe Flash and FlasCC offers a great way to create cross-platform games using either ActionScript or C/C++. But if you’re making a game that needs to do some real computations—run physics, for example, or serious AI—FlasCC is useless.

Adobe should consider enabling a “universal native” mode in FlasCC—a switch that would cause FlasCC to compile to one or more native architectures, as selected by the user, and bundle the result into an executable SWF (or SWC). Alternatively, FlasCC could output LLVM bytecode, then run a JIT optimizer and linker on the native system when the app is first executed. That first run would have a long startup delay, but for many applications that would be a small price to pay for native SWF execution performance across all supported platforms.

Be Sociable, Share!
  • Tweet
This entry was posted in games, programming, technology. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
« My Top Ten Least Favorite Ethical Arguments
In Praise of Modern Board Games »

5 Comments

  1. EJ
    Posted January 1, 2013 at 4:54 pm | Permalink

    Your solution of a jit phase wouldn’t be allowed on an iOS device. Your best bet would be to compile down the c++ into a shared library for each device that Flash could use.

    Reply
  2. Tim Reynolds
    Posted January 1, 2013 at 6:26 pm | Permalink

    I understand the desire for a silver bullet but it is really unlikely to ever happen. Better would be to look at a framework like Unreal Engine or Unity and build separate executables for each platform.

    Given the myriad if security issues that Flash has plagued the world with I hope very much that they never start executing binary code in the flash plugin. I have zero faith in them executing that safely and securely. It would be a nightmare. I should note I have little faith in anyone being successful in that. Only thing is if adobe attempts it they can push it out to millions and millions of computers.

    Reply
  3. joethepothead
    Posted January 2, 2013 at 5:27 am | Permalink

    It’s time for flashers to use c++

    Reply
    • Jeff
      Posted January 2, 2013 at 10:04 am | Permalink

      What particular reason(s) for this assertion are you thinking of?

      Reply
  4. Aaron Simmons
    Posted January 4, 2013 at 1:36 pm | Permalink

    FlasCC is what you want to run C++ code on the browser. But if you want to run C++ on mobile, what you really want is Air Native Extensions (ANE). While FlasCC technically works on mobile, it’s really not the right tool.

    I have a C++ library that I run in the browser with FlasCC and on mobile with ANE and its fine.

    Reply

Post a Comment Cancel reply

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Holy Ghost Stories
Durer
by
Jeff Wofford
  • Recent Posts

    • The Video Game Industry Will Crash in 2013
    • The New Black
    • Finding C. S. Lewis’s Essays
    • What is Ethics?
    • SimCity to License Blizzard’s LocalServer™ Technology
    • When Game Development Stinks
    • An Invitation Back to Faith
    • The Four Moral Cultures
    • In Praise of Modern Board Games
    • Hitting a Dead End with FlasCC
    • My Top Ten Least Favorite Ethical Arguments
    • Suitors: A new, free card game for 2 to 4 players
    • The Sorry State of C++ Portability
    • The Sorry State of Game Portability
    • Come Play House of Shadows!
    • Elvis in Wonderland: An Example Game Pitch Document
    • I Cannot Read on My iPad
    • The Final Solution to the Travelling Salesman Problem
    • Angry Birds “Cloned” Crush the Castle, and That’s Okay
    • How Diablo 3′s Networked Standalone Campaign Secures the Auction House
  • Recent Comments

    • BenTennyson on How to Get Your Game Idea Made into a Game
    • Jeff on The Video Game Industry Will Crash in 2013
    • Jimbo on The Video Game Industry Will Crash in 2013
    • The Founder on How to Get Your Game Idea Made into a Game
    • Paul Liddell on How to Get Your Game Idea Made into a Game
  • Categories

    • blogging (3)
    • books (13)
    • culture (8)
    • employment (3)
    • ethics (6)
    • faith (35)
      • Bible (3)
    • family (7)
    • fiction (6)
    • games (53)
      • board games (2)
      • Crush the Castle (6)
      • House of Shadows (1)
    • iPhone (14)
    • language (1)
    • Mac (4)
    • music (4)
    • Phit (6)
    • politics (5)
    • productivity (8)
    • programming (35)
    • science (2)
    • technology (30)
    • thinking (13)
    • Uncategorized (7)
    • writing (15)
  • Archives

    • May 2013 (2)
    • April 2013 (1)
    • March 2013 (3)
    • January 2013 (4)
    • December 2012 (1)
    • November 2012 (1)
    • October 2012 (3)
    • August 2012 (1)
    • July 2012 (1)
    • June 2012 (4)
    • May 2012 (3)
    • April 2012 (2)
    • March 2012 (3)
    • October 2011 (7)
    • September 2011 (3)
    • August 2011 (3)
    • July 2011 (2)
    • May 2011 (1)
    • January 2011 (2)
    • June 2010 (4)
    • May 2010 (2)
    • April 2010 (1)
    • February 2010 (1)
    • January 2010 (3)
    • December 2009 (8)
    • November 2009 (2)
    • October 2009 (2)
    • September 2009 (1)
    • June 2009 (10)
    • May 2009 (5)
    • January 2009 (1)
    • December 2008 (2)
    • November 2008 (3)
    • October 2008 (1)
    • September 2008 (2)
    • August 2008 (1)
    • July 2008 (1)
    • June 2008 (2)
    • May 2008 (8)
    • April 2008 (3)
    • November 2007 (1)
    • October 2007 (2)
    • August 2007 (5)
    • July 2007 (4)
    • June 2007 (8)
    • March 2007 (1)
    • November 2006 (3)
    • April 2006 (1)
    • March 2006 (1)
  • RSS Links

    • All posts
    • All comments
  • Meta

    • Log in
Copyright © 2013 Jeff Wofford. All rights reserved. Powered by WordPress. Built on the Thematic Theme Framework.