00:00
00:00
mike
hello!

Mike Welsh @mike

Age 38, Male

stupids

Penn State

San Diego

Joined on 2/24/00

Level:
23
Exp Points:
5,596 / 5,880
Exp Rank:
8,047
Vote Power:
6.47 votes
Rank:
Police Captain
Global Rank:
3,931
Blams:
1,268
Saves:
1,003
B/P Bonus:
16%
Whistle:
Normal
Trophies:
10
Medals:
916
Supporter:
9y 10m 19d
Gear:
1

flashquake

Posted by mike - November 11th, 2007


Check out these videos from the Adobe MAX conference in Chicago:
http://www.peterelst.com/blog/2007/10/
03/adobe-max-chicago-sneak-peeks/

The first video, Flash Next, shows some nice features coming in the next iteration of Flash. But the real gem is the second video, Flash on C/C++. Particularly the demo near the end. I had to pick up my jaw off the ground after that one! Quake in Flash!?

The presentation is unclear on what the technology is actually doing. Is it compiling C source into AS3 bytecode? This is what the video says, but that seems pretty crazy to me, especially after the Quake demo. If you squint at some of the slides in the video, you can see some blurry code: (~02:20 in the video)

var machineC:Class = Class(loader.contentLoaderInfo.applica tionDomain.getDefinition( ... ) );
var xmlPtr:int = __allocString( xml.toString() );
var xslPtr:int = __allocString( xsl.toString() );
var resPtr:int = __call(machineC, xmlPtr, 0 );
var retStr:String = __stringFromMem( resPtr );

This code shows us a lot more about what's really going on. It seems like the machine code is actually being embedded inside the Flash. Some native hooks are provided to place AS3 primitives in memory (__allocString), run the machine code (__call), and grab the result from memory (__stringFromMem).

This is somewhat less practical -- for one, I would imagine that you're losing platform independence if you staple some machine language with your Flash app. Second, it seems potentially insecure -- letting a developer grab pointers to memory is totally contrary to the Flash's draconian security policies! :)

Nonetheless, it's cool stuff! Most interesting to me, though, is that Flash is displaying Quake's framebuffer and playing Quake's dynamically generated sounds. Writing pixels to a BitmapData is still heinously slow in AS3, and there's no built-in way to generate sound from code, aside from the clever audio hack. I suspect functions like __bitmapDataFromMem were added to grab Quake's frame buffer. Something similar that would allow a quick way to draw to the screen would be a great addition to ActionScript.


Comments

MIKE, your mustachioed cat is the most irritating user image in the known universe

Very interesting Mike. I think I might do some of my own researching on this matter.

Fuck Yeah! Posible Bones on Flash! what is it going to be called? Flash CS4?

yea! it's nice to see that Adobe is actually adding some nice features for animators and designers this time around.

Most indications seem to say it will be CS4, but who knows, they could come up with some other wacky acronym to call it.

Once again I am convinced that M.I.K.E. is indeed a robot that will eventually kill everyone in the office once he develops "feelings".

Saw that video about 2 week ago, thought it was really cool how they did it. What I think they did was similar to running flash as if it's openGL. Pretty much, ran a C application through flash to show how much it can process. Seeming as there's so much optimisation gone into professional C program's, I think it was basically showing us the power of the new flash player. I thought it was really cool none-the-less. Sorta like a video I saw a few months back about how they were thinking about including kinematic's into flash 10. That'd be a nice effect too :P

I thought it was funny how everyone was going crazy over the features they were announcing, they were such nerds.

Until they showed the bones, and I almost started cheering, in my school's library...

Boy, I'm glad I caught myself, that could have been awkward...

This looks great,are they keeping as3?If so im going to start learning it.