Help with 2D Graphical Effects in Java

Started by
4 comments, last by Alexr 23 years, 9 months ago
Hi, I am finishing on one already functional game (improving graphics) and looking into starting another one. I am working with a friend of mine but neither of us has any artistic abilities. The game we have already written (multiplayer remake of scorched earth) could use some graphical improvements. I am wondering if one has to have/make images in order to achieve good visual effects. After an extensive research online I have been able to find an algorythm of real time fire but that''s about it. I was quite exited when I found gamedev.net, but the graphical tutorial section seems lacking and half the links are quite dead (including the fire tutorial which I wanted to see, since my fire could really use some optimization). Therefore I ask if it is possible to code special effects such as explosions/lightnings/lasers without ready made images, by some sort of algorythm similar to fire algorythm. And if it is, where would one find examples and/or tutorials on the subjects. Thank you very much, Alex
Advertisement
There is an algorithm, but its very very easy to do in photoshop\PSP too..


Plot random monochomatic dots in the radius of the fireball, gaussian blur (or anti-alias alot, both seem to work) those dots by a small ammout, and change the greyscale values to red values..

In photoshop this can be done by selecting an area with the circle mask tool, filter->Noise->Add Noise, select a good ammout and make sure the monochromatic box is selected, after that Filter->Blur->Gaussian Blur, then Image->Adjust->Variations, and up the red values..

This can also be done in a more versitle way by setting the airbrush value to dissolve and the color to white, and spraying the area you want to be fire, then gaussian blur that and colorize red.

It can look pretty good if you do it right.. Then just do a 50% blend on the image in game, should look good. Or in 32bit mode use an alpha channel..


Edited by - caffeine on August 1, 2000 1:31:47 AM
I''d suggest looking into particle systems and alpha blending... once you''ve got them figured out the rest is cake. You can do fire, explosions, pretty much any special effect.

War doesn't determine who is right, war determines who is left.
Hey Alexr,

Have you heard about Perlin Noise? It´s a extansion of the sub plasma algoritmh (I think) to create all sorts of textures. Cloud, marble, water, snow, grass... The algoritmh is quit fast so the texture can be computed on the fly as the object is rendered.

But like Wrathnut said, particle systems is probably what you are looking for.

Gandalf the Black


Edited by - Gandalf on August 2, 2000 5:50:47 AM
Gandalf the Black
Thank you for you help everybody,
Overall the answers seems to be use particle system (I''ve posted somewhere else as well and got that answer).

The question is: how well does the particle system work for a purely 2D engine and does anyone know of a good tutorial on particle systems? The tutorials I''ve found so far seem to be for 3D drawing programs such as 3d Studio Max... The game is for java1.1 (to make it as compatible as possible) and using java3D is not an option at the moment...

Alex
Particle systems work the same in 2d as they do in 3d. There is a tutorial here on GameDev that walks you through the basic theory of a particle system. Depending on your game and what type of effects you would like to achieve, your particle system will be different than most others, but that is a good thing. I''ll find that article and post a link to it here when I do. BTW I''m glad someone else is using Java 1.1 for their game development besides myself. Also you should try posting the exact same question in the Java Development discussion group here on GameDev. Anyway if you have any other questions I''ll try and help you as much as possible.

War doesn't determine who is right, war determines who is left.

This topic is closed to new replies.

Advertisement