Last week I posted on twitter a link to this vid:

VariantWhat the hell was that?  The most boring music video ever with the music too loud and a bunch of black at the end (sorry, I made that after a long night of coding at the wee hours of 5AM)?

Yeah, pretty much.

Yes, that was Actionscript 3 driving that hardware accelerated 3d engine.  Yes, that was a modified version of the AVM2 or Tamarin VM.  Yes, that was 200 Frames Per Second, with a pretty decent amount of polys.  Now for what it wasn’t:  that was not the flash player rendering that.  The awesome Irrlicht 3d engine was doing all of the heavy lifting on that.

Basically, Tamarin set up the Irrlicht 3d engine to run, which was a successful proof of concept that yes, AS3 could be the scripting language for a 3d engine which could rival Unity 3d.  Awesome!  It also allowed for you to use the Flash Projector to output an executable of your AS3 driven version of Irrlicht, and thus mimics the Adobe Integrated Runtime (a.k.a. AIR) model.  That’s doubly awesome!  Right?

So?  Um, what’s the problem Brosef Stallin?

Have you happened to use Tamarin lately?  If you haven’t. . . let me help you get started:

First link is a pdf explaining what the AVM2 does.

Then build it (note: this is the easiest part).

Then add your own Native Classes to it. Welcome to Manifest/Make file hell.

Or, just use the awesome project Red Tamarin to get yourself up and running.  You should look at Zwetan’s blog as well for some tasty morsels of knowledge (a seriously smart dude).

Other sources of interest on this subject include: RedRocketServer, Campell Anderson’s Blog, and the Mod-Actionscript Project.

So, if you didn’t notice the pattern here, let me spell it out for you.

1.  The AVM2 is in C++, and there is very very very little documentation on it.  The Red Tamarin project does the best job at this point of getting you in to the AVMPLUS and Shell libraries (check the avmcore.cpp and avmcore.h to find some morsels of goodness, and then the src/shell/avmshell.h).

2.  While it was cool that Adobe released the AVM2 to the public, they didn’t release the rest of the Flash Player to you.  It’s like trying to learn how an automobile engine works with just the transmission (I don’t know I’m not a car guy).  You don’t have any access to the display/GUI at all.  It’s almost a dead end.

3.  The only way to compile your .AS code with the avmplus.exe is via the command line open source Flex Compiler.  Which is very scary to a lot of people.  Yeah, I could write a python script or something for you, but it will still not be pretty.  And it would be too much work for all but the most Obsessive Hackers out there.

4.  Did I mention we had to modify the AVM2 for all of this?  So that means this will not work in the Holy Grail. . . the Flash Player.  Although, I could use the QT Framework and bust out a cross platform browser plug in that would run Irrlicht in the browser via your AS3 script.  But that’s a plug in that people have to download!  Gasp!  And then the whole reason for using flash kinda goes out the window right?  We give up the godlike(all together now) Flash Penetration Rate for a 3d engine that can output more then 20,000 polygons without having to jump through hoops of fire.

Now, I’m going to go interactive on you!  Get ready yo. . . a question!

What do you guys think?  Would you like Variant to be built out?  Would you use it if I spent my precious (imagine my adorable family crying right now) time on this?  Could we get someone from Adobe to weigh in on this?  I know that I could build this out for the new version of AIR that is going to be released with a Native Code API.  Do you guys even freakin’ care about high resolution/high framerate 3d in flash?  Would you like a new IDE like Unity 3d but with the option to treat every 3d object like a MovieClip?

Please, feedback is welcome.  Oh, and do you want the .exe example that is shown in the video to play with?

Good night and good luck.


If you were interested in the AVM2 and would like to follow Red Tamarin please follow @zwetan

And if you are interested in Red Rocket Server, please follow @campbell

They deserve twitter love, they are awesome.

12 Responses to “Project Variant and a question to the community.”

  1. nathan

    in all honesty.. I’d say no if it wasn’t for the new air player with native support, a little double checking this will ultimately be able to work with future versions of air, and if so then definately – air is set to boom, 3d is a must, and the faster the better so do it right and you’ve got a no looser :D

    ps: outstanding work

  2. Ben Garney

    Awesome work.

    I think you are overstating the difficulty of the AVM for serious programmers. :) I integrated Tamarin with Torque in early 2008 ( and it was pretty simple to get up and going there.

    Getting your build environment right is a little harder but not insurmountable. I’m doing that in PushButton Networking ( It takes some care to get enough stuff stubbed out so you can run SWFs w/o the Flash Player infrastructure, but it is very doable. Of course I owe a big debt to zwetan and his work on redtamarin, but other people have done it independently – Three Rings comes to mind. And once I got my core runtime up, I could load normal SWFs and run them (minus graphics of course).

    It is frustrating but unsurprising that people can’t distinguish between Tamarin/AVM2 and Flash Player.

    I think that a 3d engine with Tamarin would be neat, but unless you are going to build out some awesome tools there would be no reason not to use Unity or Flash. They are both a lot more mature and their tools are light years ahead of what any one person is going to be able to build. They also have great penetration.

    One path I could see would be to use it for normal native projects and use AS3 cuz you like it. In time that could mature things to the point where the compilation/debugging process was smooth, tools were acceptable, and you could bootstrap from there to a real middleware product. But it would take a long time. ;)

    Anyway, cool stuff, will be interesting to see where it goes!

  3. artjumble

    Very, very cool stuff here. But without official support for integrating this into Flash (Player or AIR) somehow, very limited usage.

    On the flip side, you could build out a nice system for building games in AS3 from a stand alone perspective (desktop install). Maybe even cross platform support. But there are really way more things that would have to be done for something like that to work.

    As much as I would like to see what you could do with this, I have to say don’t continue with it.

  4. Campbell

    Cheers for the mention mate, and awesome work with Variant!!

    A big thing to think about is Tamarin and eval() with Air 2.0 ;) Possible threads there. I have ported Erubis to AS3 so you could have embedded as in all sorts of template files and render them etc…. so many possibilities there.

    I really think your onto a good thing here. Not having the Flash visual side in Tamarin limits its usefulness, but with OpenGL you get this back. Last problem is this is only exe/.app based :) but some smart person should be able to write a browser plugin.

    Final word:: Unity should integrate Tamarin and give us the best of both worlds. Or Adobe should buy Unity and get proven 3d for cheap, (and access to Iphone, Wii, xyz gaming consoles). Makes sense in my small irrelevant opinion.

    Again props for showing what hacking Tamarin can do :)

  5. katopz

    setup company!

    1st target should be AIR 2.0, maybe free+link to your site or 1$ for unlimit license ;) ,
    the point is make it famous

    2nd target should be flash player, i think can force ppl to update their flash player just like normal update via you page maybe… “get flash player 3d”, and you can sell some ads via download page

    3rd join with social network game or other flash game network for distribute

    4th wait for $$$ :)

    hope you luck :D

  6. Promethe

    Very nice work indeed but I would have a few objections.

    The Flash Player targets the web. Of course, AIR can bake desktop apps. but those are still web oriented. Adding 3D to Flash just to make a 3D game is Flash is pointless. We already have great technologies (DirectX and OpenGL for example) to built neat 3D games/application.

    The idea with the Flash Platform is to get 3D web applications! Meaning 3D apps./games that actually feed from the web to run. 3D apps./games that actually take advantage of being inside a browser, accessing the web and having the whole rich media/rich interface the Flash Platform can provide. To put it in a nutshell, I think sacrificing what makes the Flash Platform such a great environment just to get hardware acceleration would be a huge mistake…

    I guess this answers your question and again, very nice work :P

  7. Jensa

    Great work, but I’d too vote no. Rather spend that time with your family :)

    First: because FP11 will offer some kind of hardware support (learned at #fotb)
    Second: since a new platform is of limited value without reach
    Third: no tools = no joy. It takes too long to build everything from scratch


    PS: +1 for Adobe buying Unity though! Way smarter use of money than buying Omniture….

  8. Seantron

    All very thoughtful answers. And I agree with all of them. Thanks guys.

  9. jpauclair

    I tried most of what you did there. And I think it would be really nice to make a plugin for that kind of stuff.
    If you plan to release it all as Open Source, I’m in! (my familly is crying too here!)

  10. Geoff Gaudreault

    I think this has tons of potential – for 3d and even for 2d games, if we could target a runtime specifically tuned for high performance OpenGL rendering. Especially if we could run it on the iPhone/iPad. I would say this is something that would need to be tackled by a group of developers, not just one. I wish I had the skill set to help.

  11. Will Saunders

    Entertainment and gaming have pretty much been -the- driving force behind the computer revolution, more so than even military and academic use. I think if you got a large gaming site to officially endorse such a player, and it was designed in such a usable way that people understood the tradeoff they were making (ie: yes another plugin, but yes -way- better gaming), people would be all over that. That’s not even taking into account the use of the Flash player in embedded environments, where I think some systems are still stuck on custom rolled implementations of AVM1.

    So basically, no, I don’t think this would be time wasted, and I think plenty would be interested in it.

  12. Valarie Klatte

    Hi, I want to thank the author of this post. This post really helps me. I did a search on the topic and some related sub topics and I have found a lot of corresponding views. If you don’t mind, I’ll quote some of your statements in my site. Thanks.


Leave a Reply

Current day month ye@r *