Thread: [Super-tux-devel] Stalactite bad guy [patch]
Brought to you by:
wkendrick
From: Ricardo C. <ri...@ae...> - 2004-03-11 03:52:56
|
Hey there, This is a new stalactite. My graphics sux, Gaia already contributed with a great one that fits very well with Ingo's style (Settra: please change the resolution to 48x64 and make another for the after of the collision with the ground). If you change the graphics, don't forget that the width and height is all hard coded. The stalactites start shaking when the player is in a range of 40 pixels and fall when it is in 10 pixels. Running is possible to get by the stalactites without dying. When the stalactites hit the ground, maybe there should be an animation, not just a static image. Should be added in future for all bad guys. Cheers, Ricardo Cruz -- Fess: Well, you must admit there is something innately humorous about a man chasing an invention of his own halfway across the galaxy. Rod: Oh yeah, it's a million yuks, sure. But after all, isn't that the basic difference between robots and humans? Fess: What, the ability to form imaginary constructs? Rod: No, the ability to get hung up on them. -- Christopher Stasheff, "The Warlock in Spite of Himself" |
From: Bill K. <nb...@so...> - 2004-03-11 08:18:30
|
On Thu, Mar 11, 2004 at 03:35:54AM +0000, Ricardo Cruz wrote: > When the stalactites hit the ground, maybe there should be an animation, not > just a static image. Should be added in future for all bad guys. In BoboBot, I also have a stalactite enemy (it doesn't shake, though). When it hits the ground, it shatters into little ice-cube fragments. Imagine if it were made of glass, it would do the same. I haven't looked, but I'd like to suggest that the stalactite (and broken ice) images have some level of transparency (more towards the center, none on the "V"-shaped edges), which would allow the background to show through. If we were being REALLY fancy, we could hand-code a blur routine that would actually give more of a glass effect. But, since the graphics will be relatively small, blurring is relatively expensive, and it will eventually all be moving so fast, I don't think it's worth it... -bill! bi...@ne... "Hey Shatner, ya remember that episode of http://newbreedsoftware.com/bill/ Space Trek where your show got cancelled?" |
From: Ricardo C. <ri...@ae...> - 2004-03-11 10:48:31
|
Em Quinta, 11 de Mar=E7o de 2004 08:00, o Bill Kendrick escreveu: > On Thu, Mar 11, 2004 at 03:35:54AM +0000, Ricardo Cruz wrote: > > When the stalactites hit the ground, maybe there should be an animation, > > not just a static image. Should be added in future for all bad guys. > > In BoboBot, I also have a stalactite enemy (it doesn't shake, though). > When it hits the ground, it shatters into little ice-cube fragments. > > Imagine if it were made of glass, it would do the same. > Yheaa, first time I thought about the stalactite I wanted to implement tha= t=20 way. And does BoboBot make use of an animation or a particle system? > > I haven't looked, but I'd like to suggest that the stalactite (and broken > ice) images have some level of transparency (more towards the center, none > on the "V"-shaped edges), which would allow the background to show throug= h. > > > If we were being REALLY fancy, we could hand-code a blur routine that wou= ld > actually give more of a glass effect. But, since the graphics will be > relatively small, blurring is relatively expensive, and it will eventually > all be moving so fast, I don't think it's worth it... > Not sure what you meant, but SuperTux has OpenGL support... Ricardo Cruz =2D-=20 Some performers on television appear to be horrible people, but when you finally get to know them in person, they turn out to be even worse. -- Avery |
From: Bill K. <nb...@so...> - 2004-03-11 11:23:41
|
On Thu, Mar 11, 2004 at 10:31:16AM +0000, Ricardo Cruz wrote: > Yheaa, first time I thought about the stalactite I wanted to implement that > way. And does BoboBot make use of an animation or a particle system? You could think of it as a 'particle' system, I guess. When the stalactite hits the ground, four ice cube pieces are created. They act like the other objects in the game (player, enemies, bullets), in that they are animated each frame. I can't remember, but their lifespan might even be randomly-generated, meaning they might not all disappear at once. There might one one left bouncing on the ground for a moment after the others have disappeared. It's rather simple coding/logic, but adds to the game nicely, because of this randomness. (Also notice in BoboBot that when you jump out of the water, you drip randomly for a few seconds. ;^) ) I'm honestly quite proud of BoboBot, so far as what the game looks like and feels like. It's a shame that I didn't make it a scrolling game, wrote it in a hard-to-maintain way (Super Tux is a BIT better, so you can imagine how bad BoboBot is! :^) ), and never ported it from Xlib to SDL. I tried rewriting it twice, but Super Tux was my best attempt at doing a scroller game. BoboBot might not look like much, but what's there is fairly fun and cute. ;^) <snip> > > If we were being REALLY fancy, we could hand-code a blur routine that would > > actually give more of a glass effect. But, since the graphics will be > > relatively small, blurring is relatively expensive, and it will eventually > > all be moving so fast, I don't think it's worth it... > > Not sure what you meant, but SuperTux has OpenGL support... As an option, I hope. ;^) I reinstalled my Debian system recently and only have software GL support right now, for example. ;^) It == SLOW! The gist of the idea is that instead of simply being see-through, or tinting the background, the ice could actually affect the clarity of the background behind it. I suppose one way to do it would be to: 1. Do a general blur of the area the stalactite takes (using a mask to determine which pixels we should blur, so that we don't waste time doing the full rectangular area around the object). e.g., using this mask: ##### -###- -###- -###- -##-- --#-- --#-- ...look at the pixels in the background (before drawing any part of the stalactite) and combine them to blur it. E.g., if the background looked like this: #--#- ----- #--#- ----- #--#- ----- #--#- ...we'd now have a bitmap that looks like this: ::-:: ?'-'? ?:-:? ?'-'? ?:-?? ??-?? ??-?? (Where "??" is bits we don't even care about... consider it 100% transparent) If we were to blit that back onto the screen, it would look like a weird blurred splotch on the background. That's a start, but now we can use a transparency mask to determine how MUCH of that blurry background to draw back onto the screen. (e.g., it would be very blurry on the edges, and less blurry in the center, where the stalactite is pretty much a cylinder.) Mix the current background, with this alpha-masked blurred version and NOW, we have a cool "invisible Predator" style effect! Finally, we can draw the stalactite itself. In the center (where the stalactite looks mostly like see-through glass), we would simply tint the slightly-blurred background... say, blue. On the edges, it would be less see-through. Perhaps with a 100%-opaque black outline on the edges, for a cartoon effect. I think I'll make something in Gimp to explain what I'm talking about. At this point, I'm just kinda bored and wasting time talking about this. I doubt we'll go into this 'blur' effect any time soon, if EVER, in Super Tux. :^) It sure is fun to think about, though! ;^) -bill! |
From: Bill K. <nb...@so...> - 2004-03-11 11:37:59
|
On Thu, Mar 11, 2004 at 03:05:26AM -0800, Bill Kendrick wrote: > > I think I'll make something in Gimp to explain what I'm talking about. Hehe, and I did. Enjoy! http://www.newbreedsoftware.com/bill/photos/junk/stalactite/ -bill! bi...@ne... "Hey Shatner, ya remember that episode of http://newbreedsoftware.com/bill/ Space Trek where your show got cancelled?" |
From: Ricardo C. <ri...@ae...> - 2004-03-11 13:00:30
|
Em Quinta, 11 de Mar=E7o de 2004 11:05, o Bill Kendrick escreveu: > On Thu, Mar 11, 2004 at 10:31:16AM +0000, Ricardo Cruz wrote: > > Yheaa, first time I thought about the stalactite I wanted to implement > > that way. And does BoboBot make use of an animation or a particle syste= m? > > You could think of it as a 'particle' system, I guess. > > When the stalactite hits the ground, four ice cube pieces are created. > They act like the other objects in the game (player, enemies, bullets), > in that they are animated each frame. > > I can't remember, but their lifespan might even be randomly-generated, > meaning they might not all disappear at once. There might one one left > bouncing on the ground for a moment after the others have disappeared. > > It's rather simple coding/logic, but adds to the game nicely, because of > this randomness. > Maybe it could make use of broken_brick struct and funcs. > (Also notice in BoboBot that when you jump out of the water, you drip > randomly for a few seconds. ;^) ) > > > I'm honestly quite proud of BoboBot, so far as what the game looks like > and feels like. It's a shame that I didn't make it a scrolling game, > wrote it in a hard-to-maintain way (Super Tux is a BIT better, so you can > imagine how bad BoboBot is! :^) ), and never ported it from Xlib to SDL. > I must congratulate you for it. It is really a cute game with a a pretty b= ig=20 range of different enemies, including bosses. ;) Since it has a few worlds, with much levels, it is an enjoyable game and a= =20 must for every linuxer. :) Ricardo Cruz =2D-=20 People don't usually make the same mistake twice -- they make it three times, four time, five times... |
From: Ricardo C. <ri...@ae...> - 2004-03-14 02:37:37
|
Em Quinta, 11 de Mar=E7o de 2004 11:05, o Bill Kendrick escreveu: > On Thu, Mar 11, 2004 at 10:31:16AM +0000, Ricardo Cruz wrote: > > > > If we were being REALLY fancy, we could hand-code a blur routine that > > > would actually give more of a glass effect. But, since the graphics > > > will be relatively small, blurring is relatively expensive, and it wi= ll > > > eventually all be moving so fast, I don't think it's worth it... > > > > Not sure what you meant, but SuperTux has OpenGL support... > > As an option, I hope. ;^) I reinstalled my Debian system recently and > only have software GL support right now, for example. ;^) It =3D=3D SLOW! > OpenGL can be used by passing the --opengl / -gl argument. The decision was that, in the (far) future, if there are some things that= =20 need to be done and cannot be implemented in SDL (for performance reasons)= =20 and that affect the gameplay, SDL will be dropped, in favor of OpenGL. > The gist of the idea is that instead of simply being see-through, or > tinting the background, the ice could actually affect the clarity of > the background behind it. > > I suppose one way to do it would be to: > > 1. Do a general blur of the area the stalactite takes (using a > mask to determine which pixels we should blur, so that we don't > waste time doing the full rectangular area around the object). > > ...look at the pixels in the background (before drawing any part of the > stalactite) and combine them to blur it. E.g., if the background looked > like this: > > > Mix the current background, with this alpha-masked blurred version and > NOW, we have a cool "invisible Predator" style effect! > SuperTux supports Alpha blending, so couldn't that be made by setting up s= ome=20 pixels, in the stalactite image, to a value from 0-255 ? (a part; stalactite normal image, can be animated!) Ricardo Cruz =2D-=20 Many of the convicted thieves Parker has met began their life of crime after taking college Computer Science courses. -- Roger Rapoport, "Programs for Plunder", Omni, March 1981 |
From: Bill K. <nb...@so...> - 2004-03-14 12:26:10
|
On Sun, Mar 14, 2004 at 02:38:51AM +0000, Ricardo Cruz wrote: > > Mix the current background, with this alpha-masked blurred version and > > NOW, we have a cool "invisible Predator" style effect! > > > > SuperTux supports Alpha blending, so couldn't that be made by setting up some > pixels, in the stalactite image, to a value from 0-255 ? > > (a part; stalactite normal image, can be animated!) That's what I was suggesting. ;^) Yes. Of course, I went a step further and suggested BLURRING, as well as blending, but I think that's overkill... -bill! |
From: Michael G. <mi...@ge...> - 2004-03-14 20:54:21
|
Bill Kendrick wrote: > On Sun, Mar 14, 2004 at 02:38:51AM +0000, Ricardo Cruz wrote: > >>>Mix the current background, with this alpha-masked blurred version and >>>NOW, we have a cool "invisible Predator" style effect! >>> >> >>SuperTux supports Alpha blending, so couldn't that be made by setting up some >>pixels, in the stalactite image, to a value from 0-255 ? >> >>(a part; stalactite normal image, can be animated!) > > > That's what I was suggesting. ;^) Yes. > > Of course, I went a step further and suggested BLURRING, as well as > blending, but I think that's overkill... > > -bill! > If you wanted to do blurring and blending, the way I would do it would be to provide a small matrix at each pixel giving the contribution of the surrounding pixels. This more general approach would subsume blurring and blending, would be as efficient as blurring, and would allow even fancier effects like small refraction distortions, which could be useful for all kinds of effects. Of course, the whole thing is super-overkill anyway, and I think the performance penalty would be too high, but it's fun to think about it anyway :) --Mike |
From: Christopher A. W. <cr...@li...> - 2004-03-14 21:33:39
Attachments:
skidfix.patch
|
Forgot to include the patch in my last email ^_^ It's attached to this version. Christopher Allan Webber | The bottom line |