Recommended Posts

I'm new to game design. I understand that programs like 3ds Max and Maya are used to create 3d models and character animations for games. I've also used level editors to create terrains, place light and models, add texture, and add AI paths. So here is my question, in some rpgs when characters/enemies/npcs are selected a colored light/ring will appear on the ground or under the character when a spell is cast and nice visual/light animations occur when a spell is cast and even when a sword is swung you will see a light "trail". So, how are these light effects made/programmed?

Share this post

Link to post

Share on other sites

Thanks for the google term to search. I've spent some time searching the internet to learn more about particle systems. Most examples involve making fires or smoke. Do I need to learn a programming language indepth to use this type of system or is there a way to use it in a level editor. I've seen it used in level editors to make a fire but not to cast a spell. I've researched alot of game engines (most have a particle system listed as a feature) but all of them seem to be lacking in the area of tutorials. I don't mind learning the coding behind it; it would just help if there was a serious of tutorials from easy to advanced that I could work on. The only code I've seen for particles is rather complex.

Share this post

Link to post

Share on other sites

I have a feeling its not the engine thats confusing you but most likely your understanding of what the particals and partical systems are.

First off you should understand what a partical itself is. A partical (in the context your refering to) is a small object that represents part of a larger system, each of which are acted upon by many programmed in forces and behaviors. Take for instance a sparkler. If you look at the sparkler as a whole, its a glowing "sparkling" substance, this would be a "partical system" and is the effect you wish to reproduce. The sparks themselves would be the particals. Particals are usualy represented by a small triangle or quad as its easily rendered by the graphics processor, though partical systems predate 3d processors, and the same effect can be applied to a 2 dimensional simulation. Particals can vary in shape, texture (you could have a texture applied to each partical), motion, color, etc.

There are 2 things you program when developing a partical system, the particals behavior independent of the system, and then the system. At the most basic level a partical system creates/spawns particals, and holds (and sometimes manipulates) information related to all the particals. So a simple partical system would do something like instiate a partical at a random location within a threashold every 50 miliseconds or so, setting colors, textures, and intializing values, usualy with some form of psedo-randomness. After that , the partical does most of the heavy lifting.

The partical then is coded similar to how you would code a robot. You have several inputs, such as the current volicity , location, and other physics forces. From that you need to calculate the next frames volocity, location, color changes, etc.

Back to the sparkler analogy. First you have, at the end of the stick, a point which is currently burning. That portion is "emitting" particals, so it creates houndereds of particals, starting them off at a random color in the range of blue to red. It also starts out the partical in a particular direction at a particular speed. The partical now takes over. First off the partical goes from its base color to white, based on how long it has been in existance, and slows down its speed do to the laws of friction. It also is acted upon by gravity, and perhaps static objects around it. Eventualy the partical fades, and expires, and is removed from the system (or reused for those of you nit picking sobs)

As far as needing a programming language to work them, that really depends. Most "game creators" will have at best a few pre packaged partical systems, but creating a unique partical system requires severly optimized work which is on key with things such as shaders. This is one area where programming in a scripting language would not necessaraly be a good idea.

Since I dont really know what programming language or creator you are using to make your game though, I cannot really give you more advice, sorry.