Archive

Archive for July, 2009

how much money can be made from flash games professionally

July 31, 2009 Comments off

You could actually make some, but remember that sites like addicting games will pay about ~5000$ for a good game. If they buy the rights for the source and you do not get any credits in your game usually, you could get another 5000$, so that’s about 10k for a game. Remember that most decent games out there, are made by a small team of about 2-4 people. Most of the time, if you got really proficient AS3 programmers, you could get away with about 150 hours of programming for a normal game. At an hourly rate of ~18$ you get ~2700$ loss for programming alone. If you can get away with that much art, because people like beautiful games you could go as far as ~200 hours (5 weeks – 1 person) at ~14$ you deduct another ~2800$. so costs are roughly around 5500$. That means that unless you give total rights to your game you will never make good profits for small games. Profits run around 5k to 4k for those kind of games. They do pay for staff and help a little to pay bills, software licenses and utilities. As a side note, Canadian’s get a better ROI because the current exchange rates.

As far as i know there is a market for 5k games, but you must have talent on your side. Right now the only person i see really making money from small flash games are the portals with ads. As much as i would like to see the figures they get from ads, i know i won’t. Some of those portals actually gives you bonuses if you make it to the big charts. The way i saw how much Digg makes per months (~250k+ when it used ad sense), some of those sites are bound to have more money than that for game makers.

There is a very lucrative market out there for existing IP’s like TV shows and TV content. If you can get in touch with those kind of contacts, those contracts hover around the 100k and up to 300k. But be prepared to deliver quality and on time ! Those project spans in the months and need you to have your production ready to the challenge. The challenges will be to meet deadlines and deliverable to get the cash. Be prepared to convert cartoon show materials to usable game content (if your lucky, Toon Boom material should transfers pretty well because its vector graphics). Be sure to have enough money to cover for a couple of months because any change of requirements could delay production and leave you dry on cash. Oh, and it seems to be the norm to be paid late. Late payments by publishers in the computer game business seems to be normal unless you have forged a pretty good standing reputation.

Some technical advice on making good frame rate games

If any of you remember the old fashion DirectX 3 to 7 where 2D graphics where starting to get good, well actually you can now do the same in flash in multi-platform ways. Actually, if you do not rely on the Sprite class you can get pretty high frame rates by just blitting (copying) BitmapData to another BitmapData (that you would use as a memory surface akin to DirectX) and finally copy the BitmapData to a single sprite that is child of the Stage. Now what i just told you here took us months to research the last two years. Actually Adobe’s Flex platform isn’t that great right now. As DirectX matured (and many others like OpenGL and SDL …) Flex should get performance upgrades. Be sure to use classes that do not have lots of memory footprints and you should be able to display lots of stuff with clever instancing.

From my expertise on AS3, i would recommend the following books i heavily used, to anyone interested in making games in flash :

ActionScript 3.0 cookbook

This one i liked because there’s secrets that you could just not find two years ago on the net. Sometimes it was good for stuff that i forgot how to do. This book has almost all the small things, hard and simple to do. This is a good reference book to keep close by.

Essential ActionScript 3

If you want to get comprehensible help (because adobe’s help is good but its not Microsoft good) get this book, actually if you read it from cover to cover, you will know everything there is to know about the action script language.

Foundation ActionScript 3 Making things move

This one is for learning the multimedia helpers Flex gives you. One thing that is good about this book, is that it is a comprehensible tutorial to get things working in either the Adobe Flex builder IDE, the Flash IDE or FlashDevelop IDE. You get to choose and learn how it works on eash platforms.

The Flash IDE

You should probably get a Flash CS XXX book to know how the Flash IDE works in more details, because one thing is certain, if you want to make a game in flash, menus and such will be made in the Flash IDE and then imported and instanciated in your flash application. This means you should get proper knowledge of the Flash IDE tool.

The dirty practices

Many of you may play these nice little games online at such sites as Kongregate, addicting games and many others. I used to work for a company making Flash games. What many users revere as one man made games in the basement can indeed be misleading. The quality of Flash games are getting to a point where you just cannot believe that a one man army made it. I cannot use any examples as i am bound by professional secrets, but some company actually get games from production firms like where i used to work and make people believe that its some student in their mothers basement that made it. Actually those company want to test out concepts and see if they work. So in a sense you play those games, give credit to some dude that you think is real but is actually fake, and then some time later, a new game with better graphics comes out and its a hit !

Conclusion

I hope this post will help newcomers to this industry know what to account for, keep in mind that numbers showed here get close to what i can account for it may not be the norm but it’s pretty close to what i have witnessed for the past three years. There is definitly enough money to be made even for a small startup in the current economic climate. Finally, online Flash games are fun to develop because the comitment time to them is never beyond 2 months, this means employees do not have time to get bored !

Update me when site is updated
Categories: Flash games

Isometric camera in javascript for Unity

July 19, 2009 8 comments

This script was crafted relatively quickly. It may be missing some features and is “as-is”. I recommend you add mouse move to it, but to understand the basics i used keyboard keys. As of now Unity on windows seems to have some hard time with my logitec mouse, on my other pc with a Dell mouse, the mouse scrolling for zooming works fine.

The script exposes the following properties :

Target

the target is a game object that you will want to disable the renderer if you put a 3d mesh or cube for debugging. it is the controller of the camera. When you hit a key this target will move and the camera will move towards it in an interpolated fashion.

x_Angle and y_Angle

These properties are set at the start-up of the object. One interesting thing you could add here is dynamic editing of the camera in real-time. to see the change, restart the game.

smooth_moving

Enable this for lerp movement of the camera, that is “smoothed movements”

smooth_factor

Set this smooth factor is smooth_moving is set to true. Default is 5.0

speed

Movement of target for translation. This is always modified by the delta time (time since last frame see the code its quite explicit)

x_bound_min, z_bound_min, x_bound_max, z_bound_max

This actually the bounds of your map or level, the camera will not be able to go beyond that point in both x and z axis.

zoom, zoom_bound_min, zoom_bound_max

Those control how far the camera is from the ground (y = 0). The zoom property sets the starting zoom point.

Javascript Unity Code :

var target : Transform;
var x_Angle : float = 45.0;
var y_Angle : float = 45.0;
var smooth_moving : boolean = true;
var smooth_factor : float = 5.0;

var speed : float = 5.0;

//maximum bound for x level (maximum going for camera on the x plane)
var x_bound_min : int = -50;
var x_bound_max : int = 50;

//maximum bound for y level (maximum going for camera on the y plane)
var z_bound_min : int = -50;
var z_bound_max : int = 50;

//for zooming
var zoom : int = 15;                //initialize the position based on the magnitude of the vector.
var zoom_bound_min : int = 15;        //minimum zoom magnitude
var zoom_bound_max : int = 65;    //maximum zoom magnitude

var SeeDebug : boolean = true;

@script AddComponentMenu("Camera-Control/Smooth Isometric Camera")

@script RequireComponent(Camera)

private var targetDir : Vector3;        //Get this after initial placement and then calculate z

function Start ()
{
if(!target)
{
Debug.LogError("You must have a valid game object as target to isometric camera, put it at 0,0,0");
}
else
{
transform.Rotate(x_Angle, y_Angle, 0);
}
}

function LateUpdate () {

if(target)
{

targetDir = -transform.forward zoom;

var finalZoomedDestination : Vector3 = target.position + targetDir;

if(smooth_moving)
{
//smooth moving of camera.
transform.position = Vector3.Lerp(transform.position, finalZoomedDestination, Time.deltaTime smooth_factor);
}
else
{
transform.position = finalZoomedDestination;
}
}
}

function OnGUI()
{
if(SeeDebug && target)
{
GUI.Label (Rect (25, 25, 200, 30), "Cam position:" + transform.position.ToString());
GUI.Label (Rect (25, 50, 200, 30), "Target position:" + target.position.ToString());
GUI.Label (Rect (25, 75, 100, 30), Input.GetAxis("Mouse ScrollWheel").ToString());
}
}

function Update() {
if (target)
{

if(Input.GetKey(KeyCode.W) && (target.position.z < z_bound_max))
{
target.position += (Vector3.forward speed) Time.deltaTime;
}

if(Input.GetKey(KeyCode.S) && (target.position.z > z_bound_min))
{
target.position -= (Vector3.forward speed) Time.deltaTime;
}

if(Input.GetKey(KeyCode.A) && (target.position.x > x_bound_min))
{
target.position -= (Vector3.right speed) Time.deltaTime;
}

if(Input.GetKey(KeyCode.D) && (target.position.x < x_bound_max))
{
target.position += (Vector3.right speed) Time.deltaTime;
}

if(Input.GetKey(KeyCode.Q) || (Input.GetAxis("Mouse ScrollWheel") < 0))
{
zoom -= 1;
zoom = Mathf.Max(zoom_bound_min, Mathf.Min(zoom_bound_max, zoom));
}

if(Input.GetKey(KeyCode.E) || (Input.GetAxis("Mouse ScrollWheel") > 0))
{
zoom += 1;
zoom = Mathf.Max(zoom_bound_min, Mathf.Min(zoom_bound_max, zoom));
}
}
}
Update me when site is updated
Categories: Unity3d

Importing 3d asset from 3ds MAX with FBX export

July 19, 2009 11 comments

One of the main problem i have seen so far with Unity3d is the difficulty of getting 3d content inside the application correctly. I have searched the unity3d forum only to find answers that are half satisfying or easy to understand from an artist point of view. By experimenting heavily we reached a point where the formula was found and here it is for your viewing pleasure :

Step one : Modeling

As it is the same with other 3d engines such as Ogre3d. You can actually construct your 3d model in any view. The most important thing to understand is that 3ds max has the Z as the height axis by default. I say height axis because in most engine Y determines the height at which your 3d model will be in 3d space. Z should be for close to far and X right to left. You should set your scale to your scene in meters now look into the 3ds max or in the “customize” -> “Unit setup” menu entry.

Step two : Modify the pivot point

Once the model is made, using your preferred technique, you now have to modify its axis to put the model in a stance where its X,Y,Z are correctly put to export with the FBX exporter. To modify the pivot go to the HIERARCHY tab and then click on the button “Affect object only”. You should experiment from this basic sauce if you have a more complex model (i am after all a programmer !), but for most object i think this should be ok.

You should now see the gizmo with its 3 axises. Click on the button “Edit working pivot” and then select the rotation toolbar button. This should make the rotation circle appear. I would recommend using the “Angle Snap Toggle” toolbar button also to align perfectly the Y axis. The next step is to make the green Y axis point straight up. Its final angle should be 90 degrees. Notice that the model should be facing the opposite direction that the Z axis is pointing. If it is not it would be a nice thing to make it so by either rotating the pivot or the model itself (you must understand that the fbx export will still swap the y axis, so the model will be facing the Z axis in unity)

Here is a snippet of final position with the pivot gizmo

NOTE : You should notice the axises on the bottom and the gizmo difference in orientation

Remember that it is a good practice to  position the gizmo at the right place where the position vector (center point) will be represented for this model in unity. (for a walking model, put it between legs, between feets)

Step three : Reset the xform

This step has been a huge headache where at my last job because it is sometimes omitted by the 3d artists. To reset the Xform and thereby making the model use the pivot information, go to the UTILITIES tab and then click on the button “Reset XForm”. That should make the model now use the new pivot reference. This is very important because now you can start to add a skin modifier correctly, bones and animations without further troubles.

Step four : UV Unwrap

I will not go into details about texturing a 3d models, check youtube there is plenty of nice tutorials on that subject…

Step five : Add the bones

Start boning your model if it has animations

Step six : Add the skin modifier

Start skinning and weighting all your vertices for each of your bones

Step seven : Animations

Now you can start to edit animations

Step eight : Export with the FBX exporter

Export to FBX. Be sure to get the latest fbx plugin from autodesk. Be sure to select the “Y-up” axis conversion and meter units. We encountered some warnings about the orientation of Diagonals on Editable Poly objects, but did not had any export problems whatsoever. Visit this link for further information on Unity and FBX export : http://unity3d.com/support/documentation/Manual/HOWTO-ImportObjectMax.html

NOTE : Be sure to specify a FBX version export like 2009 that Unity can understand, lots of problems arises because you did not chose the right version. Scaling is also pretty easy if you set up your units in max to be 1 unit = 1 meter.

This is what should show up in unity for your model when selecting it from the project hierarchy (notice its facing backward here) :

If you drag and drop the 3d model, it should now be axis aligned correctly in the scene (and Z facing) as this screenshot shows :

NOTE : This is a good starting point, it may not be perfect for all cases and you should look for help in the unity forum here for more assistance on this matter.

Update me when site is updated
Categories: Unity3d