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

Post image of Adobe Scout and how to use ANT to enable Advanced Telemetry in FDT
Filed in ACTIONSCRIPT 3.0 , ADOBE FLASH PLATFORM , EXAMPLES , FDT , FEATURED , FRAMEWORKS , GENERAL 16 comments

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

Creative Commons License
Adobe Scout and how to use ANT to enable Advanced Telemetry in FDT by David Gamez, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.5 Mexico License.

Posted by Dave Gamez   @   5 December 2012 16 comments
Tags : , , , , , , , ,

Share This Post

RSS Digg Twitter StumbleUpon Delicious Technorati

16 Comments

Comments
Dec 7, 2012
10:49 am
#1 Durss :

Wow i can’t thank you enough for that!
Good job !!

Author Dec 7, 2012
10:55 am
#2 Dave Gamez :

Hello Durss,

Thanks, glad to help!

Cheers,
Dave

Dec 22, 2012
7:10 am
#3 Karthik :

Since we are using “AIR SDK with ASC 2.0″ can’t we avoid the python script? and use the compiler argument?

Author Dec 23, 2012
2:18 am
#4 Dave Gamez :

Hello Karthik,

Yes once you’re using the ASC 2.0 you can use the -advanced-telemetry argument in the compiler.
Here’s How to use ASC 2.0 in FDT

Cheers,
Dave

Jan 7, 2013
4:27 pm

I just ran scout on your random circles example at http://examples.swfgeek.net/flash/advancedtelemetry/flashdisplay/ using Chrome on a macbook pro. It looks like most of the time is spent updating the text fields of your frame rate meter!

Cheers,
Mark S

Jan 11, 2013
5:36 am
#6 Jose G :

When i try to execute the above downloadable example in my machine i was getting such an error
02. Add Advanced Telemetry:
[exec] File “add-opt-in.py”, line 98
[exec] print(“\nIf PASSWORD is provided, then a password will be required to view advanced telemetry in Monocle.”)
[exec] ^
[exec] TabError: inconsistent use of tabs and spaces in indentation

Jan 11, 2013
6:30 am
#7 Jose G :

Build Failed getting such error :-

BUILD FAILED
E:\Workspace\advanced_telemetry_ant_example\AdvancedTelemetryAntExample\ant_tasks\advanced_telemetry\advanced-telemetry.xml:79: E:\Workspace\advanced_telemetry_ant_example\AdvancedTelemetryAntExample\ant_tasks\advanced_telemetry is no workspace path.”

Jan 11, 2013
6:55 am
#8 Jose G :

when i remove the extra space in phyton(“add-opt-in.py”) file then it start working. but currently when i play the ant file, i was getting a white flash player open which does not contain anything, mean while when i open the “AdvancedTelemetryAntExample.swf” directly or through FDT debugger then the application load properly and work fine. but not getting any information on Adobe Scout telemetry.

Jan 28, 2013
3:20 am
#9 hexagon :

When trying to use the Ant target with a password I get the following error:

[exec] Traceback (most recent call last):
[exec] File “add-opt-in.py”, line 196, in
[exec] outputTelemetryTag(o, passwordClear)
[exec] File “add-opt-in.py”, line 97, in outputTelemetryTag
[exec] sha.update(passwordClear)
[exec] TypeError: Unicode-objects must be encoded before hashing

Any ideas?

Jan 28, 2013
6:01 am
#10 hexagon :

Nevermind! Figured it out. in the .py script change line 196 to:
outputTelemetryTag(o, passwordClear.encode(‘UTF-8′))

Jan 29, 2013
3:11 pm
#11 raj :

Hi,

how to do it in flash professional ?

Regards

Feb 15, 2013
4:19 pm
#12 petermd :

maybe worth mentioning, i made a simple java tool to add the telemetry tag so you don’t need to install python

https://github.com/petermd/chswf

thx for article

-peter

Author Feb 15, 2013
5:33 pm
#13 Dave Gamez :

Nice work Peter,

Thanks for sharing.

Cheers,
Dave

Author Feb 15, 2013
5:35 pm
#14 Dave Gamez :

Hi hexagon

Glad to see you sorted it out!

Cheers,
Dave

Author Feb 15, 2013
5:38 pm
#15 Dave Gamez :

Hello Mark,

It works on my machine ;)
Now seriously, thanks for noticing it i’ll take a look at the files to see what’s wrong and why isn’t returning anything.

Cheers,
Dave

Trackbacks to this post.
Leave a Comment

Previous Post
«
Next Post
»
Day 5 #Goblin #drawlloweenRaven #drawlloween Day 4 #ravenZombie Dog! for the Day 2 of #drawlloween #zombieDay 1 #Spider #drawlloween #3DChallenge accepted! going to give this one a go in #3D  #drawlloween #drawingchallengeHere is #TheWolfman #Halloween #ClassicMonstersSailor!Moon is for Moooonday!Sunny Sunday!
Delighted Black designed by Zenverse