minesweeper logo

Minesweeper For Android Goes Live

0

Minesweeper Goes Live!

Over the past couple of weeks we have had our attention on delivering our multi-platform debut title. We decided to start small and concise and to deliver a classic game that would work well for touch screen devices. The result is now available on the Android Market and will also be available on iPhone and iPad in the coming week. (see below for earnings and strategy info)

https://market.android.com/details?id=air.io.plugin.games.minesweeper

 


YouTube Market Video

 

Android Featured Image

 

We are a team of just two people, one admin and one developer, so how did we do it? Get ready for a surprise:

Be Badly Prepared

We are actually working on two other applications, a shopping application and a multi-player game, but this time last week, we had no live games or apps. So, one morning a couple of weeks ago I decided it would be a good idea to have a live game in order to dip our toes in the application pond and hopefully smooth over any potential issues and walls that might stand in our way with the other two apps. I called a quick meeting (OK, I asked my girlfriend what we should do). My preconception was that we needed to build something simple but thorough. i.e. All the parts of the release should not have corners cut. That included making sure that we had the game, half decent descriptions, video, icons etc as well as the game. So, essentially, I wanted a game that I could program pretty quickly, was addictive and fun, maybe already had a following or that is was recognizable. After throwing some ideas around for about 7 minutes, we settled on Minesweeper and within another minute; New Project -> Air Mobile Flex App.

 

Aim For Terrible Team Communication

Our developer is English, our administrator is Thai so communication in the PluginIO office can be somewhat like walking directly into the mind of a drug using, alcoholic schizophrenic. Please imagine this scenario for one moment:

Hmmm… So, I need some ideas for the game graphics!

This a game chai mai ka?

Sorry, What do you mean?

This to be graphics mai?

Errrm….. *worried face* could you look for ideas for the game graphics o_O

OK ka… I will see it na jaaaaaa!

Well, this is pretty much how communication goes down in the PluginIO office, it’s slightly inefficient but, as you can see, it does in fact get the job done! ^__^

 

No Planning Thanks

I didn’t really have any plan as to how the game would look or play but I had a one minute envelope between deciding the game and my IDE being fired up. One thing that I could depend on, it would be like minesweeper. My immediate reaction was; I only really see the grey box clones that always look rough around the edges and terrible. My gut feeling was that I didn’t want our game to look anything like these games. I have worked in the gambling game industry for a number of bet gaming companies and figured there would be a grid and many betting games have a grid (so pretty standard thinking). I had always wondered why the games didn’t look more like the betting games that you see on TV. They always seem to look more inviting, cute even? Cute…yes, cute things in games that look like gambling and TV, that’s what I wanted, but I need to make it quickly so probably no animations. All of this happened in that one minute whilst sitting down to my PC.

 

No Concept Art

Just draw a picture and be happy with it. Worked here!

 


First Draft Character Image

 

Drink Lots Of Coffee and Eat Pizza

Oh, Come on…. I’m a developer, it’s gonna happen and it did and it made me happy!

 

The Reality

You know it’s all good, the game is live and all that jazz, but any developers reading this might be thinking. OK, this is just a bunch of contradictory information and doesn’t give me too much info about what I should really be doing. DON’T BUILD A GAME THIS WAY! The gut feelings thing is kinda OK to build upon, but most other things in this article are not OK, why? Because it lessened the chances of me being able to deploy it. But something rarely said by elitist programmers is… Don’t get so caught up in the extreme technicalities that it causes you to not release your game. Don’t worry if you didn’t use an MVC framework, many games don’t. Yes, you can split things up making it more maintainable, but if it stops you producing anything, then what’s the point?

 

Show Me The Money

I know many potential developers here will care most about this question. Is this game making any money? Well, it’s too early to say, currently, I’m actually losing money, but I’m going to give you a full breakdown of the games earnings, advertising strategies etc. For now though, here is the low down:

  • The game is an Adobe Air App targeted at version 2.5. When I uploaded to the Android Market, it told me that the game will be made available to 690 different devices.
  • Android Market filters the game to devices that should be able to play the game. Since Adobe Air doesn’t work for ARMv6 CPUs, that eliminates quite a few potential customers, but the tradeoff is that Air can deploy to other platforms and the iPhone and iPad versions will be available early next week.
  • The game is on the market for 0.69GBP (Or equivalent in different regions), mostly because I tried 0.49GBP and Android Market said that it needed to be higher so I chose 0.69GBP because I like the number!
  • I’m advertising the app on Facebook (I’ve included the advert below), currently at a target or 1.9M users that are interested in ‘Mobile Games’, ‘Android (Operating system)’ and ‘Android Apps’.
  • I’m advertising to users in China, United Kingdom, Australia, Thailand, South Korea and United States.
  • I’m slowly getting ads shown at $0.02 CPM, with a pretty poor 0.010% click through rate.
  • Much more detailed breakdown of stats coming soon ^_^

 


Facebook Ad

 

We hope you enjoy the game, here are a few screen grabs ♥
 

Adobe_Flash_Pro_CS5_icon

Adobe Kills Flash Mobile

0

…and why we shouldn’t care!?

For some time I’ve been expecting an announcement from Adobe that they will drop support for mobile browser support and yesterday my suspicions were proven right. Whilst I’ve had these suspicions I’ve made an effort to move over to application development using Adobe Air and I made it apparent to members of the Adobe team that I wanted access to the latest builds so that I might develop with Air Mobile Stage3D. I’m still awaiting my email Thibault ;)

I’m seeing all sorts of posts dashing around the internet and I believe most of the ones that people are talking about are the sensationalist types that have little basis or are in fact misinformed and do nothing to offer but despair to Adobe Flash developers, which is absolutely not the case. I must introspect and think that, as a Flash developer, I might be bias from the other side, yet I can state again that I use Flash simply because it’s the best technology to do what I want to do and this still applies and perhaps even more so with Air 3. I want to explain why this sensationalized news is virtually nothing to me.

 

The sound of inevitability

About three months ago, I went out to buy a device that would allow me to build my first ever Adobe Air application. (I’d built things for emulators prior to this). I bought a Samsung Galaxy Mini and it was a huge mistake. Why? Because it doesn’t support Flash at all. (Maybe you can get some hacked setup now) Anyway, it made me beg the question; “Why will Flash not play on my Android phone?” I have to say was pretty annoyed and started looking around at various forum posts where I quickly realized that the CPU in the Galaxy Mini was a ARMv6 CPU. Hey, I thought… Of course, these new Smartphone devices have all kinds of weird and wonderful CPUs etc, I bet supporting multiple new chipsets for both Air and the huge influx of new browsers with plugin lockouts is a total pain in the neck especially for bindings to Stage3D and Stage Video etc, Adobe must really have their work cut out!

With this in my mind, everything suddenly fell into place. Ahhh… this is the reason that Adobe are looking at HTML5 tooling. Maybe Adobe will move to support HTML5 tools for the browser and concentrate their efforts on Adobe Air for Application development, which are now dominating the mobile markets, but why would they do that?! Well…the mobile application market is in the same state as the browsers were when Macromedia pushed Flash to the browser in the first place!

 

RIAs have changed (again)

OK, why is this actually good from anyone’s stand point? Anybody familiar with a new smart mobile device understands that the latest mobile operating systems are actually good. They allow developers to create applications that give access to customized representations to services, many of which are in fact web services themselves. This paradigm change sees a massive drop in the need for RIAs to be within the browser, that coupled with the new market paradigm, developers are flocking to various independent platforms. So are you an Android, iOS of Blackberry developer etc? Well… I’m all of these! Why?, because Air is deployable to each of these platforms making Air a very valid choice for a developer like myself.

 

Mobiles, Tablets & TVs are new markets

It’s apparent then that Adobes approach moves from one of cross browser RIAs to one of cross platform applications and for this it is important to note that Adobe wishes to concentrate their efforts here. (Why not? HTML5 is here to save many of the browser issues of old right?) Air developers can deliver applications to the desktop, mobile, tablet, TV etc so will we see an shift in deliverance for desktop? Looking at Windows 8, it might just happen! Previously, the browser efforts were all about making a seamless user experience for web services, so downloading applications to the desktop may not have been desirable and I would agree with that, yet this is where Adobe are stepping aside to make way for HTML5, something that so many people have been asking them to do. Here though, I should remind people that there is a HTML5 tag which is part of its official specification, it’s the trusty <embed> tag this remains and was there there when we witnessed browsers fighting each other for market dominance and it provided us with calm RIA stability from Macromedia and then Adobe. Across browsers, we knew what our applications would look like and we knew that they would work correctly and for the last 10 years this has been my biggest appreciation of Flash. HTML5 is here and aimed to fix most of these problems, but a new paradigm dropped in the pond and created new ripples and I believe that Adobe have simply identified the same developer issues with various new devices and are here to smooth them over once again but we cannot forget that manufactures who block plugins are in fact lacking part of the HTML5 specification.

 

People come first

Ex-employees are blogging that Adobe management informed staff around the same time as the public about their employment fate and for me, this is the worst news to come out of all this. They have stated in their own blogs that technology is a business and it is nothing personal yet many people are sat on the streets around the world informing others about the coldness of such monolithic, financially driven entities. I’m sure that the many people who find themselves unemployed today will go on to further their careers and take what they learned with them and continue to develop in their fields and I know that you will join me in wishing them every success in the future.

Matrix Icon

Stage3D Tutorial – Part 2

4

Enter the Matrix

I am not a mathematician, in fact, I’d go as far as to say that my elementary mathematical ability is terrible, overruled by complex number, calculus and strange thoughts about the general concept of numbers around theoretical physics, anyway, I think I’ve somehow managed to figure out quite a bit about geometry and the 3D mathematics that allows one to simulate some of the effects of 3D spacial manipulation that we see around us on a daily basis. The thing that has enabled me to do this is pure perseverance. I guess that is an ability in itself yet I must stress that I learned this without any formal training so perhaps it should come with a guarantee WARNING (There isn’t a guarantee). Right, disclaimer over but I’d also like to say that I’ve probably done it the hard way and taking linear algebra and/or trigonometry lessons in school, college or university might help you if you find this tough going. Of course, there is also a large number of online resources to keep you busy so if you don’t like what you see, please go see Mr. Google at his usual home.

This tutorial is specifically geared towards 3D when approaching it with regards to computer graphics. I’m going to outline some of the basics of three dimensional math which will include information about vectors, the purpose of matrices and why the sin and cosine trigonometric functions are so important when simulating 3D space. I will then visit the concepts of projection where I will concentrate on delivering some of the concepts that allow you to put your 3D scene onto your 2D monitor. For further information about projection, I suggest looking up one of the greatest mathematicians of all time, August Ferdinand Möbius.

 

Vectors

You probably use vectors every day without knowing it. The number line (you know, basic counting) is a one dimensional space right? You can move along it in a single dimension. That gem of knowledge took me about a year to figure out on my own, congratulations, you now know it (or already knew it). OK, lets elaborate further. Generally, when we start counting, we start at zero. It makes sense in our everyday world and it will make sense here too. So, below, I present the trusty number line with some positive and negative integers (whole numbers) shown.

 

 

Let’s look at at the number line because it’s so often dismissed and in my opinion, I think that this is a bit of a problem in the way that numbers are usually taught. Here are a few things I noticed about it;

  • I assume that the number line would keep going forever, to negative infinity on the negative side of zero and to positive infinity on the positive side of zero.
  • I can select a single point on or in-between any of the integer values.
  • It is one dimensional (Some might call this line the x dimension, that’s just a convention and could just as easily be; foo, y or yo’ mamma).
  • Any single point on the number line can be represented with a single numerical value.
  • An addition to any given value on the number line would move us positively along the number line (in this case, right).
  • A subtraction to any given value on the number line would move us negatively along the number line (in this case, left).
  • If I started at zero and added a random value, lets say four, I could represent that addition as a direction of right and magnitude of four.
  • If I started at zero and added a random value, lets say four, I could represent that addition as a direction of right and magnitude of four.
  • If I started at zero and added a random value, lets say four, I could represent that addition as a direction of right and magnitude of four.

 

Yes…that’s right, I was supposed to write that three times. Why? Let’s look at the definition of a vector from Wikipedia:

In elementary mathematics, physics, and engineering, a Euclidean vector (sometimes called a geometric or spatial vector) is a geometric object that has both a magnitude (or length) and direction.

 

What a revelation! We actually do vector maths every day when we calculate the change from the shop, it’s just that we’re bound to use a single dimensional that we call the number line. Let’s prove this point by doing some vector maths in our little one dimensional, infinite universe. Perhaps the easiest place to start would be to do some simple vector addition right? Firstly, we must note that we must designate a starting point on our number line, we call this the origin. Our origin will be at zero and instead of using yo’ momma as our axis name, I think it’s probably best that we stick to the convention and use ‘x’.

We can see that starting from the origin, if we were to add four, we could represent the resulting vector with an arrow starting at zero and ending at four. Lets take a look at that.

 

 

So, with a single number of four, we managed to determine both a direction and magnitude. So, what if I were to add another vector to this vector, lets say, a vector that goes in the same direction with a magnitude of two? Lets take a look at that.

 

Well, I colored the resulting vector in green, it seems that the addition of a vector in the positive direction with magnitude of four and a second vector in the same direction with a magnitude of two results in a vector in the positive direction with a magnitude of six. So isn’t this just basic math? Yes…however, starting to think about basic math in this way means that we can tool ourselves with some new interesting concepts:

  • If I wanted to move the resulting point to the right, I could add a positive vector at the beginning or end of the addition.
  • If I wanted to move the resulting point to the left, I could add a negative vector at the beginning or end of the addition.
  • If I wanted to make the vector have a length of one, I could just divide it by the positive value of its length. (as long as it’s length is not zero)
  • If I wanted to scale it so that it became bigger, I could multiply its length by a value greater than one.
  • If I wanted to scale it so that it stayed the same size, I could multiply its length by one.
  • If I wanted to scale it so that it got smaller, I could multiply its length by a value smaller than one.
  • I could calculate it’s direction in relation to another vector.
  • More….

Woah…This is a lot of functionality that just popped out of our simple number line but how can you code this functionality for your new one dimensional world? Well, first of all we can build a Vector.

Note: Flash has some built in Vector classes that can be used, but we’re learning so lets build our own. Also note, this is not the typed array version of a Vector, it is the mathematical construct of the same name.

 

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
package io.plugin.math.algebra
{
 
/**
* A one dimentional, Vector class
* @author Gary Paluk - http://www.plugin.io
*/
public class Vector1D
{
private var _x: Number;
 
public function Vector1D( x: Number = 0)
{
_x = x;
}
 
public function get x():Number
{
return _x;
}
 
public function set x(value:Number):void
{
_x = value;
}
 
}
 
}
package io.plugin.math.algebra
{

/**
* A one dimentional, Vector class
* @author Gary Paluk - http://www.plugin.io
*/
public class Vector1D
{
private var _x: Number;

public function Vector1D( x: Number = 0)
{
_x = x;
}

public function get x():Number
{
return _x;
}

public function set x(value:Number):void
{
_x = value;
}

}

}

 

OK…basic, it is a number. Nothing exciting there, but lets start adding some of that functionality we discovered earlier, how about that addition:

1
2
3
4
public function add( v: Vector1D ): void
{
_x += v.x;
}
public function add( v: Vector1D ): void
{
_x += v.x;
}

And subtraction?

1
2
3
4
public function subtract( v: Vector1D ): void
{
_x -= v.x;
}
public function subtract( v: Vector1D ): void
{
_x -= v.x;
}

What about one of the functions that’s a little more complicated? Scaling?

1
2
3
4
public function scale( scaler: Number ): void
{
_x *= scaler;
}
public function scale( scaler: Number ): void
{
_x *= scaler;
}

Hmmm, that was even more simple that the addition and subtraction methods. What about the function where we make our vector have a length of one? This function is very useful later on, for now, you only need to know a couple of things, this function is called normalization so we will give our method the name normalize() and that when we normalize our vector, we must preserve its direction.

1
2
3
4
5
6
7
8
9
10
11
12
13
public function get length(): Number
{
return Math.abs( x );
}
 
public function normalize(): void
{
if ( length == 0 )
{
throw new Error("A division by zero is not possible as you're not Neo.");
}
scale( 1 / length );
}
public function get length(): Number
{
return Math.abs( x );
}

public function normalize(): void
{
if ( length == 0 )
{
throw new Error("A division by zero is not possible as you're not Neo.");
}
scale( 1 / length );
}

 

OK, anyone slightly familiar with programming a bit of AS3 will now be tooled up with a few pretty boring functions of one dimensional vectors but we are interested in 3D so lets step things up a bit by entering the second dimension. You might already be familiar with a second dimension. If you’ve ever done some Flash coding, MovieClips have been able to be moved around the screen on at least two dimensions since the program was first available. You might know this second dimension by it’s axis name, y. It is 90 degrees out of phase with the x dimension and again, y is just a convention, usually associated with a vertical axis. We will make our second dimension opposite to the direction that Flash uses for its screen co-ordinates, as the direction of these axes is completely up to the programmer.

 

 

With this new addition of a second dimension, to specify a point in our 2D space, you will notice that must provide two numbers instead of one. We will do this in order of (x, y), x being the point on the x axis and y, the point on the y axis. Our origin will be in the center at (0, 0). Lets do something similar to what we did on our earlier example in one dimension, we will add a vector of (5, 2) and draw it with a red line to indicate the resulting vector.

 

I will add another vector (-3, 2) indicated in blue and I will draw the final result of the addition in green again.

 

 

The result of our addition is a new vector from (0,0) to (2,4). We could calculate its length and we can see that it definitely has a direction. The old single, horizontal axis made figuring out a vectors direction quite easy, if it was positive it was was at 90 degrees (if zero degrees is positive y) and if it was negative, it was at 270 degrees. It was always going to point either left or right unless it’s length was zero, but now it just be at any angle from 0 to 360. Maybe we will need this information later on, so lets keep it in mind.

 

This tutorial is being worked on, but right now, I have to do some work so I’ll bee back on it tomorrow morning! :D

Stage3D

Stage3D Tutorial – Part 1

2

Finally, it’s here!

You can now officially download Flash Player 11 from the Adobe website. I’m pretty sure many people are now aware that Molehill 3D capabilities have been added to this install of this Flash Player and today I’m going to show developers how to work with the new Stage3D stuff and explain some of the new concepts.

I have been working with Stage3D and was involved in the beta program for some time and my 3D Engine project, Zest3D, was announced last year at Adobe MAX 2010. I’m currently starting up an indie development company and before this I was was working full-time so I’ve not had a chance to work on this project recently, hopefully that will change in the near future but, for now, lets get started learning the basics.

First of all, this is what you are going to build over the course of these tutorials (You’ll need the Flash Player 11 to view the Flash object below). This is an in-depth look at all of the core aspects of writing a 3D engine in Flash. In this chapter, we will cover some definitions, Stage3D, Context3D and then we’ll take an in-depth look at buffer data structures and how we can provide these to our GPU enabled Flash Player. All code is written to be compiled in FlashDevelop and the project downloads will become available at the end of the series.

 

SwiftShader

There is a software rasterizer that comes packaged with the latest release of the Flash Player, it is called SwiftShader. It was created to mimic the programmable pipeline of a modern 3D graphics card in software and simulates the pipelines of DirectX 8/9 and OpenGL ES. Of course, because this is a software rasterizer, it runs more slowly than hardware rendered graphics and should be used as a fall-back if DirectX 8/9 or OpenGL ES is unavailable on the target machine.

 

What is Stage3D?

First of all we need to understand what a rasterizer is. Rasterizers draw things to the screen and in most 3D applications, the rasterizer draws triangles, with either a reference to an image or color information to be placed within the triangle. The rasterizer draws this data on the screen, usually line-by-line, it is then positioned and scaled as instructed. Using a vertex shader we can alter the positional information, where our triangle line intersections appear and using a fragment shader, we can alter the image or color data and positions etc of the pixels placed within our triangle. We can even alter this information again by sending in blocks of data, such as a cameras position along with small programs, in order to use these values to affect the final position and color of a pixel in our rasterized image. Stage3D is a reference to a displayable object allocated for either DirectX 8/9, OpenGL ES or SwiftShader to display the rasterized image created by our hardware or software rasterizer and is an access point to a hardware layer abstraction to these same rasterizers.

 

What is Context3D?

Context3D is a concrete object and abstraction, providing the programmer access to an API geared towards requesting and/or allocating image and/or geometric data resources, to be used by any of the available rasterizers (Usually, this will be the fastest available and Flash can detect this for you). Context3D also allows you to set some simple states for the rasterizer, but we will come to that much later.

 

Getting Started

We can access a Stage3D instance from a Vector.<Stage3D> contained within the stage instance, there are four available. We request a Context3D instance from  Stage3D and listen for the Context3D instance to become available:

1
2
stage.stage3Ds[ 0 ].addEventListener( Event.CONTEXT3D_CREATE, onContext3DCreateHandler );
stage.stage3Ds[ 0 ].requestContext3D();
stage.stage3Ds[ 0 ].addEventListener( Event.CONTEXT3D_CREATE, onContext3DCreateHandler );
stage.stage3Ds[ 0 ].requestContext3D();

When the Context3D instance is created by the Stage3D instance, an Event is dispatched. We need to listen for this Event and handle it accordingly:

1
2
3
4
5
6
7
private function onContext3DCreateHandler( e: Event ): void
{
var stage3D: Stage3D = e.currentTarget as Stage3D;
 
// we can now access our newly created Context3D object
var context3D: Context3D = stage3D.context3D;
}
private function onContext3DCreateHandler( e: Event ): void
{
var stage3D: Stage3D = e.currentTarget as Stage3D;

// we can now access our newly created Context3D object
var context3D: Context3D = stage3D.context3D;
}

 

Vertex Buffer

Remember earlier, I mentioned geometric data. Well, imagine I want to describe one of those triangles that the rasterizer needs to know about. How do I do that? Well, if we imagine drawing a single triangle in 3D space, I just need to know the three points that define the triangle. Since this is 3D space, each point would need three values, an x, y and z say. So lets imagine that we arrange these as x, y, z tuples. To describe my first point, I would have three numerical values in order of x, y, z and since I need three points, that would make a total of nine values. When building our vertex buffer, it is important to note, vertex buffers can contain more information than just positional point data, they can contain colors, normals and tangents etc but for now lets look at a structure that has points and colors. Here you can see a packed vertex buffer with three vertices. Each vertex contains the x, y and z point data and also contains red, green and blue color data. We can pack this data into either of two structures; a ByteArray or a Vector.<Number>. In this tutorial, I will use a Vector.<Number>.

 

 

We must request the memory allocation for this Vertex Buffer from the Context3D object with the following line of code, it is important to note that I am going to allocate space for four vertices, since our plane will require an extra point for our second triangle:

1
var vertexBuffer: VertexBuffer3D = context3D.createVertexBuffer( 4, 6 );
var vertexBuffer: VertexBuffer3D = context3D.createVertexBuffer( 4, 6 );

When we do this, we are essentially allocating some memory for this buffer in the relevant rasterizer. The parameters request the necessary space for four vertices, each with six elements. We are then able to upload our packed vertex buffer data into this space with the uploadFromVector() method, where we pass our Vector.<Number> as a parameter.

1
vertexBuffer.uploadFromVector( vertexBufferData, 0, 4 );
vertexBuffer.uploadFromVector( vertexBufferData, 0, 4 );

Here, we’re sending the vertex buffer data with a starting index of zero and sending all four vertices into the hardware’s internal memory (Or the memory referenced by SwiftShader of course). I will need to send the Vector.<Number>, which describes my vertices, to the GPU, the following code illustrates this:

1
vertexBuffer.uploadFromVector( Vector.<Number>( [ -1, -1, 0, 1, 0, 0, -1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, -1, 0, 1, 1, 0 ] ), 0, 4 );
vertexBuffer.uploadFromVector( Vector.<Number>( [ -1, -1, 0, 1, 0, 0, -1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, -1, 0, 1, 1, 0 ] ), 0, 4 );

All these numbers look like they would be difficult to manage, but later we can make a helper classes and structures to aid us with the management of entering or extracting data into or from our buffers, for now, you just need understand that it is necessary to allocate the correct amount of space for your packed vertex data. We can now tell the Context3D about the inner structure of the data we just sent it:

1
2
context3D.setVertexBufferAt( 0, vertexBuffer, 0, Context3DVertexBufferFormat.FLOAT_3 );
context3D.setVertexBufferAt( 1, vertexBuffer, 3, Context3DVertexBufferFormat.FLOAT_3 );
context3D.setVertexBufferAt( 0, vertexBuffer, 0, Context3DVertexBufferFormat.FLOAT_3 );
context3D.setVertexBufferAt( 1, vertexBuffer, 3, Context3DVertexBufferFormat.FLOAT_3 );

This provides the GPU with information about how the data in the Vertex Buffer is structured. For each vertex component i.e. position and color, we must provide information about where it starts in relation to each vertex and also we need to provide information about how many values are contained within each component. Here we are using positional point data which has three values; x, y and z so must use Context3DVertexBufferFormat.FLOAT_3 to describe that the position data consists of three floating point values. For each vertex, our positional data starts with an offset of 0. Likewise, our color data also consists of three floating point values; red, green and blue so we also provide Context3DVertexBufferFormat.FLOAT_3 as our format parameter, however, since our positional data already took up three spaces, our color data starts with an offset of three. This data can be referenced by shader programs, but we will discuss that next time! :) onwards……

 

Index Buffer

You may have been thinking to yourself, the example shown above contains a flat plane and therefore must use two triangles, yet in his Vertex Buffer, we don’t have six vertices. If so, good observation. If we think about our flat plane, it’s evident that you would only need four points to define the vertex positions for our two triangles but we would need to use some of these points multiple times. This is where our Index Buffer comes into play. The index buffer is a Vector.<uint> that defines the connections between our vertices. Look at the image below, you will see our four vertices, indicated in red. You’ll also see that I have also numbered them from zero to three. I have included the x and y positions around the outside and z values are implied to be 0. The blue arrows indicate where we would need to join these points in order to create the two triangles for our plane:

 

 

Both triangles are indicated with the blue arrows in a clockwise direction. This is called the winding direction and may be either clockwise or counter clockwise, here I use clockwise. Starting from any point on a triangle, I can define my two triangles and reference them to the vertices I stored in my Vertex Buffer. I’m going to choose; 2, 1, 0 and 3, 2, 0. That’s it, this is the structure for our index buffer. We can now request our memory space and allocate our Index Buffer with the following code:

1
2
var indexBuffer: IndexBuffer3D = context3D.createIndexBuffer( 6 );
indexBuffer.uploadFromVector( Vector.<uint>( [ 2, 1, 0, 3, 2, 0 ] ), 0, 6 );
var indexBuffer: IndexBuffer3D = context3D.createIndexBuffer( 6 );
indexBuffer.uploadFromVector( Vector.<uint>( [ 2, 1, 0, 3, 2, 0 ] ), 0, 6 );

Again, you’ll notice that we must tell the Context3D instance about the size of our Index Buffer and if there are any offsets.

 

Conclusion

Some of the structures that we have covered in this tutorial will really start to get you rolling with the ideas of programming for the GPU. These structures are highly optimized for delivering data that can be iterated quickly and efficiently by the graphics hardware. These structures are the very foundations of geometry data storage for use in the Flash 3D API and having a grasp on these basic ideas will prove useful when continuing these tutorials as we will refer to them often.

 

Next Time

In our next installment, we will learn about the following topics:

  • Mathematics of 3D
  • Graphics pipeline
  • Projection
  • Rendering
ninja150x150

8-Bit Ninja

0

Our Test Title: 8-Bit Ninja

Since we don’t officially open our doors until January, we are currently going through a process of developing tools and also making decisions on technologies in an effort to optimize our projects workflow, maintainability and support systems. We hope to identify where there may be issues with deployment, lack of tool support or underestimated timescales. On the game side, we decided that one way to achieve this would be to simultaneously work on a test title in the hope that this would unearth some of the problems that we may possibly face with our chosen tools and approach to game development.

We’ve called our test title 8-Bit Ninja! A throwback to the gameplay of old and a homage to the nostalgic platformer titles. With 14 levels set in 5 different environments, you take control of ‘Nui Ninja’, out to save her boyfriend ‘Soh’ from the deadly assassin ‘Hitoki’. 8-Bit Ninja is set in a variety of classic environments in an attempt to really capture the essence of the classic platform era. You must battle through each of these levels, eradicating Hitoki’s henchmen and defeating end of level bosses, to move on to the next stage.

Here is a rundown of the environments that lay ahead of you:

  • Jungle Path
  • Caves
  • Factory
  • Cityscape
  • Hitoki’s Lair

Please bookmark us or keep visiting to keep up to date with new information about the game and release dates.

 

Early Jungle Path preview

 

Flod logo

Welcoming FlodXM

0

Flod logoWelcoming FlodXM

 

FlodXM is a fantastic new audio library written in AS3 by Christian Corti. It’s purpose is to allow playback of XM audio modules created in popular tracker software, such as FastTracker II and MilkyTracker, amongst others. Tracker music is seeing a huge comeback, especially through many independent game developers such as ourselves, many finding it appealing due to it’s nostalgic qualities, others due to the small memory footprint of the files and another reason may be that more retro style games are being produced and the sound fits perfectly with this graphical style. Whatever the reasons, we like it!

Once upon a time chiptunes were created due to hardware and memory limitations, these audio files were designed to produce small files that would run on hardware that would be considered limited by today’s PC and console standards. The samples were often in 8-bit or 16-bit format with low sample rates. Module files often have a distinctive sound as many of the older systems would produce sounds based around square waves, sine waves, triangle waves and perhaps a random noise channel for good measure. Combined with a simple sound envelope to allow for attack, sustain and decay, these older computers could produce a wide range of instrument samples, albeit, often sounding slightly robotic (Which is actually very cool).

The move towards producing highly sampled audio playback was on. Software companies often despised these limitations, they wanted to have deep involving audio and sound effects which could make use of the ever increasing memory allowance and sound like CD quality audio. Well, it happened. Modern games consoles and PCs can indeed play very highly sampled, multi-channel audio and effects and when done correctly, it sounds fantastic! What’s more, the realization hit that so did the tracker music. Many of the tracks written for machines such as the Amiga, Atari, Nintendo and other 8-bit and 16-bit machines have developed a highly active and dedicated scene around them. Music producers have picked up the tracker software again and creating amazing music using more than the basic envelopes. Effects such as portamento, vibrato, arpeggios and other cool, interesting effects.

FlodXM aims to play the XM file format files with a good level of accuracy and is still currently being worked on although many of the features seem to be working well. This blog documents my own findings about the completeness of the library but you are invited to download some files from the wonderful ModArchive website and encouraged to comment with your own findings in the field below. Here is the latest Alpha 3 build of FlodXM allowing you to listen to the XM files directly off your HDD.

 

 

Findings on FlodXM

 

After some looking around, it seems that the following gaps exist in the FlodXM player:

  • 3xx doesn’t slide notes or re-trigger envelopes
  • EDx doesn’t delay notes
  • Kxx cuts note immediately, not after X number of ticks
  • Tone portamento effects are known to be inaccurate and are being worked on

 

Christian Corti claims that 3xx should work correctly, so the findings by pgil may be based on errors in the module that he has tested.

There are also Individual reports of single tested XM files not working 100% correctly and exhibit the following behaviors:

Dubmood – Cydonian Sky

http://modarchive.org/module.php?36546

“Mostly accurate, but the portamento effects aren’t working. This is noticeable in the bass at the start, and in the high pitched noise which should bend down quickly instead of staying at one note.”

 

Raina – Cyberculosis

http://modarchive.org/module.php?165308

“This uses Rxy on a noise sample to make the hi-hats. According the Milky docs ( http://milkytracker.org/docs/MilkyTracker.html#fxRxy ) the effect is notoriously dodgy. Even the popular MikMod library gets this song wrong. Also there are a few pitch inaccuracies and other weird things, but I’m not quite sure what’s going on there.”

 

Conclusion

 

FlodXM is a great library which is able to be worked with in its current state if the musician takes into account some of the current limitations and designs around them. Although this is not perfect, it seems that the continued effort on the FlodXM library will see it mature into a capable XM playback library and hopefully, many XM files will be introduced into the Flash gaming world. We will be promoting the use of XM files within our games to create a nostalgic take on plugin.io games in the near future. If you would like to contribute to these ongoing effort, you can easily donate to the project at https://github.com/photonstorm/FlodXM.  Thank you to Christian Corti for his continued efforts and expect to hear some thumping XM sounds in your Flash gaming very soon.

We’re hiring!

0

Want to work for a small, fun, dynamic, independent game company?

 

plugin.io are currently looking for a Graphic Artist and Sound Engineer to join us in creating fun and exciting games for Flash, HTML5, iOS, Android and other platforms. A great package awaits the right people so please tell us about yourself today.

 

Graphic Artist

 

  • Must be able to show skills in a variety of graphical styles including pixel art, 3D and concept art, especially Manga or Chibi style, retro pixel art and low poly 3D modelling.
  • Display a self-disciplined and effective workflow to attain a high level of productivity.
  • Manage their artwork well, making sure that it is organized and backed up using our SVN servers. (Training will be provided)
  • Use tools such as Adobe Photoshop, Adobe Illustrator, 3D Studio Max or your own preferred software effectively.
  • Enjoy working in a relaxed, fun and modern games company. ^_^

 

Sound Engineer

 

  • Show an ability to create sound effects and audio tracks in a variety of styles, especially, chip-tunes in a number of formats such as mod, xm, mp3, wav etc using tracker software.
  • Show evidence of using tracking software effectively such as FastTracker II, MilkyTracker or another of your choice.
  • Able to self manage their work-flow to meet deadlines.
  • Organize their tracks making sure they are archived and backed up using our SVN servers. (Training will be provided)
  • Enjoy working in a relaxed, fun and modern games company. ^_^

 

Where are we?

 

 

Let me apply!

 

To apply for a position with plugin.io, please fill out the following application form and if successful, we will contact you very soon.

 

  • If you showcase your work online, you can provide us with links to your work. Some people find this a simple way to link us to their online presence.
  • If you have a Resumé or C.V. you may use the form below to provide us with information about your work experience and education history. Please select the file from your computer.

 

Logo

Welcome to plugin.io

0

LogoWelcome to plugin.io

Thank you for heading over to our new little place on the Internet. If you don’t know, plugin.io is a small start-up independent game studio. We were created to build fun, playable games for a large variety of web, mobile and tablet platforms. Our work-flow pattern aims to make game delivery quick and allows you to fully engage with us during the development of our games. Our artists, musicians and programmers stream all of their work over live video streams, letting you to give live feedback, learn the tricks of the trade or just avoid doing your homework. (links to be announced soon). We are currently building this website so please keep checking back to see the exciting features that we will continue to introduce to the site.

 

Sponsors

Get access to our brand new games before anyone else! We work very closely with all our game sponsors to enable great branded content on a solid primary sponsorship model.  We ensure that sponsors have the opportunity to maximize the return from their sponsorships. We use the well known FGL for the paper work and we do everything to get you the very most from your sponsorship.

Publishers

We allow publishers to use and distribute site-locked versions of our games freely from your website. By signing up to our Publisher Newsletter, we will let you know when a new title is available, on the very same day it becomes available, allowing you to place exciting new games directly into your web pages or applications. What’s more, we can even host the content for you saving you bandwidth and money.

Developers

We are developers and we benefit from the libraries and efforts of the open source community daily. Therefore we believe that we should share in this open development paradigm and developers should have full access to our games complete core source codes after the game has been out in the wide world for a while. Three months in fact!

Please note that you can subscribe to our RSS, Twitter, Facebook or Google+ accounts for information on our latest games, tutorials, code samples and indie game development news.

Go to Top