Wednesday, December 28, 2011

Javascript Sine Curve Animation

The winds of change are in the air and it seems that you simply must know javascript to remain relevant. I've been keeping myself busy with a few o'reilly books lately. Here's an exercise from JavaScript Graphics Supercharged:



Pretty neat, eh?

JavaScript by itself isn't all that tricky. However, I've found the dom and cross-browser compatibility incredibly annoying. It also seems that there are thousands of frameworks and libraries floating around that people swear by. It's hard to tell who is truly touting the best practice. This results in learning way more conventions and syntaxes than should be necessary.

Tuesday, October 18, 2011

Scrum: Retrospective Questions

Clinton Keith, in Agile Game Development with Scrum (pg 79), lists the three questions that should be asked in every retrospective as:

1) What things should we stop doing?

2) What should we start doing?

3) What is working well that we should continue doing?

These are solid questions that are straight to the point and that match the simplicity of the Daily Scrum questions. However, what do you do if there aren't any contributions? After reading this article on Gamasutra, I got to thinking about just that. I've been in meetings that aren't active and they're a drag. Therefore, I believe that having a few canned questions to get things going isn't a bad idea. This is especially true for teams that are new to scrum.

Before I dive too deep, I recommend the above article to anyone that is looking for some good advice on how to run an interview. I'll explain how this ties into sprint reviews in a second. In the article, Jeremy Gaffney offers some ideas that will help folks being interviewed as well as those that conduct them.

Here were my takeaways:


-First, the quality of the interview is in the quality of the questions that you ask.

-Second, the value of a candidate is found in what they find valuable.



From the article...

“Ask questions for which there are no uninteresting answers,” Gaffney said. For example, a producer may ask, “Who’s the last person you fired?” He explained, “What you care about is digging out an interesting [aspect] of their past.”


Asking someone who they've fired is an interesting approach to reach the core of a candidate. However, my vote would be to keep things slightly more positive. You could try something like:

- What was your biggest success and how would you go about replicating it?

- Can you give me an example of a situation where you were certain that you were going to miss a deadline and what you did to dampen the impact?

- What are the most useful habits that a team member can exhibit?


Now then, this all parallels into a retrospective because the same rules apply. Let's think about what we're trying to get out of the retrospective in the first place. Well, this ceremony is the closure of the feedback loop. It's only logical that we'd want to inspect what occurred during the iteration to see if there were any lessons learned.

- What did we learn?


That question by itself isn't going to make the conversation flood in. How about...

- While building the onboarding tutorial, were there any aspects that you would like to revisit in the next iteration?

or

- While building the onboarding tutorial, what optimizations did you make to your workflow that helped you along the way?


Use the Sprint Backlog as the springboard to target meaningful data points. The goal being to key in on specifics with an eye on finding value that the project or team will benefit from. Asking quality questions can surface improvement issues/technical debt, new useful techniques, bottlenecks, and product insights. A good retrospective will have each and every team member walk away with a new technique to try or insights on how to improve efficiency. To create a culture of sharing is essential in building a successful team.

RE: canned retrospective questions, here are some to get you going!

While doing Sprint Backlog Item (SBI), what aspect was most challenging and why? What would make it less?

If you had to rebuild SBI, what approach would you take next time around?

What beneficial optimization to workflow did you make during this sprint?

What new resources would have improved our production cycle?

Were there any heavy refactors necessary this time around? If so, why?

Did you read any informative articles that inspired some change which directly effected this sprint?

Analyzing the problems and impediments from last sprint, have any similar issues resurfaced this time around?


I think you get the point. The goal is to get the conversation moving and to see what we can learn from one another and, thus, help us all make life that much easier.

Tuesday, October 4, 2011

SCRUM 101

Here's a quick presentation that I put together that discusses the history of SCRUM and its mechanics. It's ment as an overview and not the definitive explanation.

Whether you're a software engineer, a QA tester, a producer, or an executive that manages development you would benefit greatly by implementing some sort of Agile project management.

I hope you find it useful.

Wednesday, July 20, 2011

Out of Memory Error in Flash Builder 4

Out of memory errors are no fun! Perhaps I can help you fix yours?

Problem: You're developing an AIR application with a significant (150+) number of embedded assets and you're using FB4. Eventually, you'll add the straw that breaks the camel's (compiler's) back and you'll start getting:

An internal error occurred during: "Building workspace". Java heap space

Solution: The issue is with FB4's compiler and the way it handles large numbers of [embed]s... The only way around the OOM error is to off load the assets to run time, rather than compile time.

In my project, I created separate swfs for imgs, snd/music, CSVs and loaded them @ run time which contained static embeds. No more OOM! W00t!

Another good idea, you can also bump up the default memory allocations for FB/Eclipse in general. Here's a description on how to do that.

Lastly, here's a quick and dirty AssetMgr class that will load in a swf and give access to its contents. This will get you started on the aforementioned solution. (Much thanks to Ian's response on Stackoverflow for giving me this suggestion!)



package{

import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.events.Event;
import flash.net.URLRequest;
import flash.system.ApplicationDomain;


/**
* <p>This Asset Manager class loads a swf and gives access to its embeded class objects.</p>
*
* <p>AUTHOR : Jason Leon</p>
* <p>CREATION DATE : July 21, 2011</p>
*
*/

public class AssetMgr {
private var _appDomains:Array = [];
private static var _instance:AssetMgr;
private var _ready:Boolean = false;
// path to asset lib
private const SWF_PATH:String = "swf/AssetLIB.swf";

public function AssetMgr(){};

/*********************************************************
* retrieve instance
* *****************************/
public static function getInstance():AssetMgr {
return _instance = (_instance ? _instance : new AssetMgr()) as AssetMgr;
}

/*********************************************************
* initialize
* @Desc: must complete before assets are accessed
* *****************************/
public function init () : void {
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleAssetsLoaded);

var request:URLRequest = new URLRequest(SWF_PATH);
loader.load(request);
}

/*********************************************************
* Handle payload
* @Desc: saves Loader data to _appDomains obj
* *****************************/
private function handleAssetsLoaded (event:Event) : void {
var appDomain:ApplicationDomain = LoaderInfo(event.target).applicationDomain;
_appDomains[SWF_PATH] = appDomain;
_ready = true;
}

/*********************************************************
* Request Assets from saved Loader data
* @Param 1: assetName is the literal name of the asset you want to access
* @Param 2: fileName is the literal name of the loader assets (example: SWF_PATH)
* *****************************/
public function getAsset (assetName:String, fileName:String) : Class {
if (_ready) {
var assetFileAppDomain:ApplicationDomain = ApplicationDomain(_appDomains[fileName]);
var assetClassDefinition:Class = assetFileAppDomain.getDefinition(assetName) as Class;
return assetClassDefinition;
} else {
throw new Error("initialization has not completed");
}
}
}
}


Is this not what you're after? You may also want to look into this thread on adobe's site for your OOM needs... It was not the issue that I ran into but did help narrow it down so I could find my solution.

[NOTE: There is a cap to how many [embed] tags you can include in each swf library you create. I haven't bothered to count to see what the limit is but I've certainly run across it so beware.]

Wednesday, March 30, 2011

Wednesday, January 26, 2011

FlashDevelop, Flash Builder 4, & SVN

Recently, I began work on a project that originated via an engineer utilizing FlashDevelop. I personally love FlashDevelop (open-source all the way!) but, since my move to Mac, I have been unwilling to use it in VM and instead have gone with Flash Builder 4.

FB4 does not recognize FlashDevelop projects which makes getting started a little challenging. So after I pulled the codebase from SVN, I was left with a bit of a conundrum. FB4 wouldn't recognize the file that I wanted to select as the default application. How do I compile?

I googled around and couldn't find any immediately relevant help articles. Here is what I did, hope it helps:

- Create a new ActionScript project in FlashBuilder and set name and location (workspace) to be identical to your repository checkout.

- Delete the code-generated default class file

- Open the .actionScriptProperties file

- Edit the applications node with:

<applications>
<application path="your-desired-class-file-name.as"/>
</applications>

- FB4 should now allow you to compile

Tuesday, January 25, 2011

Sun Flares in AS3

Here's a little AS3 mimic of undulating sun flares using the drawing API. There are two different drawing styles, pointed or curved, which are modified via the ALT view btn. The slider controls the strength of the rays.

Tuesday, January 4, 2011

Chroma Key Experiment



I did this experiment about a year and a half ago. I wanted to see if I could set up a green screen, capture a human walk cycle, and implement it into a flash game.

[be sure to click on the game screen before attempting to move the avatar]

http://www.jasonleon.com/tests/chromakey/

The process I used to extract the background for my walk cycle is called Chroma key compositing. It's the same trick that the local news uses to show the weather (wo)man in front of a weekly forecast.

I made my green screen background with green felt. Just a tip, you'll need a ton of light sources. I had the equivalent of 4 flood lights which wasn't powerful enough to eliminate all of the shadows. Shadow was what caused the distortion that surrounds the edges of my avatar.

All in all, fun project. I never really had time to mess with it further but there are certainly some neat concepts that could come from it.

About Me

I produce and engineer games and applications. | Portfolio | LinkedIn