Monthly Archives: March 2012

Seriously, Adobe, are you serious?!

Adobe just announced that it is going to start charging fees to developers who use advanced features introduced in the latest versions of the Flash Player browser plugin.

How exactly this is supposed to “…encourage the kind of innovation and experimentation that often helps to spark inspired and inventive games…!” is beyond me.

I find it difficult to understand why Adobe would want to do this. This decision seems driven by pure greed… or… Is the Flash platform hurting so much that this is the only strategy for survival?

My initial reaction is to think that this will hurt Flash platform overall and Adobe will start hemorrhaging developers left and right. It is a shame, because IMO, Flash was just starting to get interesting again with Stage3D and Alchemy. It has really become a polished product since the Flash Player 11 release. It is truly no joke that you are able to create console-quality games in the browser. Nothing else even comes close (in the realm of browser plugins). But to put all of that cost onto developers backs could drive away small and independent developers, making only the largest game publishers able to afford to make Flash Games. That might actually might be their intention. It seems like Adobe is trying to get people to look at Flash Player more seriously as a “real professional” platform. They might even be purposefully trying to cut the fat and drive away those who would develop shoddy flash applications and give the platform an undeserved bad reputation.

Another spin on this is that with new publishing platforms such as Unity. Adobe is a losing a market for Flash publishing. They want to leverage some profits from those using different publishing platforms since they are losing potential customers who would have normally purchased licenses for the Adobe Flash CS suite. Instead, content creators will develop 3D content with applications such as Unity, Maya, etc… and not from Flash. Of course, Flex has enabled developers to publish .swfs without Flash for years now. o_O

Only time will tell. This could be the best thing that ever happened to Flash… or the worst. One thing is for sure… it seems to be the most “Evil”. 😛

Note:
These new fees apparently do not apply to AIR apps, so anyone developing mobile or desktop AIR apps that take advantage of Stage3D and Alchemy should be fine… for now. Also, the use of Stage3D or Alchemy individually do not require the fees. Fees apply specifically the use of Alchemy2 and Stage3d together. For more info read Adobe’s blog about it.

Flash Player Mobile is Dead… Long Live Adobe!

Since November 2011 last year, there has been a lot of talk about Flash’s death at the hands of Apple. When Adobe announced that it will no longer be developing Flash Player for mobile devices, everyone immediately assumed that this signified the end of Flex/Flash for mobile devices.

The other part of Adobe’s announcement was relatively unhyped. They promised further development of the Adobe AIR platform for mobile devices. AIR 3.2 is currently in pre-release RC status and it is looking very good so far! Adobe has added more native application support as well as stage3D support to the mobile version of AIR. This has huge potential especially for gaming.

I recently came across this blog posting demonstrating AIR’s new 3D support for devices:

Five AIR 3.2 Stage3D Mobile Demos That Will Knock Your Socks Off

This looks extremely promising! Curious, I immediately downloaded the RC version of AIR 3.2 from Adobe Labs and then proceeded to port my Starling Framework Test to my Nexus One android dev phone. Everything worked as expected and the framerate was very smooth. It does appear to me that Flex/AIR is still a very capable mobile platform. Also, the Flex SDK is open-sourced do there is little to no cost to develop Flash and AIR applications with it.

As of late 2011, Adobe recently donated Flex to the Apache Foundation in what appears to be community-friendly exit strategy while they shift their focus to HTML5 solutions. While the implications of this move indicate that Adobe is moving away from Flex/Flash. It certainly does not signify the death’s of those platforms. It could be the best or the worst thing to happen to Flex. It remains to be seen. It all depends on Adobe’s dedication to contributing to the development of the Flex platform.

Here is a link to Adobe’s “Roadmap for the Flash Runtimes” whitepaper:
http://www.adobe.com/devnet/flashplatform/whitepapers/roadmap.html

Inside, it mentions that they perceive Flash as the gaming console of the web. It also mentions their future plans for the web Flash Player and the next permutation of Actionscript. It is actually an interesting read, if you’re into that kind of thing.

So, while Flash Player for mobile devices is dead. It looks (to me) like AIR is very much alive… for now.

Oversoul Update- Rolith’s Spellserver

You may already be familiar with Oversoul’s Mage graphics Engine. There is another major component to Oversoul that we are working on called “Spellserver”. Spellserver is being developed by Rolith. It is a fast and lightweight multiplayer socket server developed in C#. We will be using Spellserver to handle multiplayer functionality in Oversoul.

Spellserver is a huge undertaking and I have a ton of respect for Rolith for doing undertaking this massive task. One of the huge benefits to developing our our socket server is that we will be able to handle more simultaneous connections at one time and it should be very lightweight and affordable compared to some of the more fully-featured enterprise solutions.

Spellserver is being developed parallel to Oversoul and we have just gotten to the point where we can start merging the two projects together. This is a very critical stage in the development of Oversoul – because once we hook all of this up – it will be very interesting to see what breaks! So far, login and walkaround is working flawlessly. Right now we have started porting the battle logic to the server. So far things are going slowly but smoothly!

Nulgath’s conceptual Oversoul preview – Estimated release Summer 2012:

BoxBreaker – Free Game Source Code

Last July, I taught myself how to program in Lua by creating a physics-based breakout clone called “BoxBreaker.” I used an open-source game engine called Love2d to create it. This was a learning project that I slapped together over a few weekends. My goal was learn Lua and to create a game that I could actually play on my Debian Linux PowerPC system. Love2d just happened to be one of the few game engine options that fulfilled my needs and was actually compatible with my hardware. The Love2d community was also very helpful and active and some members actually contributed code snippets and game levels.

I produced this game using only free and open source tools on my Debian machine. I used Emacs as my code editor, GIMP for the graphics, and zynaddsubfx to create the soundfx.

Anyway, I made BoxBreaker available on Github for anyone who is interested. Admittedly, this is not the best code that I have ever written. My Lua skills have improved a lot since this project, but it helped me to learn and I hope that it can help someone else learn too.

Overall, I think the game actually turned out to be pretty fun and since Love2d is available on Windows, Mac and Linux, it is cross-platform as well! 😛

Here is a link to the project:
Boxbreaker on Github.

Note: BoxBreaker was a personal learning project and is unrelated to my work with Artix Entertainment, LLC.

Ominous theme – Imminent War in Bloodtusk

Sample Clip Here: Ominous Theme

This is one of my personal favorites. Bloodtusk was a really fun zone for me and it resulted in some of my favorite compositions in AQWorlds. This theme is a slow building theme. It is a repeated theme that layers more and more harmony parts as it repeats. Overall all it is a very simple piece, but as the harmony builds, it becomes richer and fuller. I am particularly fond of the choral arrangement that comes in at the end of the piece. This song has the dubious honor of having made my mother cry real tears (she’s very emotional about music).

Software used:
FL Studio Producer Edition
Sonivox Muse

Creative Commons License
Ominous Theme by Artix Entertainment, LLC is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.

Mage Engine Introduction

If you have seen the most recent Oversoul videos, then you may have noticed a “Powered by Mage Engine” logo in the intro of the movie. I have been getting a lot of questions about this lately.

The early beginnings of the Mage engine started last April when I took on the project to port the minigame, Fat Panda to the iPhone and Android. That project was our first experience with mobile development and it was a huge learning experience.

Our games have always used Movieclips as the main content type. With Movieclips, you can have hundreds of frames of animation smoothly tweened by flash – All of our animators are extremely proficient animating Movieclips and they enabled us to crank out content extremely fast for all of our major games. The problem is… vector art, which is what most of our Movieclip assets are comprised of is incredibly slow. Every line and fill gets redrawn on every frame – Not so bad when you are making browser-based games for relatively modern systems – but it is a completely different game on mobile. In mobile games, you need to use bitmap graphics that can get cached in memory and drawn instantly to the screen. I remember running a test and finding that just putting a vector-art button on a screen full of bitmaps caused a 50% decrease in framerate! It became very clear that we needed to make some major content pipeline changes if we ever wanted to make any Flash games for phones.

You can increase movieclip performance by embedding static bitmaps inside movieclips, but even then, most of our animations are hundreds of frames – some characters in our games comprise of literally thousands of frames – Thousands of frames of embedded bitmaps would be incredibly large and would quickly eat all of our filezize limitations on phones. The nice thing about vector art is that it is extremely small because none of the bitmap data is stored, it just contains the data that the system needs to redraw the image at run time.

So, to address some of these issues, I came up with a way to convert animated movieclips into bitmap sequences at runtime. I called this process “baking movieclips”. It was a major performance increase and we were able to finally use movieclips for mobile applications. Anyone who has actually played Fat Panda might notice that it says “baking pandas” at the start of the game. This is essentially what is happening. The biggest drawback to using “baked” clips is that is very memory intensive, so you can’t have thousands of frames of animation without blowing up your phone! Memory management is also a big concern – because you have to make sure that you are properly disposing of the bitmap data before all of your ram is gone.

Mage had its beginnings in those baked movieclips. It is ultimately a collection of classes that I have compiled over the last several months to ease the headaches of game programming. It is very similar to Flashpunk or Flixel – although it is still very much in its infancy as a full game engine

Mage has several graphic Entity classes including Baked Movieclips, spritesheets, static bitmaps, gamestates and normal movieclips and it handles proper cleanup of those assets. It also has AudioMixer capabilities. It has Camera and Display classes and some handy functions for importing rectangles from Spritesheet Packer xml files and tiled maps from the editor, Tiled. There is also some very rudimentary Box2D support in Mage.

Here is a link to an early Mage test utilizing Box2D Physics, spritesheets and Camera fucntionality:
Mage Prototype Test

Oversoul will be using the Mage engine to improve performance by baking certain things like backgrounds and interface elements. It will also be utilizing Mage’s Gamestate, Audiomixer and Camera functionality. Some of the more experimental aspects of Mage such as box2d and tiled support will not be used in Oversoul. We will still be using Movieclips for heavily animated assets. Nulgath’s has really been set loose on this one and is cranking out literally tons of animation! It is very exciting!

Actionscript 3 Tip: One Event Listener to Rule them All!

If you have ever coded anything in Actionscript 3, then you will be very familiar with code that looks something like this:


/** Add an event listener for every button... */
button1.addEventListener(MouseEvent.MOUSE_DOWN, button1Pressed, false, 0, true);
button2.addEventListener(MouseEvent.MOUSE_DOWN, button2Pressed, false, 0, true);
button3.addEventListener(MouseEvent.MOUSE_DOWN, button3Pressed, false, 0, true);

/* now here are the event handlers for all of those buttons */
private function button1Pressed(e:Event)
{
     trace("Button 1 Pressed");
}

private function button1Pressed(e:Event)
{
     trace("Button 2 Pressed");
}

private function button1Pressed(e:Event)
{
     trace("Button 3 Pressed");
}

It can get very tedious to add and remove all of those event listeners! Especially when you have a lot of buttons on the screen! You can alleviate a lot of this pain by using the event.target property of the event class.

One way to simplify things is to put all of your buttons into a movieclip and then add a single event listener to that movieclip. Then, just look at the event.target.name to find out which specific button is being pressed. Each button in the movieclip should have a unique instance name for this to work.

Now your code would look something like this:


/** Add the button event handler to the buttons' parent clip. */
buttonsClip.addEventListener(MouseEvent.MOUSE_DOWN, handleButtons, false, 0, true);

/** Button Handler */
private function handleButtons(e:Event)
{
     /** e.target is the actual button that is being pressed. */
     trace(e.target.name);
}

This is a nice clean way to handle button events without having tons event listeners. When you have tons of buttons all over the place in a flash application, it can be very easy to forget to remove all of them and can lead to memory leaks as orphaned event listeners tend to like to hang around and prevent garbage collection from clearing them. This way, you only have to worry about one listener.

It is often more helpful to see some code in action. So, here is a link to this example as a FlashDevelop project.

I hope this was helpful!

AQ3D Theme in G Minor

Sample music clip here: AQ3D Theme in G Minor!

This is my first musical theme composed for our newest game, AQ3D. Thyton lent a helping hand in the creative direction of this theme and provided me with a ton of movie soundtracks to listen to before I wrote any notes to this piece. The first four notes of the intro melody provide a motif that is built upon throughout the piece. This will be a repeated motif in future music for this game. Thyton had a lot of cool ideas – Most specifically, the low rhythmic cellos and the deep drum and piano hits at the end of the piece. Overall I really liked how this turned out – It is one of the more cinematic pieces that I have composed for any of the games so far. The key of g minor lends a nice, ominous feeling to this otherwise serene landscape. Thyton and I have collaborated in the past on the music for HeroSmash and of course, the epic, mind-blowing masterpiece – DerpQuest the Musical available for free download on Heromart!

Software –
FL Studio, Sonivox Muse provided almost all of the instrument sounds for this piece.

Creative Commons License
AQ3D Theme in G minor by Artix Entertainment, LLC is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.

AQWorlds Fishing Theme

Get the music here:  AQWorlds Fishing Theme!

Dumoose requested a nice fishing loop for the AQWorlds fishing minigame.  I decided to go with a chill out loop with a calm and quiet island-jazz arrangement.  The idea was to make the music a chilled out and in the background as possible so that it would not get hard on the ears as players spend many hours of gameplay in this fishing game.  The drumloops that I used came from Sonivox’s Loopline collection.  The main drumbeat was from Dirty Drums and the Bongos came from World Beats.  I ran my Fender Deluxe Player’s Strat directly in and used the cathedral setting in FL Studio’s reverb plugin for the rhythm guitar tracks.

Hope you enjoy!
-Warlic

Creative Commons License
AQW Fishing Theme by Artix Entertainment, LLC is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License

Experimenting with the Starling Framework

I am about to try something I have never done.  I have decided to check out Starling.  It is a game framework for Flash that renders 2D images on Flash’s new Stage3D.  The advantage to rendering on the 3D stage is that it allows you to take full advantage of hardware GPU acceleration in your 2D games.  So anyway,  lets learn about this new framework together, shall we?

First,  we need to get the latest version of Adobe’s Flex SDK and Flash Player 11 or higher.    I highly recommend using FlashDevelop,  since it automatically downloads and installs the SDK for you.  You can get the latest version of FlashDevelop here. Then of course,  you will need to get the Starling source code. You can get Starling here.  Just download it and unzip it into the folder of your choice.

Now in FlashDevelop:  Create a new AS3Project.

Now that you have your project set up, go to
Project –> Properties –> Classpaths –> Add Classpath –> 
Then, select the folder where you unzipped the Starling framework and browse to the starling/src directory.  Your Starling pathi will look something like this: D:\path to Starling\starling\src  – Note you must point to the starling src folder or else FlashDevelop will not be able to find any Starling classes.

Next we initialize Starling with our Main.as Class

package 
{
	import flash.display.Sprite;
	import starling.core.Starling;
	
	/** Define SWF properties */
	[SWF(width="800", height="600", frameRate="60", backgroundColor="#3f3f3f")]
	public class Main extends Sprite
	{

		/** Declare a variable for Starling */
		private var _starling:Starling;

		public function Main()
		{
			/** Initialize Startling with the Game class and current stage. */
			_starling = new Starling(Game, stage);
			/** start it up! */
			_starling.start();
		}
	}
	
}

Now, Starling initializes and our Game class is automatically instantiated – Game.as (or whatever you want to call it) is were your main game code goes:

Game.as

package 
{

	/** Import the clases we will need to use - 
	 * Note : that you must import starling classes instead of flash classes!
	 * */
	import starling.display.Stage;
	import starling.events.Event;
	import starling.core.Starling;
	import starling.display.Image;
	import starling.display.Sprite;
	import starling.text.TextField;
	import starling.textures.Texture;

	public class Game extends Sprite
	{
		/** Stage Width */
		public static const STAGE_WIDTH:Number = 800;
		/** Stage Height */
		public static const STAGE_HEIGHT:Number = 600;
		
		/** Embed an image for logo Class */
		[Embed (source = "Logo.png")]
		private var _logo:Class;
		
		
		/** Define Starling texture from the logo image */
		private var _texture:Texture = Texture.fromBitmap(new _logo());
		/** Create a Starling Image DisplayObject out of the texture */
		private var _bmp:Image = new Image(_texture);
		
		/** Movement Speed along x axis */
		private var _xSpeed:Number = 10;
		/** Movement Speed along y axis */
		private var _ySpeed:Number = 10;
		
		/** Constructor */
		public function Game()
		{
			
			/* add the image to the Starling 3D Stage */
			addChild(_bmp);
			/* set bmp start coordinates: Centered */
			_bmp.x = STAGE_WIDTH/2 - _bmp.width / 2;
			_bmp.y = STAGE_HEIGHT / 2 - _bmp.height / 2;
			
			/* Enter frame Event for main game loop */
			addEventListener(Event.ENTER_FRAME, loop);
		}
		
		/* This function is run on every frame. It Bounces the Bmp around the screen  
		 * As you can see - once you get Starling all set up,  it's DisplayObject Classes are very similar to  Flash's 
		 * */
		private function loop(e:Event):void {
			_bmp.x += _xSpeed;
			_bmp.y += _ySpeed;
			
			if ( (_bmp.x > STAGE_WIDTH - _bmp.width && _xSpeed > 1) || (_bmp.x < 0 && _xSpeed  STAGE_HEIGHT - _bmp.height && _ySpeed > 1) || (_bmp.y < 0 && _ySpeed < 0 ) )
			{
				_ySpeed *= -1;
			}
			
		}
	}
}

As you can see the code is pretty similar to the code you would use with “normal” Actionscript classes. The most important thing to keep in mind when using the Starling framework is that you need to import the starling.display.* classes instead of the usual flash.display.* classes. Also – bitmap data must be mapped to a texture bfore it can be drawn on a Stage3d object.

Here is the picture asset used in this example:

Here is a link to see the results of this test – Flash Player 11 or higher required for Stage3D functionality:

Learning Starling

I hope you learned something!  I certainly did.  This was my first experiment with using Stage3D and Starling in Flash!

It is definitely an exciting time for Adobe Flash as it is becoming a more and more powerful game platform!  Hardware accelerated 3D in the browser opens up huge possibilities! The Starling framework enables developers to easily utilize hardware acceleration in their 2d projects in a way that is familiar to them. The Starling display objects behave almost exactly the same as their flash counterparts. The biggest difference is that developers will need to learn about Starling’s “Textures” and “Texture Atlases”.

If you would like to learn more about Starling, there is a nice video tutorial here:

http://gotoandlearn.com/play.php?id=147