Tom Krcha's FlashRealtime

Hey amigo!
I am Tom Krcha, Gaming Evangelist at Adobe. These are my notes


HOWTO: Join multiple SWF files into one with AIR for iOS

February 3rd, 2012

A while back, I promised to write some of the backstage tips that made it possible for Machinarium (1 GB sources!, 28 SWFs!) to run on an iPad with AIR, which requires only a single SWF.

One of the issues you run into is how to join/concatenate 28 SWFs into single SWF. I wrote an article about using SWC libraries for that here Compiling big Flash/AIR projects with lot of SWFs for iOS. This sometimes works, but very often the workflow is more complex and you want to keep the same SWF files for Android and iOS and use them at least in a bit similar way. On Android you can however load SWF files at the runtime and this is very effective for the memory usage. On iOS you have to watch this, especially when you have everything in a single SWF. So, ideally you place all assets into separate files and load them and dispose them on-demand. But that’s more of a general problem you should keep in mind – every asset that doesn’t contain AS3 (pictures, videos, music), put aside. But back to the topic.

Now comes the magic by David ‘Oldes’ Oliva (the lead developer of Machinarium) from Amanita Design, who made it all possible and wrote a script which can be used for joining SWFs together.

Note: This solution allows you to use multiple SWF files containing AS3 script and logic in each of them, not only for assets. That’s why it’s so powerful.

*prerequisite: you’ll need to understand how to work with the command-line on Mac or Windows.

Steps:

1) Prepare SWFs like you were using them the standard way, but instead of loading them dynamically via the Loader class, SWFLoader or a similar mechanism, each SWF has to be Class (or contain at least one, can contain more), which you can instantiate. That’s because once you join all SWFs together, you will be instantiating it’s contents, not loading.

2) Download the samples package rswf-join-example.7z (for unzipping use 7-zip compatible tool) / UPDATE: the file has been updated to support bitmap reduction

3) Download the REBOL script view environment http://www.rebol.com/download-view.html

Using the tool:

4) Navigate to the samples folder. There are three scripts that you might want adjust to fit your workflow:

compile-and-run.r
- this is the rebol script that does part of the job and runs Game.bat

Game.bat
- here you want to adjust the path to your Flex/AIR SDK so it points to the adl command

cd ./public/
/path/to/AIR_SDK/bin/adl Game.xml

Game.rswf
- here you specify the SWFs you want to compile together, in the samples, you can see FLAs and it’s content to understand how to prepare your own workflow.

5) Run the compilation (of course change the path to rebol to the directory, where you have downloaded it or stored it)

/path/to/REBOL/rebol compile-and-run.r

*At this point, if you get permission denied on some of the files, make sure all the processing files have the proper rights; you can set the rights using chmod, for instance:

chmod 777 filename.bat

also 777 is pretty open rule, so consider 755 or 775 or similar.

6) Once the compilation is done, the SWF will open and you can successfully use it with adt command from the Flex/AIR SDK to compile the final IPA for iOS.

If you have any questions, please ask in the comments.

Good luck!

Interview with the creator of BlackSun (Stage3D game)

January 30th, 2012

BlackSun is the latest game by guys from Aerys lead by Jean-Marc Le Roux. They are based in Paris, France and stay behind the Minko (Stage3D based 3D engine).

Play BlackSun!

Tom: BlackSun is an amazing project, how long did it take to build it in terms of development + art?

Jean-Marc: Thank you! It took us 3 months with the equivalent of 3 people full time to get what we have here.
2 engineers and 1 artist were involved.

Those 3 months include a lot of things such as the original development of the artificial intelligence framework.
I think we could do the same job with only half the time (1.5 month) today.

Tom: How big is the project in size and what would you recommend others to shrink their projects in terms of MBs?

Jean-Marc: The game currently weights 9.6MB and is expected to be less than 7MB in the next release.
We believe the final size of a web application is critical to make sure you can target the biggest audience possible.

To shrink the project, we used the MK file format for the geometry and the animations.
It’s a custom file format optimized for 3D content for the web.

It features exclusive 3D compression algorithms. It’s much more complicated – but much more effective – than ZIP and
other general purpose compression algorithms. You can get a compression ratio up to 98% and it features both lossy and lossless compression.
It’s a real game changer. Some assets weight close to 10MB with their original format (Collada) but only 600KB when
they are properly compressed using our algorithm.

The MK file format will be released with Minko 2 and will be free and open source.
We will provide tools to publish 3D content to the MK file format, and you can expect even better compression rates
in a future realease.

Tom: What do you think is the most unique thing in BlackSun?

Jean-Marc: The atmosphere.

We spent a lot of time trying to create a very dark and vivid experience for the player.
This is achieved mainly with the rendering and post-processing effects.

The HDR bloom post-process really makes a big difference in terms of how you feel the 3D.
It makes it both warmer and more intense.
I like to say it’s a bit surrealistic.

Those effects were implemented with ActionScript shaders. It’s an exclusive Minko feature that makes it possible
to program the graphics hardware with ActionScript. Without this feature, we would have to write, maintain and debug thousands of
assembly lines.

I think a lot of Flash developers want to play with the GPU because they understand that it’s the one thing that gives your project original. And ActionScript shaders are really easy to work with. When we invented this feature we were really happy because it makes it easy for any
Flash developer to program the GPU with nothing more than good old ActionScript code.

Tom: Why have you chosen Flash 11 to build the game?

Jean-Marc: The penetration rate first. I think 3D on the web means it must be an accessible experience.
Flash 11 is still the only platform to do that, even more regarding 3D content.

Flash 11 especially targets the developers as they can now work with the GPU. This is why we developed Minko too: make it easier to work with the graphics hardware.

Tom: BlackSun is a sort of first person shooter, why have you rather chosen third person orthographic view?

Jean-Marc: Mouse lock was not available at the time. And we think the first person shooter is not really nice to play
with in a web experience.

It’s also a gameplay requirement. Some of the features we are adding right now work best with a 3rd person view.

Tom: How many levels are included in BlackSun? Do you have a level builder?

Jean-Marc: For now just one. It’s meant to be a “big technical experiment” more than a full game.
But if the experiment is successful, we will add more content. I think it can be a nice playground to show the latest Minko features.

We don’t have a level builder per say: we use Minko Studio. One of the new tools that will be released with Minko 2. It makes it easy to import 3D assets, build a scene and export it using the MK format. It’s really easy to use: you import the work of the artist, and you get a compressed and optimized MK file.

Tom: What do you think are the next steps with BlackSun, where do you see it’s future from now on?

Jean-Marc: The current preview still uses Minko 1. So the next step will be another technical preview working with Minko 2. We are working hard to add new features provided by Minko 2 such as omni-directional projected shadows and real-time hardware accelerated particles.

This new preview will also include the artificial intelligence so you’ll finally be able to kill some Nazi aliens!

Tom: Below we can see two screenshots of an application called Minko ShaderLab. Can you elaborate?

Jean-Marc: The ShaderLab is a very cool web application to create, debug and preview hardware accelerated rendering effects. We thought being able to program the GPU with ActionScript was already a huge step forward. But being able to program the GPU without even programing is even better!


Some shaders are easier to do with code, but others really take advantage of this kind of visual
programing environment.

The application will be available soon so… stay tuned!

Scorekeeper for iOS in AIR

January 18th, 2012

Want to keep scores during the gameplay? Money, points, score per player.

Make sure you check out Scorekeeper for iOS in Adobe AIR by Matt Rix. (Uses renderMode: CPU)
Very well and nicely executed idea.

Download Scorekeeper from Apple App Store

Watch the trailer:

Speaking at gotoAndSki 2012 Switzerland

January 16th, 2012

I am planning to speak in 2 weeks at gotoAndSki() conference in Swiss Alps about some of the new gaming features coming to Flash.

From Thursday 26th till Saturday 28th 2012.

It’s supposed to be a cool gathering with great people coming, attendees and speakers as well. [ SPEAKERS LINE-UP ]

The event is in Stechelberg (Lauterbrunnen valley), make sure you take your snowboard or skies :)

My session is titled Flash Gaming Love: What’s hot and coming and I am going to cover the latest stuff coming to Flash, especially for gaming, show some recent cool stuff that you might have read about, but seeing and experiencing it live is always way better.

So looking forward to catch up with those who are coming. Do not hesitate to come, this is going to rock!

Spaced Away for iPad in AIR

January 10th, 2012

Like to wander the universe? Checkout this nice game Spaced Away for iPad by Falanxia gaming studio from Prague.

Download the game from App Store.

The game is using GPU render mode and DisplayList for rendering.

Watch the trailer:

Screenshots: