![]() |
|
This thread is locked; no one can reply to it.
![]() ![]() |
1
2
|
Draw a motion effect around a slashing weapon |
Epsi
Member #5,731
April 2005
![]() |
I would to add a visual motion effect for when my characters slash a weapon in my game (like a sword). Here's an example : http://www.consoles-emulators.com/wp-content/uploads/2006/12/god-of-war-20050318074311125.jpg of course my game is in 2D How would I go about generating that ? - Multiple images of the full animation ___________________________________ piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from." |
Archon
Member #4,195
January 2004
![]() |
Probably through the use of bezier curves and some sort of list to link them together. |
Mark Oates
Member #1,146
March 2001
![]() |
There are several ways to come up with what you want. What I would do is go with the "Render rotated circle slices" technique Draw a circle with a gradient along the circumference black-to-white. Set that as the alpha channel. To draw it just do a BlitRotated (I believe you're using OpenLayer) around the center coordinate and increment the roatation so it aligns with the swipe of the weapon. -- |
Kris Asick
Member #1,424
July 2001
|
Think about what the slash effect represents. It represents the movement of the blade, and the movement must be VERY fast to leave such a trail. (At least, if you want it to look good.) So your animation should have no frames between sword preparing to slash and sword actually slashed. In the frame where the sword has slashed you show the wave of energy which encompasses the entire area the blade of the sword has moved through. If you make it take two frames to generate the wave instead of one, it should also optimally take two frames for the wave to disappear. Three or more frames, unless you're animating these frames REALLY fast, would be a bit much and might look to slow. Now, you say the motion is a perfect circle. If by that you mean a "full" circle, then aesthetically the effect you're looking for depends on how quickly you want the attack to occur. If the attack is instant (all sides at the same time) then again, you simply cover the area the blade will travel through with a wave effect. If the attack takes say, 0.5 seconds to execute, and uses 10 frames of animation, well, then you need a trail, not an afterimage, and the example you provided doesn't suit your purposes. To render the effect, just use your favourite paint program's smudge-style functions to push the blade into a wave like pattern, or draw one in with the energy colour of your choice. I wouldn't render it on the fly mid-game, that would probably look ugly. --- Kris Asick (Gemini) --- Kris Asick (Gemini) |
Jonatan Hedborg
Member #4,886
July 2004
![]() |
Hmm. I would probably store the two points (top and bottom of the "effect"-part of the sword) in a list (well, a deque probably), interpolate with bezier (to get a nice number of points) and render them as a quad. If the effect should be used for the full weapon, you could just use a triangle fan with the characters hand (or whatever) as the center point (though that would probably look funky if the character moved).
|
julian_boolean
Member #8,201
January 2007
|
If it was me I would just make a sheet that contains the frames of a slash animation, make it translucent, and then paper doll it on top of a character wielding a weapon. Of course doing it that way obviously means youll have to make and use different slash animations for different weapons. |
X-G
Member #856
December 2000
![]() |
sigh It's just a regular ribbon trail, from the looks of it. It's hardly a sophisticated technique. -- |
Mark Oates
Member #1,146
March 2001
![]() |
paper doll? -- |
julian_boolean
Member #8,201
January 2007
|
It just means to overlay, but I guess in this case it doesn't really fit because it mainly has to do with overlaying graphics over a sprite to make it look like he/she is wearing different items, like a paper doll. Still |
Jonatan Hedborg
Member #4,886
July 2004
![]() |
Quote: sigh It's just a regular ribbon trail, from the looks of it. It's hardly a sophisticated technique. Please share your divine wisdom with us lowly peons
|
julian_boolean
Member #8,201
January 2007
|
Actually, has anyone ever played Brain Lord? The animation for the weapon alone doesn't include any slash effect and is instead more "build in" to the sheet itself, which makes it look a lot more realistic in my opinion. http://www.allegro.cc/files/attachment/592451 |
X-G
Member #856
December 2000
![]() |
Quote: Please share your divine wisdom with us lowly peons Guh, it's simple. When slashing, every X seconds, check where the edge of the blade begins and ends (two points). Add these points to the end of the ribbon trail. Fade existing points over time and delete them when completely faded. Then it's just a matter of drawing regular quads, varying colors over the course of the trail. -- |
Elverion
Member #6,239
September 2005
![]() |
I probably would have done it very similarly to X-G, but you could also go with a more particle-ish system. I think it works better for 2D games (but not very well for 3D). Every x frames, push a new particle onto the related emitter that has the same sprite as your weapon, and maybe colorize it blue or white with additive blending to give the blade a nice ghostly appearance. Each "particle" should fade pretty quickly, otherwise it would look very strange. -- |
juvinious
Member #5,145
October 2004
![]() |
if you take a look at this video from castlevania POR: __________________________________________ |
Epsi
Member #5,731
April 2005
![]() |
Thanks for the comments. Quote: So your animation should have no frames between sword preparing to slash and sword actually slashed. In the frame where the sword has slashed you show the wave of energy which encompasses the entire area the blade of the sword has moved through. I'm aware of all that, it's just that I wonder what technique to use to actually draw that slice of circle... About the old game and Castlevania, I dont like those effects :/ Quote: Guh, it's simple. When slashing, every X seconds, check where the edge of the blade begins and ends (two points). Add these points to the end of the ribbon trail. Fade existing points over time and delete them when completely faded. Then it's just a matter of drawing regular quads, varying colors over the course of the trail. I know how to check for the blade movement over time... but the ribbon effect you're talking about, I've never heard of it. Care to explain what it's about ? ___________________________________ piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from." |
X-G
Member #856
December 2000
![]() |
http://www.allegro.cc/files/attachment/592452 -- |
Kibiz0r
Member #6,203
September 2005
![]() |
Forgive my ignorance of texture mapping, but how does one stretch a texture across it? --- |
23yrold3yrold
Member #1,134
March 2001
![]() |
I agree this sort of thing would be easy; what stumps me is the 2D trailing particle effects .... {"name":"12.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/7\/578892ec738f0771f1d90ecbe50a9b38.jpg","w":640,"h":480,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/7\/578892ec738f0771f1d90ecbe50a9b38"} -- |
Kris Asick
Member #1,424
July 2001
|
Quote: I agree this sort of thing would be easy; what stumps me is the 2D trailing particle effects .... To do it that well you almost certainly want hardware acceleration. Each sprite leaving a trail keeps a list of coordinates and angles the sprite has moved through, then quads are drawn between each pair of points so that their width is perpendicular at each side to the angle the sprite was at when it passed through them. ...which is a lot easier to say than do, but that's how you do it. Kinda like the snakes in Nibbles style games. Or another, less accurate, but easier method that doesn't require acceleration is to drop sprites behind the sprite leaving the trail at timed intervals, which then forms the trail. --- Kris Asick (Gemini) --- Kris Asick (Gemini) |
X-G
Member #856
December 2000
![]() |
23, what's so unusual about those trails? They just look like the same stuff I've already mentioned. -- |
Richard Phipps
Member #1,632
November 2001
![]() |
An emitter particle and normal particles which have a certain lifespan then fade out dramatically at the end? |
X-G
Member #856
December 2000
![]() |
That would be a waste, and won't give you a smooth trail unless you use thousands of particles. -- |
Richard Phipps
Member #1,632
November 2001
![]() |
Epsi
Member #5,731
April 2005
![]() |
Thanks X-G, that's a nice picture. Im still wondering how to do the actual draw though ___________________________________ piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from." |
Jonatan Hedborg
Member #4,886
July 2004
![]() |
Bitmap.BlitDistorted oslt?
|
|
1
2
|