2013년 3월 31일 일요일

Interactive Particle System UDK -tutorial-


Interactive Particle System in UDK


This tutorial is going to guide you to the first stage of making particles in UDK interact by using force. Please keep in mind that this tutorial is about getting you started on making a particle system interact with forces. I have no intention to making it look pretty. Making it look presentable or making it fit your project is your duty.

First we will create a quick and very simple dot for the particle system that we will be creating in the UDK game engine. 
***note that any particle system can be used. You may skip this part where I will be going to show how to make a quick particle system if you desire. Skip down to where you see a cut line that tells you to start at if you have a particle system prepared***



First, using Adobe Photoshop (in my case CS6), create a document with size of 256x256 pixels at 72 dpi. I've seen some people use 150 or 300 dpi. But I don't see the reason to go up that high since 72 dpi is good enough.


Then create an alpha channel. I personally like to use Gradient Tool with radial gradient. I chose the color going from white to transparent. To create a sphere, I start from the centre of the canvas and go out to where I feel is appropriate. 
I won't be drawing anything in the RGB channels for this tutorial.


If you followed my technique, you should have gotten similar result. Some people like to just get a soft edge round brush and click on the canvas. That maybe faster, but I like to create my alpha channel this way. 

Save your file as Targa or TGA. (they are the samething)

Choose 32 bits/pixel. This must be chosen, otherwise, no alpha map will be saved to the TGA file. 


Inside UDK, the first step is to create a package to where everything will be saved. Then create a Material (in my case, I named it dotMAT). And then import the Dot texture you've made in photoshop.


After you've successfully created a material, follow my steps as shown on the picture above. 
It is very important that you change the blend mode to ADDITIVE
I also chose Two sided, if you were wondering. This will allow the player to see the texture even if the player is on the other side of the material.
The VertexColor is used to change the color of the dot in the cascade. However I won't be changing colors in this tutorial so it wasn't necessary for me to use it.
============================================
Now will be a good time to save your package if you haven't done so.
============================================


Now we'll create a new particle system by right clicking on the content browser.


In the cascade (UDK term for particle system editor), plug in the dot material as shown in the picture above. 
This is where you can get creative. 
Cascade is powerful tool that allows the user to create whatever particle system they want to create. You may find helpful tools online to creating good looking particle systems. 

The only thing I changed in the cascade is the life time. Min= 5 seconds Max= 10 seconds.

---------------------------------------------------------------------------------
[cut line]
Start here if you have a particle system prepared.

This is the crucial part of making particles interact with forces.

In cascade, right click on the particle and under "Type Data", choose PhysX Sprite Data.

 

Now, in the content browser, you need to create a "New PhysXParticleSystem" This will control the particle behavior as it interacts with forces that are applied on to them. 


In order to apply the physx particle system to the particle system, click PhysX Sprite Data inside Cascade and plug in the physX particle system. 


For tutorial purposes, I've disabled the gravity inside the PhysX particle system properties. You may leave it On or Off as you feel is necessary for your project(s).
There are many settings that the artist can change to make the particle better fit the environment in which it will be used in.



Now that I've placed the particle inside the UDK default map, you can see that it is behaving as it would normally. 


This is where the fun begins. Inside the content browser, under Actor Classes, there is "Physics" tab. In this tutorial, I will be using NxForceFieldRadial. I believe the particle should interact with all the forces that are inside the content browser. (I haven't tried it though).


A very important thing to do is designate the shape of the force field. In my case, I used radial shape. And you would need to change the Force Strength according to whatever strength you feel is appropriate. In my case, I used 25. 

A positive value of the force will make the particles go away from the force
A negative value of the force will make the particles go toward the force

Now if you jump into the game, the particle should be moving due to the force. 
Now you have successfully made particle interacting with forces in UDK. 

Remember to SAVE!!
---------------------------------------------------------------------------------
Further notes. 
The forces may be controlled using kismet. A very simple setup of toggle-able force in kismet would be: 
 When a player presses "E" near the trigger, the force will be turned off. And pressing "E" again will turn it on again. If the artist desire to attach the trigger to the player so the player can toggle the force wherever they want. The picture below is the kismet script for doing that.
As you have learned, through kismet, the artist can give the players power to control the force. A video example is shown below.


This video has been created using the method I've shown in the tutorial.

And the kismet looks something like this:

The toggle turns the force on and off. And the matinee controls when and where the force is turned on and off. 

Thank you for reading my tutorial on how to make particles in UDK interact with forces.

-minimin0425-

2013년 3월 12일 화요일

Angler Fish


3~4 hour painting 
CS6 photoshop

A quick painting of an angler fish.
It was a good time killing project that I haven't done in quite some time.
03122013