Adobe Scout and how to use ANT to enable Advanced Telemetry in FDT

Hello there,

So as you might have heard by now adobe just launched the Game Developer Tools in their Creative Cloud including the Adobe Gaming SDK 1.0 which includes the latest Adobe Flash platforms tools to get started creating cross-platform desktop and mobile games.

The SDK contains the following:

  • The AIR SDK 3.5 for compiling and packaging your mobile (AIR) and web (Flash Player) based games.
  • Native Extensions (ANE) Beta including extensions for iOS Game center, Product Store, SOcial, StageAD, BetaTesting.
  • Starling The 2D (Stage3D) open-source framework.
  • Feathers The 2D (Stage3D) open-source UI component framework.
  • Away3D The 3D open-source framework to power your 3D games.
  • ATF Tools Command-line utilities for the creation of ATF ( compressed textures) for Stage3D
  • Samples 3 Flash Builder 4.7 example Projects that use a combination of the tools included in the SDK.

Alongside the release of this SDK Adobe also released the first public beta of Adobe Scout (previously codenamed Monocle) the next-generation advanced profiling tool for Flash Player and AIR.

Quoting Adobe:

“Adobe Scout will revolutionize the way developers profile and optimize ActionScript based content. For the first time, developers have access to very granular information about CPU and GPU rendering, network or ActionScript stack.”

Which lead us to the second part of this post

Using ANT to enable Advanced Telemetry in FDT

So if you follow me on twitter or are a frequent reader of this blog you must know by  now that my weapon of choice for Flash Platform projects is FDT  so i wanted  to try the advanced features of Adobe Scout in my FDT projects, in order to use those advanced features Scout relies on the telemetry feature that was introduced in Flash Player 11.4 and Adobe AIR 3.4. This feature gathers detailed information about the internals of the Flash runtime, as well as the ActionScript code that it executes, and sends it all to Scout. To access all the data that is available, such as information on your ActionScript code and detailed information about DisplayList rendering and Stage3D, you need to enable advanced telemetry on your SWF.

If You’re a Flash Builder 4.7 user the enable advanced telemetry is built in so all you need to do is to click a checkbox in order to enable it. The FDT is currently working to implement an advanced telemetry option in the FDT IDE. But being the obsessive folk that i am i wanted to try those features “RIGHT NOW!” so i build a little ANT task file that enables advanced telemetry in your SWF by using a Python script (add-opt-in.py).

Heres how to use it:

To use this ANT task You need to have the following components:

1.- At least Adobe Flex 4.6 SDK with AIR 3.4 or the Flash Player 11.4.
Adobe Scout desktop application. You can find the Adobe Scout and the latest AIR SDK at:
http://gaming.adobe.com/

2.- In order to run the add-opt-in.py script  you’ll need to have python installed (I’m using Python 2.7.3 Mac OS X 64-bit/32-bit x86-64/i386)

Download Python at:
http://www.python.org/download/

3.- You can download or fork the add-opt-in.py script (it’s already included in this project in the scripts folder)  from:
https://github.com/adamcath/telemetry-utils

4.- Learn more about Adobe Scout reading the “Getting started with Adobe Scout” article by Thibault Imbert:
http://www.adobe.com/devnet/flashruntimes/articles/adobe-scout-getting-started.html

Here’s the ANT task project:

The Ant project has instructions and comments on how to use each of the tasks.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!--?xml version="1.0" encoding="UTF-8"?-->
<?xml version="1.0" encoding="UTF-8"?>
<project name="Advanced Telemetry" default="03. Run Application">
	<!--/////////////////////// Project Properies //////////////////////-->
	<!-- Your Project's name -->
	<property name="project_name" value="AdvancedTelemetryAntExample"/>
	<!-- Your Project's source folder. -->
	<property name="src_dir" value="${basedir}/../../src/classes"/>
	<!-- Your Project's deploy folder. -->
	<property name="deploy.dir" value="${basedir}/../../bin"/>
	<!-- Your Project's script folder (where your Python Script is). -->
	<property name="scripts_dir" value="${basedir}/scripts"/>
	<!-- Path to the 'Main' or 'Document' class for your .SWF file.-->
	<property name="main_class" value= "${src_dir}/com/swfgeek/test/AdvancedTelemetryAntExample.as"/>
	<!-- Flag whether to compile the SWF for debugging.-->
	<property name="debug_enabled" value="false"/>
	<!-- The name of your swf file.-->
	<property name="swf_name" value="${deploy.dir}/AdvancedTelemetryAntExample"/>
	<!-- The launcher you'll be using once your SWF is compiled.
	The below values are applicable when using the swflauncher argument:
		External SWF Viewer
		Adobe Flash Player
		Browser
		Internal SWF Viewer
		AIR Debug Launcher -->
	<property name="launcher" value="Adobe Flash Player"/>
 
	<!-- The "Build SWF File" task will compile your SWF and add it to your deploy directory.-->
	<target name="01.Build SWF File">
		<fdt.launch.application 
			projectname="${project_name}" 
			mainclass="${main_class}" 
			debug="${debug_enabled}"  
    		target="${swf_name}.swf" 
    		startswf="false" 
    		swflauncher="${launcher}"/>
	</target>
 
	<!-- The "Add Advanced Telemetry" task will execute the add-opt-in.py thon script on  your SWF and add the  EnableTelemetry tag to for use with Adobe Scout (You can also run this task if you've already compiled the SWF).
	When adding [password] just after the ${swf_name}.swf advanced telemetry will only be visible
	if a matching password is entered in Adobe Scout. -->
	<target name="02. Add Advanced Telemetry"  depends="01.Build SWF File">
		<exec dir="${scripts_dir}" executable="python" failonerror="true">
		    <arg line="add-opt-in.py ${swf_name}.swf" />
		</exec>
	</target>
 
	<!-- The "Run Application" task is the default in your ANT project and will compile, add telemetry and run your SWF. Once your SWF is running you'll be able to see the Advanced Telemetry options in Adobe Scout.-->
	<target name="03. Run Application" depends="02. Add Advanced Telemetry">
		<fdt.loadProjectProperties/>
		<fdt.startSwf projectname="${project_name}" swflocation="${swf_name}.swf" swflauncher="${launcher}" />
	</target>
</project>

Examples

Here are the examples with advanced telemetry enabled, you can open both this SWFs in your browser and if you have Adobe Scout opened you’ll see the the advanced telemetry information the file outputs to Scout.

Starling Example (with a cool animated character stolen from Chris Georgenes).
Flash Display Example (just random color circles)

Here is the zipped project including the AdvancedTelemetryANT Project and the source code for compiling both examples:

Advanced Telemetry ANT Example Project

Author: Dave Gamez

Digital Craftsman from México and have more than 14 years of experience both in design and development in the digital field. I currently work in web, desktop, mobile and illustration projects alike and spend my time between being Technology Director at Team-O a Digital Studio I co-founded with Cecy Meade and doing consultancy work, when time allows it I like to experiment and tinker with code, animation and illustration.