Saturday, November 15, 2008

1st Game

Autodesk Smoke Tips & Tricks - 1st Game

Although this game is qualified to be awarded the worst game of the century, but it is the first ever published smoke game !! A game that play on a million dolar machine.
The game is simple, there's a hiden treasure, you move the X around the screen to find it. If you're closed to the treasure, the word 'Close' will appear, if you're far, then 'Far' appear. If you are at the exactly position of the treasure, the word 'Correct!!' will appear.

First, add a axis (axis1), add a 'X' still (axis4), and 3 Texts, as picture above.
Text 1 type 'Far'
Text 2 type 'Close'
Text 3 type 'Correct!!' On text1 transperancy, enter expression :
if(abs(axis4.position.x - axis1.position.x) >150, 0, 100)

On text2 transperancy :
if(abs(axis4.position.x - axis1.position.x) <150
&& abs(axis4.position.x - axis1.position.x)!=0,0,100)
On text3 transperancy :
if(abs(axis4.position.x - axis1.position.x)==0,0,100)
On axis1, select both x & y, enter expression :
floor(truerand(-250,250))
Note that sometime 'truerand' will halt the machine. May be you can try this instead :
floor(noise(frame)*250)
Next, duplicate the 3Texts branche, and change the expression, just change the 'x' to 'y'.
On text6 : if(abs(axis4.position.y - axis1.position.y) >150, 0, 100)
On text5, just follow text2, and change 'x' to 'y'
On text 4 : if(abs(axis4.position.y - axis1.position.y)==0,0,100)
Move tex4,5,6 below text1,2,3. Text1,2,3 is for X, Text4,5,6 is for Y.

Make you animation 25 frame long. And that's it. You can start play by move the 'X' on screen.
After you success to locate the treasure, you can start a new game by just scroll to another time in timeline.

Friday, November 14, 2008

Swing

Autodesk Smoke tips & Tricks - Swing

Swing, swing baby, swing, swing to the left, swing to the right, swing, swing ....
... Ok, enough, back to business !!

Here's what we're going to do, as you pull the 'X fade' up, 'A' will swing faster and higher (I should have have use 'B' instead) .

Add 'A' and 'X' to the screen.


Add 2 new axis, axisE and axisC, connect axisE to A, and connect axisC to X.



In axisE, pull the centreY to the top of character 'A', this is the center of the swing.

In axisE rotation Z, enter expression :

sin(frame/10)*(axisC.position.y/5)

Now, you can control the swing of 'A' with axisC positionY, the higher the value, the faster and higher the swing.

Ok, are you ready to swing now....

... swing baby, swing, swing to the left, swing to the right, swing ...

Friday, November 7, 2008

Beat Bar Animation

Autodesk Smoke Tips & Tricks - Beat Bar Animation

Since we are talking about beat bar previously, i would continue with another expression technique with beat bar.

Ready a beat bar still frame like below, here i got 10 levels beat per-bar.
Make the clip 11 frames long. And using the top crop, 1st frame crop evrything out, 2nd frame reveal only the 1st lower beat, 3rd frame reveal 2 lower beats, 4th reveal 4 beats...., go on until all beat reveal at frame 11.
Set the crop animation to 'Constant', and set the right button to 'Rev + Cycle'. Extend the animation to a longer duration, here i set 250 frames.
Play the beat bar and see what's happening, it should be run continuously now. Using the still frame beat bar, load it many times as media, the more the better. Arrange each bar side by side.
At media2, enter expression : eval(media.media1.crop.top, frame-2)
At media3, enter expression : eval(media.media1.crop.top, frame-4)
At media4, enter expression : eval(media.media1.crop.top, frame-6)
continue this pattern until the last media.
Note that when you entering expression, you don't have to type everything everytime, just use the up or down arrow key to scroll through the previous entry, and change just the number that need to be changed.

Remember to ON all the crop for all medias.
Now play the bars, it will create kind of wave pattern where the 1st bar transfer the value to the 2nd bar, then 2nd bar will transfer the value to 3rd bar. By using this techniques with crop top and crop bottom, you can create pixel drawing on screen, like for example a smiling face.

By the way, you can do this manually, just animate the first bar like above mentioned, copy it to other bars, then offset each bar animation by using TranslationX or with TRACK view. However, by using expression, i would only need to do it once, if i change my animation, i only need to change the 1st bar.