If you have been tempted to cross the boundary between 2D interactive media or games or 3D animation into 3D games, you will probably know you need to get a decent 3D game physics engine.
That's where my brain has been lately, and consequently I have turned my attention to physics engines. In my mind it was initially a toss-up between Epic's UnrealEd, which comes with Unreal Tournament, or the FPS Creator from The Game Makers.
UnrealEd would have been first choice since I know it is used by a local university on their Game Art degree, on the other hand the FPSC had good features too, and in some ways was less complex and perhaps more suitable for allowing (high school level) students to quickly preview their characters and in-game objects.
However as I did some digging I found that the current plethora of game engines out there, including some open source offerings, has made the area highly competitive. So competitive in fact that well respected commercial engines are now becoming available FREE for personal use, or under developer licenses where you only pay if you make money. This combined with all the free stuff, makes for quite a choice.
Commercial Game Engines for Free
UDK - Unreal have released what they call the Unreal Development Kit, it contains all the tools previously only available to commercial developers or those with a lot of spare cash. This now seems to replace UnrealEd from my point of view.
FPSC - The Game Makers have released a free developers edition of FPSC. It has all the features of the pay for version minus network games and compile - but the pay for is only £30 these days anyway.
Unity - Described as being the best game engine this side of a $million, it normally retailed at about $200, but a free development version is now available too, and looks pretty amazing.
Freeware or Open Source Game Engines
Blender - Has long been capable of producing 3D games made interactive with Python scripting.
Platinum Arts Sandbox 3D Game Maker - purports to be popular with educational environments.
Cheap Game Engines
The 3D Game Maker - I thought I would throw this one in. Although very limited in terms of customisation, for some educational purposes (e.g. Level 1 and 2) this could be ideal. With a bit of technical know how students can include their own 3D models (.x format) in their games.
Well, I already owned FPSC, the 3D Game Maker, and UnrealED, but now I have downloaded Unity and the UDK (be interested to see how UDK is different from UnrealEd). I can hardly wait to get started.
Friday, 5 March 2010
Thursday, 18 February 2010
True Full Screen in Flash Player 7 or 8
Most flash based video players have a "full screen" option that makes the video fill your screen even if it originated from a small square in a web page.
But it can be used to make any SWF file fill the screen.
I use both MX 2004 or CS3 depending on which computer I am using. And I know there are still a lot of MX or 8 users out there. So, in case I forget, and in case anyone else finds it helpful, here's how you do full screen in MX 2004 or 8.
The whole thing is summed up in detail here:
http://www.adobe.com/devnet/flashplayer/articles/full_screen_mode.html
The ActionScript
Here is my AS2 implementation:
The thing that is different for MX 2004 and 8, when compared to using ActionScript 2 in CS3 is this:
and
these are different in CS3.
The HTML
The fullscreen ActionScript won't have any effect unless the object and embed parameters are set to allow fullscreen as follows:
For object:
For embed:
The HTML object and embed I use is described on the Adobe site here:
http://www.adobe.com/devnet/flashplayer/articles/full_screen_mode_04.html
An Example
Just click the square.
But it can be used to make any SWF file fill the screen.
I use both MX 2004 or CS3 depending on which computer I am using. And I know there are still a lot of MX or 8 users out there. So, in case I forget, and in case anyone else finds it helpful, here's how you do full screen in MX 2004 or 8.
The whole thing is summed up in detail here:
http://www.adobe.com/devnet/flashplayer/articles/full_screen_mode.html
The ActionScript
Here is my AS2 implementation:
/*first set the initial fullscreen value which is 0 because we are not yet in fullscreen */
var fullscr_status = 0;
/*Then a function that runs when the fullscreen button is pressed, this tests whether we are in fullscreen (1) or not (0). If not we go into fullscreen mode. If allready in fullscreen mode we come out of it. */
_root.button_btn.onRelease = function() {
if (fullscr_status == 0) {
//Fullscreen on
fullscr_status = 1;
Stage["displayState"] = "fullScreen";
} else if (fullscr_status == 1) {
//Fullscreen off
fullscr_status = 0;
Stage["displayState"] = "normal";
}
};
The thing that is different for MX 2004 and 8, when compared to using ActionScript 2 in CS3 is this:
Stage["displayState"] = "fullScreen";
and
Stage["displayState"] = "normal";
these are different in CS3.
The HTML
The fullscreen ActionScript won't have any effect unless the object and embed parameters are set to allow fullscreen as follows:
For object:
param name="allowFullScreen" value="true"
For embed:
allowFullScreen="true"
The HTML object and embed I use is described on the Adobe site here:
http://www.adobe.com/devnet/flashplayer/articles/full_screen_mode_04.html
An Example
Just click the square.
Labels:
actionscript,
as2,
Flash,
flash 8,
fullscreen,
mx2004
Wednesday, 10 February 2010
Design Out Crime
I received an email today from the Design Council and was immediately interested in an article about using design to cut crime. For me this is exactly what design is about, that is solving real world problems. As Ivan Chermayeff would encourage me to think - these solutions should come out of an understanding of the problem.
So what was the article about? Beer glasses, that don't break, or if they do, cause less damage to people - we are talking about cutting down incidence and opportunity for 'glassing' attacks.
That means designing something that has some aesthetic value, a practical use, and limited abuse.
Read the full article here:
http://www.designcouncil.org.uk/Design-Council/Files/Landing-pages/Design-Out-Crime/Alcohol-related-crime/?id=5335&WT.dcsvid=NDA5OTYwNDIwOAS2&WT.mc_id=
And you can watch a video about it below:
So what was the article about? Beer glasses, that don't break, or if they do, cause less damage to people - we are talking about cutting down incidence and opportunity for 'glassing' attacks.
That means designing something that has some aesthetic value, a practical use, and limited abuse.
Read the full article here:
http://www.designcouncil.org.uk/Design-Council/Files/Landing-pages/Design-Out-Crime/Alcohol-related-crime/?id=5335&WT.dcsvid=NDA5OTYwNDIwOAS2&WT.mc_id=
And you can watch a video about it below:
Designing the next generation British pint glass - the design story from Design Council on Vimeo.
Monday, 4 January 2010
What makes an 'Imax' 3D cinema image 3D?
I was discussing 3D stereograms last year in relation to Channel-4's 3D week, but I came across this interesting video clip on the BBC website when I was looking for information on 'The Pixar Story' a documentary "about the pioneering computer animation studio ".
The 3D shown here does not require coloured filters in the glasses, but does still adhere to the age old principle that 3D is constructed in the brain from seeing two slightly different images with each eye. Rather than coloured filters these use polarising filters. This gives the best colour reproduction of all the 'cheap' glasses methods - but I will let the video tell you more:
Further information may be found here >
The 3D shown here does not require coloured filters in the glasses, but does still adhere to the age old principle that 3D is constructed in the brain from seeing two slightly different images with each eye. Rather than coloured filters these use polarising filters. This gives the best colour reproduction of all the 'cheap' glasses methods - but I will let the video tell you more:
Further information may be found here >
Friday, 1 January 2010
Happy New Year
I wish you all a happy and prosperous 2010.
For me 2010 will see me continuing to work hard and learn hard, and getting the right balance between work and family. I believe that way points to satistfaction, health and success.
Happy new year.
For me 2010 will see me continuing to work hard and learn hard, and getting the right balance between work and family. I believe that way points to satistfaction, health and success.
Happy new year.
Monday, 28 December 2009
How to Become an Animator - Free e-Book

I won't pretend it's not a marketing campaign from AnimationMentor.com, because that is exactly what it is. But if animation is what you like, and you think animation is where you want to end up, then you just may find this valuable.
It's taking about 40 minutes to download so no review of content at present. But at a price of FREE, I'm not complaining.
You can download it here: http://www.animationmentor.com/landing/becomeanimator/ebook.html
Meanwhile, I will add my review later when I have had a chance to read from it
Wednesday, 9 December 2009
Custom Snow Effect in Flash
Whether or not we get a white Christmas outside, I can make sure I get one in my Flash work any time I like.
Components add to the functionality of Flash, basically making more complex actionscripts available to those of us who lack the time or the knowledge to program them ourselves. The Adobe Exchange is a great place to find components for Flash from MX right through to CS4, some free, some you have to buy.
Free Snow Effect Component
The component I want to tell you about is the free Snow Flash Effect component from FlashWanted by Corso Ria.
Download it here (you will need to get a free Adobe Exchange account):
http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1278523
Once downloaded just double click the MXP file and it will automatically install into the Flash components panel.
This particular component works with Flash versions MX 2004, MX 2004 Pro, 8 and CS3 (and maybe CS4 but I haven't tested it), so if you don't have access to the latest version of Flash, this should still work for you. In fact i'll be using MX 2004 to show you how it works since I don't have CS3 on this machine and I can't be bothered to pull the laptop out - it's really easy.
Basic Snow
To kick off you need to open the Components panel, and then open the FlashWanted group. In there you will find a component called "sneg".
Drag "sneg" to the stage and scale it to cover the area you want to be snowy.
Then, with the instance of the "sneg" component you dragged onto the stage selected, you need to open the Component Inspector.
Most of the fields in the Component Inspector are pretty self explanatory, and a bit of experimenting with the settings will give you the effect you want. You can even make the background transparent by changing the alpha setting, allowing you to overlay the snow over other layers.
And that's it.
CTRL+ENTER to test the movie and the snow begins to fall.
Customising the Snow
By default the snow is made up of very small white dots, but you can use your own flake design by using a symbol from your library.
To do this you need to first make a MovieClip to use as a snowflake, and then set it to export for actionscript. Do this by right clicking the symbol in the Library, and choosing the Linkage option.
Then set the identifier, what you type here is what you will also type in the Library Symbol field in the Component Inspector. I used 'flake_mc' as the identifier in mine.
Feel free to test away.
Further Customisation
If you are like me you will always be curious about how far you can push the technology beyond its original or obvious intention. I have seen other snow effect components in use that had more than one type of snowflake and allowed the snowflakes to tumble, or turn, as they fell.
It seemed pretty logical that, if I am specifying a MovieClip as a snowflake, any actionscript within that MovieClip that refers to the clip itself, ought to work. And, I was right.
In the previous step we looked at how the component allowed us to specify a particular MovieClip to use as a snowflake, rather than its own default 'dot'. What this means is that we can actionscript our snowflake MovieClip to apply certain attributes to itself, and this actionscript will work independently for each flake the component places on our stage.
In other words we can make 'intelligent' snowflakes to make up for where the component lacks. While the component takes care of the snow falling, each flake takes care of its own turn speed and appearance etc.
Here's how.
Random Flake Appearance
I am going to cheat a little here, this script will not actually generate random flakes, but what it will do is randomly choose a snowflake design from a selection that you will make.
What I did was make 5 different snowflakes and place each one on a different keyframe within a MovieClip called 'snowflake_mc'. Don't forget to put a stop(); action on each of these keyframes or your flakes will keep cycling through the 5 designs as they fall (which doesn't happen in real life). It's also a good idea to make sure each snowflake on each frame is positioned over the 'centre point' in the middle of the MovieClip symbol.
So what I end up with is a MovieClip called 'snowflake_mc' containing 5 frames, each frame containing a different snowflake design and a stop(); action.
The next stage is to open the symbol we specified in the Component earlier - flake_mc. Inside flake_mc you need to swap the snowflake design with the MovieClip you just made containing 5 flakes. Give this the instance name of 'snowflake_mc'. So what we end up with is a symbol called 'flake_mc' that is set to export for actionscript that contains another symbol called 'snowflake_mc' that contains our 5 flake designs.
Now for the actionscript. This goes on the first frame of 'flake_mc':
First we create a variable called 'flakedes' that is a randomly generated number between 1 and 5. we do this because we have 5 flake designs. This then acts as a random flake selector. We generate the number using Math.random, but this only gives us a number between 0 and 1. To turn this into a number between 1 and 5 I multiply it by 5 and then round it up using Math.ceil. (If I rounded down I would get a number between 0 and 4, rounding up guarantees between 1 and 5).
Then we tell the 'snowflake_mc' MovieClip (the one with 5 frames) to gotoAndStop at the frame number we just randomly generated. This then randomly displays on of our 5 flake designs.
Voila! As the component places a new flake on the stage the appearance of the flake is now randomly one of the 5 designs you made.
Flake Tumbling
This requires trickier actionscript (but still easy), but no extra graphics. A pure code solution to flake tumbling. This goes on the first frame of 'flake_mc' beliw the code we already have:
I wanted the flakes to tumble very slowly, all at different speeds of slowness, and in either direction. So the first part generates a small number, between -2 and 2. A negative number will equate to anti-clockwise tumbling, a positive number clockwise tumbling. We generate this number again using Math.random but this time we multiply the number by 4, to give us a random number between 0 and 4, but then we -2 from that number giving us a random number between -2 and 2.
We use this number as the variable 'rotfactor'.
What we then want to do is use the value of 'rotfactor' as the amount the snowflake will rotate each frame.
However within the MovieClip inside the component onEnterFrame doesn't work. So instead we approximate frames by using setInterval.
setInterval works by calling a function repeatedly, with an interval between each call. If we set the interval small enough it will be as good as calling each frame.
First then we have to write the function, then use setInterval to call the function.
Our function is very simple:
First we define the function and give it a name 'snowflakeroll', then we give the function its instructions which in this case is to tell the 'snowflake_mc' MovieClip to change its rotation value by 'rotfactor'. By using += rather than just = we add rotfactor to itself each time the function is called so it gets larger each time thereby increasing its angle of rotation with each call of the function.
Then we just need to call the function using setInterval:
We call the function by name, and then we define the interval in milliseconds. In this case 40 milliseconds calls the function frequently enough to creat a smooth rotation animation.
And that's it
And that's it. You're done. You have now got a basic component that simply chucks snow out, to give you random flakes with random tumbling speeds both clockwise and anti-clockwise.
Given all that we have done, I think it safe to assume they don't have to be snowflakes. What other MovieClips could it chuck out, and how could these be scripted? Over to you.
Happy Christmas.
Components add to the functionality of Flash, basically making more complex actionscripts available to those of us who lack the time or the knowledge to program them ourselves. The Adobe Exchange is a great place to find components for Flash from MX right through to CS4, some free, some you have to buy.
Free Snow Effect Component
The component I want to tell you about is the free Snow Flash Effect component from FlashWanted by Corso Ria.
Download it here (you will need to get a free Adobe Exchange account):
http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1278523
Once downloaded just double click the MXP file and it will automatically install into the Flash components panel.
This particular component works with Flash versions MX 2004, MX 2004 Pro, 8 and CS3 (and maybe CS4 but I haven't tested it), so if you don't have access to the latest version of Flash, this should still work for you. In fact i'll be using MX 2004 to show you how it works since I don't have CS3 on this machine and I can't be bothered to pull the laptop out - it's really easy.
Basic Snow
To kick off you need to open the Components panel, and then open the FlashWanted group. In there you will find a component called "sneg".
Drag "sneg" to the stage and scale it to cover the area you want to be snowy.
Then, with the instance of the "sneg" component you dragged onto the stage selected, you need to open the Component Inspector.
Most of the fields in the Component Inspector are pretty self explanatory, and a bit of experimenting with the settings will give you the effect you want. You can even make the background transparent by changing the alpha setting, allowing you to overlay the snow over other layers.
And that's it.
CTRL+ENTER to test the movie and the snow begins to fall.
Customising the Snow
By default the snow is made up of very small white dots, but you can use your own flake design by using a symbol from your library.
To do this you need to first make a MovieClip to use as a snowflake, and then set it to export for actionscript. Do this by right clicking the symbol in the Library, and choosing the Linkage option.
Then set the identifier, what you type here is what you will also type in the Library Symbol field in the Component Inspector. I used 'flake_mc' as the identifier in mine.
Feel free to test away.
Further Customisation
If you are like me you will always be curious about how far you can push the technology beyond its original or obvious intention. I have seen other snow effect components in use that had more than one type of snowflake and allowed the snowflakes to tumble, or turn, as they fell.
It seemed pretty logical that, if I am specifying a MovieClip as a snowflake, any actionscript within that MovieClip that refers to the clip itself, ought to work. And, I was right.
In the previous step we looked at how the component allowed us to specify a particular MovieClip to use as a snowflake, rather than its own default 'dot'. What this means is that we can actionscript our snowflake MovieClip to apply certain attributes to itself, and this actionscript will work independently for each flake the component places on our stage.
In other words we can make 'intelligent' snowflakes to make up for where the component lacks. While the component takes care of the snow falling, each flake takes care of its own turn speed and appearance etc.
Here's how.
Random Flake Appearance
I am going to cheat a little here, this script will not actually generate random flakes, but what it will do is randomly choose a snowflake design from a selection that you will make.
What I did was make 5 different snowflakes and place each one on a different keyframe within a MovieClip called 'snowflake_mc'. Don't forget to put a stop(); action on each of these keyframes or your flakes will keep cycling through the 5 designs as they fall (which doesn't happen in real life). It's also a good idea to make sure each snowflake on each frame is positioned over the 'centre point' in the middle of the MovieClip symbol.
So what I end up with is a MovieClip called 'snowflake_mc' containing 5 frames, each frame containing a different snowflake design and a stop(); action.
The next stage is to open the symbol we specified in the Component earlier - flake_mc. Inside flake_mc you need to swap the snowflake design with the MovieClip you just made containing 5 flakes. Give this the instance name of 'snowflake_mc'. So what we end up with is a symbol called 'flake_mc' that is set to export for actionscript that contains another symbol called 'snowflake_mc' that contains our 5 flake designs.
Now for the actionscript. This goes on the first frame of 'flake_mc':
/*randomly select which flake design to use */
var flakedes = Math.ceil(Math.random()*5);
/*set flake design to the one selected */
snowflake_mc.gotoAndStop(flakedes);
First we create a variable called 'flakedes' that is a randomly generated number between 1 and 5. we do this because we have 5 flake designs. This then acts as a random flake selector. We generate the number using Math.random, but this only gives us a number between 0 and 1. To turn this into a number between 1 and 5 I multiply it by 5 and then round it up using Math.ceil. (If I rounded down I would get a number between 0 and 4, rounding up guarantees between 1 and 5).
Then we tell the 'snowflake_mc' MovieClip (the one with 5 frames) to gotoAndStop at the frame number we just randomly generated. This then randomly displays on of our 5 flake designs.
Voila! As the component places a new flake on the stage the appearance of the flake is now randomly one of the 5 designs you made.
Flake Tumbling
This requires trickier actionscript (but still easy), but no extra graphics. A pure code solution to flake tumbling. This goes on the first frame of 'flake_mc' beliw the code we already have:
/*Generate a random small number of equal chang of being positive or negative. Positive equates to clockwise rotation, negative anti-clockwise */
var rotfactor = ((Math.random()*4)-2);
/* This function tells the snowflake_mc movieclip within the flake_mc clip to rotate by the rotfactor. */
function snowflakeroll () {
snowflake_mc._rotation += rotfactor;
}
/* this runs the above function every 40 milliseconds. */
setInterval(snowflakeroll, 40);
I wanted the flakes to tumble very slowly, all at different speeds of slowness, and in either direction. So the first part generates a small number, between -2 and 2. A negative number will equate to anti-clockwise tumbling, a positive number clockwise tumbling. We generate this number again using Math.random but this time we multiply the number by 4, to give us a random number between 0 and 4, but then we -2 from that number giving us a random number between -2 and 2.
We use this number as the variable 'rotfactor'.
What we then want to do is use the value of 'rotfactor' as the amount the snowflake will rotate each frame.
However within the MovieClip inside the component onEnterFrame doesn't work. So instead we approximate frames by using setInterval.
setInterval works by calling a function repeatedly, with an interval between each call. If we set the interval small enough it will be as good as calling each frame.
First then we have to write the function, then use setInterval to call the function.
Our function is very simple:
function snowflakeroll () {
snowflake_mc._rotation += rotfactor;
}
First we define the function and give it a name 'snowflakeroll', then we give the function its instructions which in this case is to tell the 'snowflake_mc' MovieClip to change its rotation value by 'rotfactor'. By using += rather than just = we add rotfactor to itself each time the function is called so it gets larger each time thereby increasing its angle of rotation with each call of the function.
Then we just need to call the function using setInterval:
setInterval(snowflakeroll, 40);
We call the function by name, and then we define the interval in milliseconds. In this case 40 milliseconds calls the function frequently enough to creat a smooth rotation animation.
And that's it
And that's it. You're done. You have now got a basic component that simply chucks snow out, to give you random flakes with random tumbling speeds both clockwise and anti-clockwise.
Given all that we have done, I think it safe to assume they don't have to be snowflakes. What other MovieClips could it chuck out, and how could these be scripted? Over to you.
Happy Christmas.
Labels:
actionscript,
adobe exchange,
component,
Flash,
Math,
setInterval,
snow,
snow fall,
snowflake
Subscribe to:
Posts (Atom)
