12Jan Functional Dreamers
In the Mayan calendar, 2012 is suppose to be a year of deep cleansing and rebirth for the world. In this spirit, I’ve been branching out into new fields and broadening my conceptual view of software development. The more I learn about programming fundamentals, the closer I get to a notion of which is considered “programming nirvana”. When I first started listening to people about this concept, I was very skeptical. All I was hearing was “blah blah no-variables blah higher-order-functions blah”. Like any programmer, my brain starts crashing as soon as I hear the statement that a language can be productive without variables. How is it possible to make anything meaningful without some internal state within methods and classes? Well, the answer to this is rather complex and outside the scope of this posting. The vehicle driving these concepts is called functional programming (FP), and it’s intrinsic highly abstract nature is usually very difficult for programmers to swallow. Going into the future though, I hope to post more about functional programming here. However, the real purpose of this article is to acknowledge some of the most astoundingly brilliant scientific minds that are changing my industry. I tip my hat to these gentlemen and scholars:
Haskell
![]() |
![]() |
![]() |
| Haskell B. Curry Father of Haskell foundations |
Simon Peyton-Jones Implemented Haskell GHC compiler |
Erik Meijer Major Supporter and an amazing teacher |
FP Geniuses
![]() |
![]() |
![]() |
| Rich Hickey Creator of Clojure and FP pioneer |
Joe Armstrong Erlang founder |
Martin Odersky The brain behind Scala |
![]() |
![]() |
![]() |
| Don Syme Inventor of F# |
John McCarthy Lisp and FP pioneer |
Conal Elliott Conceptualized Functional Reactive Programming |
Honestly, I cannot state my respect for the above individuals enough! They have invested an enormous amount of personal time into an ideal that they are crazily passionate about. Each one of them want to make software development better from both the coder’s standpoint and platform perspective. As a teaser to these principles, below is a video of Simon Peyton-Jones and Erik Meijer talking about their view of coding nirvana:
03Nov IsoHill – The Flash 11 isometric engine
I’m happy to release the first public version IsoHill, a Starling Flash 11 isometric engine. It’s still in heavy development, but it is more than functional at this point. I created this project as I was tired of the performance limitations of as3isolib. With that library, you could render maybe 300 sprites on an average machine. In this engine, you should be able to render over a thousand as well as anti-aliasing each element. Check out the link below for more information and download the source library. Please let me know your thoughts and how you would like to use the engine!

Get it at: IsoHill.com
23Oct Flash 11 – UDK and Unity arrive

With the advent of HTML5/WEBGL gaining popularity, Adobe knew it had to move fast. Within a matter of two years, they designed and implemented one of the largest platform updates I’ve seen in the industry- Flash Player 11. It sports direct GPU integration allowing for console quality games to be possible through the browser. If this wasn’t big enough news, they have been working with Unity and UDK to enable an export format from those [now] game tooling platforms. Below is a video of the Unreal Engine 3 running within the browser:
I’ll be spending the next couple weeks writing my own engine for Flash 11 and will update here when I have something working. The new API is not as easy compared to the standard display list or even Papervision for that matter, however it allows you almost total control over the GPU shader pipeline. While ActionScript 3 (AS3) can get the job done, I wonder how long before the haXe community starts implementing the new version. I’m super excited to experience such a radical new set of tools for game development!
Related external articles:
http://www.epicgames.com/news/unreal-engine-3-supports-adobe-flash/
http://blogs.unity3d.com/2011/02/27/unity-flash-3d-on-the-web/
20Jun In Review: SWF Protector 3
In this day and age, the importance of securing SWF executables seems to have become a prominent topic. The reason for this boils down to malicious hackers trying to develop sophisticated memory hacks to manipulate the Flash application or game at runtime. The only software package currently available to really mitigate such attacks comes from the company DCOMSOFT. I had some time over the weekend to play around with DCOMSOFT’s SWF Protector 3 which was released around two years ago.
The interface I found really intuitive, and it has a good set of configuration options to boot. In the latest release, it finally supports Flash Player 10 exported SWFs which is what I mostly deal with these days. After converting a handful of SWFs into the protected format, I ran a few benchmarks and found no problems with how the obfuscation and protection methods hinder the final exported AVM bytecode.
The icing on the cake for me was the ability to use the command line to run the application. Without this feature, I would not be able to integrate the application into the automated build scripts we use with ANT. The below instructions was from the help file and shows just how simple it was to implement:
You can use command line to avoid customizing settings manually. The following syntaxes present the meaning of each command:
Syntax:
swf_protector.exe file1 file2 … fileN Description
This command specifies the list of SWF files for protection in Simple mode with default settings.
Overall, I’m impressed the quality of the product and just how simple it is to use. However, I do not like the notion of encrypting and obfuscation code for just the sole purpose of hiding implementation. This aside, SWF Protector will help keep hackers from finding easy wins in memory loopups and critical points of integration with other SWFs or backend calls.

06Apr JAD Update: Social Games
I’ve decided that I’ve neglected my blog long enough and decided it was time for an update. Here we go *long breath*…. Within just the past couple years, I’ve moved from Michigan to San Francisco and have been working primary in building mobile and Facebook social games that have given rise in the gaming industry. I did a number of projects at Crowdstar including Hello City and Mighty Pirates, and now I’m working on the largest project yet in my career at a newer startup called Metamoki (created by Dave Maestri, founder of Mafia Wars). The game development industry in Silicon Valley is rather interesting on a couple of facets. In some ways, it’s repeating the game design that originated back in the DOS and Commodore days. On the other hand, there are mechanics that are new and ‘alien’ in nature. Of course I am referring to the “social” aspect of Facebook games. In some FB games, the meaning of social is almost laughable as it doesn’t really exist. Even the best games in the industry still do not compare to the social aspect of co-op gaming that is rather prevent now in modern commercial games. Recently, big names in the traditional gaming industry are starting their own studios in hopes of breaking into the market. It will be very interesting to see what happens within the next two years.
Aside from the industry as a whole, I’ve been busy writing my own isometric engine, data structures, tooling, and learning other languages to support my day-to-day work. As soon as I think I’ve built the fastest possible system, I always find one more way to make the performance that much faster. I’ve also come to understand computer science more on a fundamental level beyond languages. It really helps to know what is happening behind the scenes when using language core libraries… just because a language provides a core function doesn’t mean you should use it! I have written a great deal of code that basically does what Flash already provides, but the level of performance can reach an average of 2-10x improvement (which helps significantly). I’ve also been following the methodologies of SOLID <http://en.wikipedia.org/wiki/Solid_(object-oriented_design)> and being mindful of these principles really improves the rate in which I can iterate game concepts and cuts down time to complete maintenance tasks.
I’ll finally wrap-up and show off the last two games I’ve developed at my previous work with Crowdstar:


Visit the games below:
10Nov Flash component oriented programming
In this article, the author is a bit half-crazed… bantering that OOP is dead in light of entity/component systems. However, if you can get past that, it’s a good read on the benefits of composing game objects using only composition (instead of complex inheritance):
http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/
An example approach to implement an entity system might be as follows:
// find game entities by tags or what components it has.
var entity:Entity = Entity.getEntity(Tags.SPACE_SHIP, Tags.USER_OWNED);
entity.health().current--;
entity.health().reset(); //or entity.health().saveToServer();
entity.mc().x = 10;
entity.tooltip(); // setup a tooltip on this entity.
}
public function has(...args):Boolean { ... } //args are either Tags or component class references
public function tag(name:String):void { tags.push(name) }
public static function getEntity(...args):Entity { ... } //args are either Tags or component class references
private var tags:Array=[];
private var _tooltip:Tooltip;
public function tooltip():Tooltip { if(_tooltip) return _tooltip; else return _tooltip = new Tooltip(this); } // could be getters
....
}
public function Tooltip(entity:Entity):void {
if(entity.has(Tags.SPACE_SHIP)) shipTip();
if(entity.has(Tags.CHARACTER)) pirateTip();
if(entity.has(MovieClip)) entity.mc().addChild( tooltip_mc );
private function shipTip():void { ... } // position and setup gfx
private function pirateTip():void { ... } // position and setup gfx
}
What are your thoughts? Can a pure entity system be implemented in AS3? Are entity systems worth pursuing in AS3 game development?
27Sep Unity3D 3.0 released
Grab it over at: http://unity3d.com/
Changes:
Android Support:
- Support for Android OS is added in this version.
- Please note that this an early build and does not represent the final Unity Android quality.
Standard Assets:
- Standard packages split into more specialized and smaller packages.
- New Image Effects: Sun Shafts (aka God Rays); Bloom & Lens Flares; Vignetting & Chromatic Aberration; Curve based Color Correction; Depth of Field; Contrast Enhance (aka Unsharp Mask); Geometry Outline; Fisheye; Create Shading.
- Improved particle effects.
- New Skyboxes with alpha channels to be compatible with Image Effects.
- New Editor Scripts for useful shortcuts that are not built-in.
- Improved First Person Controller that uses Character Motor script.
- New CharacterMotor script for use with CharacterControllers.
- Proper movement on slopes and steps without loosing grounding.
- Support for standing on moving platforms with multiple movement transfer modes when jumping off.
- Variable height jumping and other jump improvements.
- Improved speed and acceleration control.
- Customizable sliding and perpendicular jumping can prevent climbing up too steep surfaces.
- Detached from input so it can be used for first person, third person, AI, etc.
New Editor Features:
- Black is the new 50% gray. Unity Pro got a new look – you can toggle it in the preferences.
- Procedural Tree Creator. Documentation.
- Integrated Lightmapping via Illuminate Labs’ Beast. Documentation.
- Automatic generation of lightmap UVs (mesh import setting).
- Terrains use the same solution and gain a whole new look when used with skylight.
- You no longer use special “Lightmapped” shaders; all shaders that interact with lighting can handle lightmaps. Dynamic shadows from characters mix with lightmaps properly.
- Object Selector. We no long show a simple dropdown menu; instead a swanky new window opens up, with previews and everything.
- Scene View improvements (documentation):
- Search field with interactive highlighting of objects.
- Rectangle selection.
- Vertex Snapping for precise object placement.
- Live previews of material, prefab and texture drags into the scene view.
- Improved camera handles, and a camera preview window.
- Improved light handles.
- More consistent scene navigation controls.
- New texture Import Settings dialog with simpler interface & per-platform import settings.
- New Build Settings window to better support multiple platforms.
- New and more organized platform-aware Player Settings Inspector.
- Curve Popup Window:
- Any public script variable of type AnimationCurve is now exposed in the Inspector as a curve field.
- Clicking a curve field opens a popup window with a curve editor, similar to the curve editor in the Animation Window.
- Customizable curve fields can also be used in custom editor windows.
- Editor checks when new versions are available< and notifies the user.
- Texture compression is now multi-threaded for faster texture imports on multi-core computers.
- Asset Server Window:
- History window shows multiline commit descriptions directly in the list instead of tooltips.
- Selected history window items are revealed better.
- Framing (F key) works for history window file list.
- Remember user/password per host name.
- Disable merge button in conflict resolution window for non-merge-able items.
- Improved error reporting for shaders. Shader Inspector also displays the list of errors & warnings for selected shader.
- Implemented snap to grid in Curve Popup Window and Animation View when holding down Control (Command on OS X). Control/Command no longer adds to selection, but Shift can still be used for that.
- Editor Console displays total number of errors & warnings in lower right corner.
- Improved inspector for movie audio.
- Windows: Double-clicking *.unitypackage will open and import it.
- Editor API has been expanded: documentation.
- Added option to search for object types instead of names in the project search field.
- Can now drag objects onto an array field in the inspector to add them to the array.
- Can now drag project folders onto the Project Wizard on Mac OS X to select them.
- Nicer display of thumbnails when dragging tabbed editor windows.
- Long operations show progress badge on the Unity Dock icon in Mac OS X and on the taskbar button in Windows 7.
- Added support for touchpad gestures in OS X editor, for maximizing windows (pinch gesture), and switching camera in scene view (swipe gesture).
- Overdraw visualization mode does not do alpha testing now. Alpha tested pixels still cost on the GPU, so better to visualize the real cost.
- Animation window can display animation clips from prefab, just click the prefab’s root game object.
- Protect Transform position, rotation, scale against invalid values.
- Build Pipeline: Typetrees are removed from serialized files (assets) when possible, this make resource files smaller and loading time faster.
- Double-clicking a Game Object in Hierarchy View will frame select it in Scene View.
- When going out of Play mode and the Game View is docked together with other tabs, go to last active tab instead of always focusing or creating a Scene View tab.
- Now the Hierarchy View has a toolbar too.
- API Compatibility setting in player settings lets you choose your mono profile. Use 2.0 if you’re having trouble with 3rd party assemblies (2.0 not available for web player).
- High resolution icon support for players (Windows: 256×256 and 128×128; iOS: 114×114).
- Search results in project and scene search are now sorted alphabetically.
- Inspector Lock got a real button instead of being hidden in a menu.
- Rotate Tool now includes ‘Look At Point’ option when Shift + Control/Command keys are held.
- Audition audio in SceneView. Scene view search now filters audio sources as well.
- Added Web Player build templates.
- It is now possible to update Asset Server project to specific revision through command line.
New Graphics Features:
- Static Occlusion Culling using Umbra sPVS.
- Geometry Batching: static and dynamic batching from Unity iPhone 1.7 comes to all platforms.
- Rendering paths: (choose in Player Settings or per-Camera; documentation)
- Deferred Lighting. A deferred rendering scheme, where realtime lights are not horribly expensive anymore. Lighting cost is only dependent on the number of pixels it touches, so you can have lots of small lights for cheap.
- Vertex Lit. This makes all shaders & lights use fixed function per-vertex lighting. In exchange, this is fast; primarily targeted at mobile platforms and low-end web.
- Forward rendering path had lots of changes compared to Unity 2.x, see below.
- Surface Shaders – a much easier way to write shaders that interact with lighting. We don’t have the docs for it yet; you’ll have to trust us that it’s awesome!
- Speed! We have optimized the rendering code; it’s often 20-50% faster than 2.6 in the same scene setups.
- OpenGL ES 2.0 for iOS and Android. You can use shaders for objects, post-processing effects etc.
- Regular Cg/HLSL shaders and Unity 3 Surface Shaders will be cross-compiled into GLSL behind the scenes. Resulting GLSL will be optimized as well, because mobile platforms are not very good at optimizing the shaders.
- Of course, since mobile platforms are not very powerful, you should use OpenGL ES 1.1 if possible.
- Particle Rotation: Particle.rotation, Particle.angularVelocity and respective properties in ParticleEmitter.
- Soft Particles! When you use Deferred Lighting and have Soft Particles on in Quality Settings, particles will fade out close to intersections with the scene. All built-in Particle shaders (except VertexLit) support this.
- Shadowing improvements: use native shadow maps on Direct3D (faster, less memory, native filtering); much reduced self-shadowing artifacts; Soft shadows support for Point lights; much less “shadow halos” around objects for directional light soft shadows; optimized shadows for Forward rendering path (shares depth buffer with main rendering); optimized shaders for directional light shadows.
- Terrain: Added slider (under Terrain Settings) to control detail object density.
- Vertex shaders for Shader Model 3.0 on Direct3D9 and GLSL on OpenGL can read from textures.
- Skybox is rendered after opaque geometry. Improves performance if your application is fillrate bound.
- Separate Alpha Blending: use Blend ColorSrc ColorDest, AlphaSrc AlphaDest in ShaderLab.
- In-editor visualization on which objects would use which rendering paths (green/yellow/red for deferred/forward/vertexlit).
- #pragma glsl for compiling Cg/HLSL shaders into GLSL instead of ARB assembly programs on OpenGL.
- Compiling shaders to #pragma target 3.0 allows 512 texture indirections on OpenGL (up from 4).
- Development standalone players on Windows have Direct3D PIX events; useful if you use PIX, Intel GPA or other graphics performance tools.
- Fog just works on Direct3D with Shader Model 3.0 shaders, on OpenGL with GLSL and on OpenGL ES 2.0. Additionally, there’s no need to write #pragma fragmentoption ARB_fog_exp2 in your shaders anymore; just remove that line.
- CameraDepthTexture modes can be combined if you want to get both depth & depth+normals textures.
- It is possible to forcibly disable Anisotropic filtering on a texture, even when Quality Settings have anisotropic on all textures. Just set anisotropic slider on the texture to zero.
- Uniformly scaled objects will no longer be pre-scaled before rendering – instead uniform scale is now natively supported by the renderer.
- Cg/HLSL VPOS (pixel position) pixel shader input semantic is supported now.
- Terrain: Expose detail resolution per patch; previously was hardcoded to 8.
- Terrain: Improved performance of painting textures & detail objects.
Asset Pipeline Improvements:
- Upgraded to FBX SDK 2011.2.
- Import support for stepped and linear keys for position curves; improved compression and curve fitting for position curves.
- Settings for allowed animation compression error in mesh importer.
- Implemented support for importing 1 unit in 3dsmax as 1 unit in Unity (the default is 1 cm in 3dsmax as 1 unit in Unity).
- Implemented import of tangent space from FBX, .max, .mb and .ma files.
- Switched Cinema4D import process to work in background mode.
- Support for Cinema4D R11 on Mac OS X.
- Support for FBX2010 format when exporting from Cinema4D.
Audio Improvements:
- Filter components: Reverb, Echo, Distortion, Chorus, High- and Low-pass. Can be applied to each audio source or globally to the listener.
- Reverb Zones: Apply reverb to main audio output, when the listener is within zone(s) defined by a position and min/max radii.
- Live output and spectrum data access from each audio source or globally from the listener.
- Tracker/Mod file support.
- Sample-accurate synching. Sources played in the same frame are always started at the exact same point in time. Sources can be delayed and played in the future on an exact sample accurate boundary with .Play(int64 delay).
- Surround sound (7.1, 5.1, 4.0, ProLogic DTS) support.
- Attenuation curves for volume, spread, panning and lowpass filter factors.
- Doppler factor per audio source.
- AudioSource prioritization.
- iOS latency settings. Choose between Default, Best Performance, Good Latency and Best Latency.
- Asset memory is freed after loading audio data.
Physics Improvements:
- Upgraded PhysX to 2.8.3.
- Cloth and clothing simulation: use the new InteractiveCloth, SkinnedCloth and ClothRenderer components.
- Layer based ignore collisions: use the Physics inspector or Physics.IgnoreCollision().
- Continuous collision detection, to make sure that fast moving colliders will not pass through other colliders. SeeCollider.collisionDetectionMode.
- Added Physics.SphereCast() and Physics.CapsuleCast() to implement volume raycasts.
- Added Rigidbody.SweepTest() to check if a Rigidbody would collide with anything if moved into a certain direction.
New Scripting Features (documentation):
- Mono Develop for script editing and debugging! Documentation.
- Upgrade Mono and C# compiler to Mono 2.6.3. This brings C# 3.5, variable type inference, lambda expressions, LINQ and more.
- New UnityScript compiler: generics, interfaces, structs, type cast operator, anonymous functions/closures, lambda expressions, function types, type inferred array comprehensions and more.
- New Boo compiler.
- Mono class libraries derived from Silverlight profile for the web player.
- Socket security sandbox implementation. Just like Flash (think crossdomain.xml).
- WWW class security sandbox implementation. Just like Flash (think crossdomain.xml).
- Per-platform script defines. Use UNITY_EDITOR, UNITY_WEBPLAYER, UNITY_IPHONE etc. Documentation.
- Improved UnityScript compilation speed.
- New scripting API functions (documentation). Some highlights:
- WWW.responseHeaders will contain the response headers received from the HTTP server.
- Application.isWebPlayer.
- SystemInfo.graphicsPixelFillrate to query GPU pixel fillrate. Returns fillrate for about a thousand GPUs out there.
- GL.ClearWithSkybox.
- Math functions: MoveTowards to Mathf, Vector2, Vector3, and Vector4; Quaternion.RotateTowards.
- Changed Mathf.Approximately to not only be useful for comparing very small numbers.
- Stacktraces have been prettified, useless information is better stripped from stack traces.
Other Improvements:
- Web Player: Java and ClickOnce based installer on Windows for true one-click installation process.
- IME input support (for languages like Japanese, which require multiple keypresses to enter a character) on Windows, and in the editor and standalone on the Mac.
- Support for OS font rendering (new “dynamic” font rendering mode), to save space in distribution and texture sizes. Textures are generated dynamically to contain the characters which are needed.
- Documentation: scripting examples in UnityScript; C# and Boo. Docs for all platforms merged and platform specific parts toggle-able.
- Web Player: UnityObject.js script makes Web Player embedding easier.
- iOS: Added cpu-waits-gpu metric in internal profiler; useful for tracking down GPU bound applications.
- iOS: Native resolution support for iPhone 4.
- iOS: Improved game build sizes.
- iOS: Unity Remote 2: It is possible to turn off image syncing between editor and device. Useful for input-critical games.
- OS X Web Player: Now supports NPDrawingModelInvalidatingCoreAnimation, as will be required by future versions of Chrome.
- Networking: RakNet upgraded to version 3.732
- Networking: Connection tester, Network.TestConnection(), now reports your NAT implementation type more accurately.
- Networking: Exposed Network.logLevel so you can change the amount of log output at runtime.
- Networking: Added network GUID, used for NAT punchthrough.
- Bug Reporter: Supports multiple file attachments; trims attached log files if they are too large.
04Jan Now=new Year(2010)
As the new decade begins, millions of people reflect on their situation and ponder how to proceed into the future. In many ways, 2009 was a game changer for the multimedia industry. We have seen Unity and the Unreal engine open to their doors to free indie developer licensing. This illustrates that corporations are realizing that even a great multimedia software infrastructure can be shoved aside for lesser alternatives that however have the strong community around its platform.
We have seen also a greater focus on one language compiling to multiple platforms. Adobe is pushing for Flash to compile natively to the iPhone and pushing the Flash player to all other mobile devices. Unity also aims for compiling to PC, Mac, and iPhone with little changes needed to the source. Microsoft continues to push XNA that has the boon of both PC and XBOX360 support. Of course, haXe continues to gain in popularity as it is a single language that translates into other platforms (Flash, PHP, Neko, and C++ SDL).
Over at Bill Sander’s blog AS3 Design Patterns, he talks about his journey into design patterns and that his New Year resolution is “Improve nailing down relationships between classes in design patterns.” This year I have expanded my knowledge of design patterns in areas that I do not normally require in my everyday work, but just learning their existence has given me the enlightenment of not just how the design pattern works but ‘why’ it exists and what would happen to a system built without it.
My personal development New Year’s resolution is: “Learning to prototype quickly while keeping modular using loose coupling.” Being able to produce a skeleton of a system quickly helps to a keep the momentum of a project going and to isolate design flaws. However, rapid development can cause a system to be become stagnate and locked into a certain implementation. However, wise programming decisions like using the acquaintance relationship between classes and employing design patterns like strategy or template will make my prototypes open enough to evolve into the final product without infrastructure rewrites.
Update: While technically the new decade starts in 2011, I find the debate mute as people will refer to this era as the “2010′s“.
11Nov Rise of the languages
This month has been a very interesting/exciting for programmers of all backgrounds and may be the cornerstone of an industry wide conceptual change.
Unity3D, a primarily web based 3D accelerated language, has announced their “indie” version of their engine as a free no-strings-attached package. This was a wise choice for the company as Google’s free O3D alternative has been gaining support and Adobe’s Flash is rumored to get 3D acceleration soon.
In just a week later, Epic Games released the Unreal Development Kit (UDK), a desktop commercial gaming engine, free of change for non-profit usage. UDK, however, does not compete with Unity3D. UDK has an incredible desktop graphics engine that Unity3D would not be able to compare to. However, Unity3D can run over the browser, has a super small file size for compiled games, and is much easier to learn than UDK. It is also worth mentioning that Unity3D is not a direct competitor to Flash either as its tools for 2D development are poor at best and Flash is installed on almost 97% of all computers (while Unity3D is around 6% I think). There has been little news on the haXe side of things in the past month which is a little disappointing considering the potential of the language.
Finally, Google unveiled Go programming language which is tailored towards system and server development and takes advantage of concepts like multi-threading and server clustering of tasks. While this is not terribly exciting for some, this language may reduce much of the massive complexity employed for enterprise systems and servers today.
One of the underlying themes we are seeing here today is that the user community around a platform is king. A developed language may be perfect and boast all kinds of features, but without users, it inevitably fails. As a developer, this is a fantastic change in the industry as it means cheaper or free entry into powerful languages and more help and support being offered to the community from the creators.











