Archive for the ‘FLASH’ Category

Saturday, August 21st, 2010

Here’s a look at another interesting flash player implementation by Joa Ebert using Java with OpenGL rendering support. It is at an early stage but has the right idea in hardware rendering to OpenGL which is easily cross platform and mobile capable with speed.


This project is pretty new but there is work to make it web browser capable either in a java applet or a plugin for IE/FF/WebKit/etc but there are also others that are out there using alternative renderers. Most of these are in early development with varying support and do not currently compare to Adobe’s Flash Player versions.  However the hardware rendering ones like JITB may beat it fairly quickly once all the other features are added.  Complete OpenGL based renderers like Unity or WebGL are fast and can run pretty heavy rendering because of hardware acceleration for all drawing and native support.

Other Flash Player implementations:

  • Lightspark
    • AS3 script via LLVM
    • Written in C++ (very portable for native)
    • OpenGL accelerated rendering
  • Smokescreen
    • runs in Javascript/Canvas/html5
    • limited support
  • Swfdec
    • Firefox plugin
    • Early development
  • Gnash
    • flash 7-9 support

Flash Players that use OpenGL as the renderer are nice because cross platform support is easier.  The reason why OpenGL is a great idea is it is so cross platform on desktop and on mobile, it is also coming soon in WebGL for the browser hopefully.

Versions of OpenGL and support

  • OpenGL ES
    • OpenGL ES 1.1 = OpenGL 1.5 and lower (fixed function)
      • Android
      • iOS devices 3rd gen and lessx
    • OpenGL ES 2.0 = OpenGL 2+ (current version 4.1 – shader capable).
      • iPhone (3GS or later), iPod Touch (3rd generation and later) and iPad
      • Android 2.2+
      • WebGL
  • OpenGL
    • Windows
    • OSX
    • Linux

There is still a clear open field for an open source player to match something like Moonlight for Silverlight or hardware rendered canvas. WebGL would be great to have in time if it gets support but it is also nice to have a compiled language in the content that works in the player faster than scripting but with the ease of scripting. Plugins are still very relevant if they can address that.


Wednesday, July 8th, 2009

AIR is very popular for creating twitter clients, Sönke Rohde just made it much easier to make AIR apps for twitter with an AS3 library for Twitter. This library is built on top of core oauth as3 library by iotashin.  Core OAuth as3 library is a standard OAuth library this can be used for your own OAuth backends or connecting to other OAuth services as well.

A very nice feature of this library, in addition to being coded cleanly and as3 style, is the ability to have the Twitter OAuth page render inside of Flash.

Instead of opening the Twitter authorization page in the browser the library also contains OAuthLoader which is a wrapper around HTMLLoader which enables to directly show the authorization page within an AIR window:

// use this in the requestTokenHandler instead of navigateToURL
var loader:OAuthLoader = new OAuthLoader();
loader.load(request);
loader.percentWidth = 100;
loader.percentHeight = 100;
var w:Window = new Window();
w.width = 800;
w.height = 400;
w.title = req.url;
w.addChild(loader);
w.open();
Sunday, June 14th, 2009

Rozengain or Dennis Ippel of AKQA updated probably one of the tools I use the most for flash 3d and that is the blender to as3 exporter.  This simplifies loading in the meshes you have and lessens the bulk of the COLLADA format.  COLLADA is great but flash is still client side and fairly memory intensive for 3d so loading in models directly to as3 is nice if flash is your presentation tool.

AS3 Blender exporter has been updated to allow multiple object export. Also in April is was updated to export quads and modifiers.

One concern you might have is statically binding the code within a main swf fileon compile and resulting file size compared to loading in the DAE dynamically.  But you can just load these in as you would external DAE COLLADA files as compiled swfs and since it is just code it is very compact.   This adds some duplication of code (such as tweening libraries or the 3d engine source as needed) but allows a more horizontal loading or lazy loading of meshes when needed.

This is just another option to get 3D models into the flash 3d engine of your choice in addition to COLLADA, some MD2 support and limited ASE support.

This is an awesome project that keeps getting better, thanks Rozengain.

Friday, May 22nd, 2009

Flash 10 will be ready for mainstream hopefully by the end of this year, or early ’10 when the penetration numbers will be up in or around the 90% range via zeh fernando based on previous trajectories.  

With that, Flash 10 has many great new things such as the Vector structure that allows a collection of a certain type, which results in a faster collection because of the known type.  So anywhere where Arrays are used, that is a possible candidate for a performance increase within some code because you are asking the virtual machine to do less work on each loop (not having to dynamically find out the type).

ByteArray (Thibault Imbert) has demonstrated that for the JPEG encoding in corelib it is up to 2.5 times faster using Vectors than Arrays.  Your mileage may vary heavily but it is almost a guaranteed speed boost due to less work.  This obviously has great possibilities for speeding up code that uses lots of arrays.  

Due to the performance boost the Vector does have some constraints in the typical give and take of coder flexibility with compiler and virtual machine overhead.  Vectors are more explicit and strongly typed which is why they are fast, but this is also limiting.

In addition to the data type restriction, the Vector class has other restrictions that distinguish it from the Array class:

  • A Vector is a dense array. Unlike an Array, which may have values in indices 0 and 7 even if there are no values in positions 1 through 6, a Vector must have a value (or null) in each index.
  • A Vector can optionally be fixed-length, meaning the number of elements it contains can’t change.
  • Access to a Vector’s elements is bounds-checked. You can never read a value from an index greater than the final element (length - 1). You can never set a value with an index more than one beyond the current final index (in other words, you can only set a value at an existing index or at index [length]).

 [ Vector docs  ]

ByteArray not only used Vectors heavily but did other optimizations that are always good to do, even though optimization is evil when you are working with precious client side resources ensuring an optimized base starting point can be a good thing.

So what did I do ?

  • I used bitwise operators as much as possible.
  • I replaced all Arrays with fixed length Vectors.
  • I used pre-incrementation rather than post-incrementation (thanks Joa for this one ;)).
  • I casted to int all my Vector indices access.
  • Other minor stuff you always do to optimize your code 

Other sources as well for even more optimization or shall I say efficient AS3:

Monday, May 18th, 2009

pyamf is pretty sweet for Flash remoting with Pythonic server side, but now we have two nicely done and integrated remoting kits for python on the server side.

amfast is a new remoting library  that looks to be as sweet as pyamf (where sweet == fast and useful).  I am checking out amfast now but the speed boost alone might be worth it.  For instance, working with real-time games, when you need static content you need to grab that quickly sometimes via a content service.  The faster that link the better. It also has Twisted integration which is great for networking and SQLAlchemy integration which is in my opinion the best ORM for python (pyamf has twisted, django, pylons, sqlalchemy as well)

amfast is well documented and has some great examples.  If you have the Python addiction, check it.

Description

  • AmFast is a Flash remoting framework for Python.
  • AmFast can use AMF to communicate between Python and Flash, Flex, and any other system that supports AMF.
  • AMF is a binary object serialization protocol used by Actionscript based applications.

Server Features

  • Support for NetConnection and RemoteObject RPC.
  • Support for Producer/Consumer ‘push’ messaging with HTTP polling, HTTP long-polling, and real-time HTTP streaming channels.
  • Support for authentication with NetConnection and RemoteObject.
  • Flexible Target mapping system to map message destinations to invokable Target objects.
  • Support for ChannelSets with multiple Channels to expose resources in different ways.
  • Built in Channels for CherryPy, Twisted Web, and plain WSGI.
  • Support for configurable Endpoints. Use AmFast’s built-in AMF encoder/decoder C-extension, or use an external AMF encoder/decoder, such as PyAmf for a pure-Python implementation.

AMF Encoder/Decoder Features

  • AMF0/AMF3 encoder/decoder written in C as a Python extension for speed.
  • More than 10x faster than the PyAmf encoder/decoder (even when using PyAmf’s optional C-extension).
  • Map custom classes with ClassDef objects for complete control over serialization/de-serialization.
  • Full support for IExternalizable objects.
  • Data persistence with SqlAlchemy including remotely-loadable lazy-loaded attributes.
  • Actionscript code generation from ClassDef objects.
Thursday, April 23rd, 2009

@bartek from everydayflash.com is an amazing 3d flash designer and developer.  The latest from everydayflash is a sample using MouseConstraint in JiglibFlash the 3d physics engine for all major flash 3d engines.

It is easy to see how the latest version of JiglibFlash with MouseConstraint will be heavily influencing flash games and applications very soon. This is a very smooth and quick demo that feels very responsive on the controls.  There are so many possible uses for JiglibFlash now that the MouseConstraint is available.  It will evolve further but this version seems ready to start integrating into many flash game and interactive ideas and projects. Even though it is still alpha it has been heavily cleaned up and a plugin system added by bartek for pluggable 3d render engines.  That is a huge step for 3d pipelines in flash.

Great work JiglibFlash team!

Thursday, April 9th, 2009

Well it appears ES4 path is dead officially and a new standard has been published replacing it, the ECMAScript Fifth Edition announced in Geneva, Switzerland and will be in place as fully tested and approved by all involved by the end of 2009. ES5 was previously known as ECMAScript 3.1 or an iteration of the ES3 standard that is what most JavaScript is based on in all browsers, and was previously competing with the ES4 newer standard that changed Javascript quite a bit but in many areas much better, in some areas it was bloated.

This revision of ECMA-262 will be known as ECMAScript, Fifth Edition. It was previously developed under the working name ECMAScript 3.1, which will no longer be used. ECMAScript is the scripting language that is used to create web pages with dynamic behavior. ECMAScript, which is more commonly known by the name JavaScript™, is an essential component of every web browser and the ECMAScript standard is one of the core standards that enable the existence of interoperable web applications on the World Wide Web.

ECMAScript Fifth Edition (ES5) was strongly guided by Crockford and Microsoft, which is different than the push for ES4 which is what ActionScript 3 is based on and was supported by Adobe and Mozilla.

However it seems everyone is happy and everyone is supporting this version to get things moving if you go by the ECMA Org quotes:

Industry Reaction

Brendan Eich, Mozilla CTO and creator of the JavaScript language, said “The Fifth Edition of ECMAScript makes real improvements based on browser innovation and collaboration in Ecma, which provides a solid foundation for further work in future editions.” Microsoft’s ECMAScript architect, Allen Wirfs-Brock, commented “We expect the Fifth Edition to benefit all web developers by helping improve browser interoperability and making enhanced scripting features broadly available.”

Peace.

I still have to read further into the ECMAScript 5 specification which was published, but there are some new interesting things.

One nice feature is the JSON object.  Right now you have to eval to use JSON in javascript in a browser but they now have JSON.parse(object) and JSON.stringify(object) which is standard and conveniently already wired into IE8 this way. This is based on the JSON2.js library by Douglas Crockford of Yahoo.

var jsObjString = "{\"memberNull\" : null, \"memberNum\" : 3, \"memberStr\" : \"StringJSON\", \"memberBool\" : true , \"memberObj\" : { \"mnum\" : 1, \"mbool\" : false}, \"memberX\" : {}, \"memberArray\" : [33, \"StringTst\",null,{}]";
var jsObjStringParsed = JSON.parse(jsObjString);
var jsObjStringBack = JSON.stringify(jsObjStringParsed);

Another feature is DOM prototypes which are useful and cool, which allow you to extend dom objects.

If you use javascript or are an actionscripter, not sure if Adobe will have ActionScript 4 go this way or if Alchemy has changed the flash player into a multi language VM now.  It will be fun to watch things progress but also if you are into javascript it seems this standard, ES5, will be it by the end of the year.  And probably since IE8 already supports it, in all new browser by then as well.  It will probably take 1-2 years before browser saturation makes this usable but if you are using standards that mimic this then there will be no change then, such as the JSON2.js library.

Sunday, April 5th, 2009

Torque3D seems to have full featured browser surfaces that you can use in the 3d engine seamlessly, see the video below (at :38). This is amazing stuff.

Making games that integrate content from the web is especially required these days.  It is a difficult thing to do within the 3d render because of all the plugins, styling etc that needs to be rendered on a 3d surface.  Well Torque3D has a killer feature in that it supports entirely full features browser render on a 3d surface.  So now you can integrate html content, flash video etc in your game easily.

You can play content in flash player content easily and have stripped down html but it is limited, you can play videos and have content in Unity3d but it is limited, even larger engines like Unreal 3 have difficulty handling flash and html content.  If this is a good implementation Torque3D has a killer feature on their hands! Flash is commonly used as user interface elements and content within games but it can be challenging.  This is pretty exciting if it works as advertised. Think of how cool all the little consoles, mini-games and controls in 3d games could be in flash easily.

See at :38 in the video…


GDC 2009 – Torque 3D Web Demo from GarageGames on Vimeo.

Saturday, March 28th, 2009

Away3D was updated to Flash 10 earlier this month.  Flooded with final semester, massive workload and all the conferences #swsx, #gdc, #mix09 etc I missed the announcement.  

It is looking pretty sweet with this mustang demo showing off the update.  Pixel bender has provided a performance update for effects that shows nicely here.

The above demo shows some of what is possible with the update: normalmapping with ambient, diffuse and correctly normalised specular shading, without the need for layers. As if that’s not enough, a further Pixel Bender shader is applied to the view to create a HDR (High Dynamic Range) effect on the highlights, something usually seen in much more 3d-rich console games. Special thanx go to Eddie Carbinfor donating an excellent normalmapped mustang model, and David Lenaerts for writing the HDR filter.

Airtight Interactive did a comparison a while back where FP10 rendering was faster against the olde version of Away3D, this update may change that will have to take a look.  All away3d needs is a designer :)

Saturday, March 28th, 2009

 Director 11.5 was quietly released last week at GDC with a few nice upgrades.

  • The sound library is updated to Dolby surround 5.1. 
  • Director 11 now supports ByteArray and binary data handling. 
  • It also states support for Flash 9 swfs. Previously Director 11 did not work well/atall with AS3/Flash 9 swfs which made it nearly useless.
  • Streaming support for audio and video with RTMP (red5, flash media server, etc)
  • Updated video support
  • Bitmap and audio filters for video

I still think Director is on decline unless they open up the development platform, lose Lingo and allow a real IDE to develop with. So frustrating being restrained to that IDE that is not very flexible and cumbersome to extend and code in when you compare it with cutting edge IDEs like Unity3D or open source flash IDEs like FlashDevelop. It has been completely removed from our workflow for some time due to new Flash 2.5D engines such as papervision 3d, away 3d and sandy or for more immersive hardware rendered 3d, unity3d. 

 

Adobe Director version comparison chart
Product features Director 11.5 Director 11 Director MX 2004
Support for 5.1 surround sound Yes No No
Real-time audio mixing Yes No No
Audio effects and DSP filters Yes No No
H.264 MPEG-4, FLV, and F4V video support Yes No No
Streaming support for audio and video with RTMP Yes No No
Ability to apply audio filters on a video Yes No No
Ability to apply bitmap filters on a video Yes No No
Google SketchUp file import Yes No No
Enhanced physics engine with support for dynamic concave rigid bodies Yes No No
ByteArray datatype for binary data handling Yes No No
Multiple undo/redo for text editors Yes No No
Text rendering and performance optimization Yes No No
Cross-domain policy support for Adobe Shockwave® Player Yes No No
Mac OS X Leopard support Yes No No
Unicode support Yes Yes No
Microsoft DirectX 9 support Yes Yes No
Advanced physics engine with included NVIDIA® PhysX™ support Yes Yes No
JavaScript dictionary Yes Yes No
Code snippets Yes Yes No
Bitmap filters Yes Yes No
Microsoft® Windows Vista® support Yes Yes No
Support for Intel® based Macs Yes Yes No
Cross-platform projector publishing Yes Yes Yes
Web publishing with Adobe Shockwave Player Yes Yes Yes
Support for more than 40 video, audio, and image file formats, including SWF Yes Yes Yes