Introducing Starling

I am excited to introduce today a new project we have been working on, called "Starling". So what is it ?

Starling is a 2D framework for game development developed in collaboration with the Austrian company Gamua (already behind the Sparrow-Framework on iOS), running on top of Stage3D (Molehill). It allows developers to leverage the power of the GPU without diving into the low-level details of the Stage3D APIs (available in Flash Player 11 and Adobe AIR 3). I am convinced that most of Flash developers will love this initiative, as most developers would like to leverage the GPU while reusing concepts like an event model, a display list, movieclips, sprites, etc.

Most of you, who had a look at the Stage3D APIs understand that this can be complex sometimes. So instead of writing 60 lines of code to draw a textured quad.

If you want to learn more about Starling, check the little book (Introducing Starling - 112 pages) I wrote about it, you can download it from the link below, it covers many concepts to get started with Starling :

Actually we could, but is there really value doing so ? Once you will try Starling, you will notice how easy it is to use, it feels very natural and simple. Doing so would also mean we would kind of deprecate the display list, which will also be useful for “some” things.

It would not be necessarily faster, and because it would be native, it would be harder to update things as always. Also, this is the model you find on other platforms like iOS or Android, all you have there are GPU APis and you have layers on top, abstracting those.

Also, the community can then participate to such frameworks, fork them, and shape them the way they want. Which is impossible to do if done natively, people are locked and cannot adapt or change things.

Some questions:
- Which one is better for game development: using full blitting or Starling?
- Which one is faster, normal blitting or Starling, especially when the Stage3D uses the software rendering instead of hardware rendering?

- Which one is better for game development: using full blitting or Starling?

Starling allows you to use a completely GPU accelerated graphic pipeline. You are very likely to be able to do more and using low CPU usage by using Starling. To port your game on mobile too, through Starling, you will get the best performance.

- Which one is faster, normal blitting or Starling, especially when the Stage3D uses the software rendering instead of hardware rendering?

In our tests, we have seen Stage3D software fallback consume more CPU usage, but bringing a 2x performance improvement over the traditional display list (CPU) rasterizer.

I disagree @tomsamson, I think the FlashPlayer team have done the right thing here.

Of course it would be nice to have all the traditional display list content out there instantly GPU accelerated in FP11, but I imagine this would create a backward compatibility debugging hell-scenario for Adobe. Thibault’s response in comment 15 makes a lot of sense to me.

Just played with this library and it’s very slick. Friendly and fast. Love the build-in pivotX/Y.
I’m just missing an API for BitmapFilters…. I’m using those filters a lot in my projects and they always take away precious fps, so it would be nice if there was some way to put in filters without losing fps ( through the API that you normally use with DisplayObjects i.e. *.filters = [filtera, filterb]; ). Otherwise an internal function that takes the bounds of a filter and adds it to the Bitmap i.e. BitmapData. generateFilterRect(); Ah well… it’s an awesome step forwards from the low-level AGAL stuff. Keep up the good work.

Are there any performance strategies for dealing with large numbers of objects (like moving 10000 unchanging circle images around the screen)? I’m finding that with large quantities of small objects, blitting the old fashioned way actually comes out ahead. Of course, as soon as I move up to larger objects, Starling wins easily, taking no hit as objects get larger. ND2D has some interesting strategies for optimizing this type of thing, and I’m wondering if there’s anything similar in Starling. I tried using RenderTexture.drawBundled(), but that seemed to come out fairly close to where I was by simply adding all of the objects to the Starling display list and moving them around. Any suggestions?

Your team has done an excellent job making this API easy to get going with!

Thibault, I have one tiny detail you might want to add to the getting started instructions:
- If you are developing an AIR App, set the render mode to GPU. Otherwise you’ll get a “wrong wmode” alert. (Took me a couple of hours to figure out)

And a question: Why are you targeting 4.5 SDK (4.5.0.20967) instead of the newer stable version?

Good point. For this specific use case you mentioned, yes it could be optimized. This is something we discussed with Daniel, Starling could reuse the same vertex/index buffer instead of creating multiple ones if objects are the same. Daniel, did some tests and had a 20% performance improvement but was not super happy about the design he would end up with.

@John Davies, who said this:
“I disagree @tomsamson, I think the FlashPlayer team have done the right thing here.
Of course it would be nice to have all the traditional display list content out there instantly GPU accelerated in FP11, but I imagine this would create a backward compatibility debugging hell-scenario for Adobe.
”

That´s what they have to do if they want to keep the majority of the flash designer user base around and that´s also what they have to do if they want to make flash´s reputation not go completely to shit.

Let’s be realistic here:
Who knows about things like Starling: People like us visiting such sites, coding in AS3 etc.
The majority of the flash designer (not coder) base hates AS3 and would prefer to do things in visual workflow in the flash ide and code in something as simple to use as AS1/ JS.

Also of course the notion promoted by Adobe that one has to code in a lower level language like AS3 to get better performance is of course nonsense because the main performance bottleneck of flash was always the graphics handling side so addressing that brings the huge performance boost as we see.
In other technologies it doesn´t matter in which language one codes, one always gets massively better performance than in flash because all visual content is automatically hardware accelerated.

Besides that, Adobe´s approach means:
-All exisiting flash content has to be recreated to get any performance gain
this will not be done and hence:
-99.99% of the flash content on the web will for many years be performing as sucky as always and hence lead to more and more people saying flash´s performance still sucks.

Adobe has the task to allow people to recompile their existing AS1,2 and 3 content to run accelerated on the visual side and also that anything one does in visual workflow in flash ide should automatically get hardware accelerated behind the scenes.

If that isn´t delivered, well, blame yourself as flash´s reputation goes more and more downhill.

I’d really be interested in utilizing this for some blitting tests I am using for as3isolib.v2. The issue I have had in the past regarding these 2d to 3d utility libs are that they addresses “whole” objects just fine, but can’t seem to handle split textures.

If you have some time and would like put it through it’s paces with the as3isolib.v2, please let me know. I love to see what kind of performance boosts it would give.

Automatically HW accelerate existing content is not likely to work. We cannot magically HW accelerate all the content produced for the past 15 years and expect everything to work.

If you look at how modern platforms are working today, what they expose to you are GPU APIs and a layer is created on top of this to abstract the complexity if needed. Why do you think such libraries like Sparrow or Cocos2D exist on iOS for instance and are so popular ?

With such frameworks like Starling and others, people have the opportunity to easily transition to HW acceleration and soon, most content will use complete GPU acceleration and this is very likely to change a lot of things.

Finally, you mention people, which will not know about such frameworks, I am not sure about that. And if tools are needed, they will be relying on such frameworks behind the scenes, so I guess we need to have those pieces before building more on top

Good job, the library looks great.
My only concern to use it for production games is distribution. Would it be possible to have the library working transparently with earlier (10.x) version of the flash player using the display list? A bit like software rollback.

Hi, nice introduction, after playing with the API, I made tutorial on my blog to show how to implement pixels collision detection with starling. Feed back are welcome. here it is : http://www.cocoapp.eu/?p=342
cheers

HI, really nice work, currently I’m testing I’ve got a problem I’m trying to make something like AngryBirds where you move the whole view fallowing the ball all looks to be ok but the texture is just limitate to the initial view area so when I move I just see my current view moving but no the remaining area to the right, I think this is to save memory just drawing the available area of my texture but is there a way to update it so I can see the remaining area, I hope my question is clear. Regards.

[...] I gave a try to Starling, it is easy to use ! To get start go on this Thibault Imbert page’s blog, there are some examples and a book! Don’t forget to upgrade to the last version of the Flash [...]

[...] Starling is a display framework which allow developper to use flash player 11 stage 3D API. It replicate the display list structure to gpu, so it#8217;s pretty easy for any flash developper to get into it. Here is more info about Starling. [...]

[...] from O’Reilly by Thibault Imbert A few months ago, I was excited to share with you the birth of Starling, the new 2D GPU framework for Flash. I am happy to announce that the tutorial book I wrote is now [...]

[...] Starling is a display framework which allow developper to use flash player 11 stage 3D API. It replicate the display list structure to gpu, so it’s pretty easy for any flash developper to get into it. Here is more info about Starling. [...]