Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - GarageGothic

#2461
Modules, Plugins & Tools / Re: MODULE: Fade
Thu 18/05/2006 13:18:58
I suggested to CJ to add the option to remove the alpha channels when creating a DynamicSprite from an existing 32-bit sprite. Not sure if it got tracker'ered, but if it is implemented it would be an option for you.

Edit: Just did a search and the suggestion is in the tracker at http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=527

Also, for inspiration to your FadeScreen function, check out the entire script of my FadeNonBlocking module below. It needs a few tweaks (such as what happens if you fade out before the screen is faded in entirely), but works nicely as is. It uses a full-screen black GUI and changes its transparency. Of course the color of the GUI could be changed to fade to white, red or whatever instead of black. As the name says, it's not blocking unlike FadeIn/FadeOut, and it allows very slow fades as well.

Code: ags
// Main script for module 'FadeNonBlocking'

int fadeintimer;
int fadeouttimer;
float fadetransparency;
float fademodifier;

function FadeInNonBlocking(int time) {
  fadetransparency = 0.0;
  fadeintimer = time;
  fademodifier = IntToFloat(100)/IntToFloat(time);
	}

function FadeOutNonBlocking(int time) {
  fadetransparency = 100.0;
  fadeouttimer = time;
	fademodifier = IntToFloat(100)/IntToFloat(time);
	}


function repeatedly_execute_always() {
 if (fadeintimer > 0) {
    fadetransparency = fadetransparency + fademodifier;
		if (fadetransparency <= 100.0) gFadetoblack.Transparency = FloatToInt(fadetransparency);
		else gFadetoblack.Transparency = 100;
    fadeintimer--;
    }
  else if (fadeouttimer > 0) {
    fadetransparency = fadetransparency - fademodifier;
		if (fadetransparency >= 0.0) gFadetoblack.Transparency = FloatToInt(fadetransparency);
		else gFadetoblack.Transparency = 0;
    fadeouttimer--;
    }
}
#2462
Modules, Plugins & Tools / Re: MODULE: Fade
Thu 18/05/2006 12:39:40
The Transparency function doesn't work for sprites that have alpha channels, sorry
#2463
ShakeScreen is a blocking function, which means that the next function won't run until it ends. Try using ShakeScreenBackground instead.
#2464
I think you're right that it was a matter of a decimal inaccuracy turning 0.000000 into -0.000001 or similar. I fixed it by adding a conditional between the float division and the square root calculation. It hasn't shown up again so far. Thanks for the help.
#2465
Maybe I'm overlooking something obvious, but how can either of the two calculations below possibly end up with a "Error: Sqrt: cannot perform square root of negative number" error message? Even with rounding up/down I see no way that the division could end up negative?

Code: ags
if (wyt != cy) ratiocbct = Maths.Sqrt(IntToFloat(((wyt-wyb)*(wyt-wyb)) + ((wxt-wxb)*(wxt-wxb)))/IntToFloat(((wyt-cy)*(wyt-cy)) + ((wxt-cx)*(wxt-cx))));


Code: ags
if (wy != wyb) ratiosbst = Maths.Sqrt(IntToFloat((wyt - wyb)*(wyt-wyb) + (wxt - wxb)*(wxt-wxb))/IntToFloat((wy-wyb)*(wy-wyb) + (wx-wxb)*(wx-wxb)));


Edit: Added the second line after also getting an error with that.
#2466
This is certainly possible. I coded a full-screen heat haze effect which was intolerable slow, but for smaller areas it should work. Since the module would be using RawDraw routines, there would be limits to the ripple (such as rippling per 2 pixels in hi-res modes), and it would require a bit of work from the end-user (technically it would be possible to detect the area using hotspots, but I think it would be more efficient if the user created his own masking for the area as a sprite).

All this said, I'm wondering though if you wouldn't be better off just animating the areas as you would normally, using objects or background animation. Just a few days ago, I considered doing a water module for rippling reflections. But in the end I came to the conclusion that it wouldn't look half as good as a real animation, and would require almost as much work to set up (and to be honest, how often would you need it in a game?). I think it would be an interesting challenge if you were making, say, a Matrix game and needed the rippling bullet effect to be drawn anywhere at the screen at any time. But seeing your examples of moving leaves and clouds, I really do think animation would suit your purposes better.
#2467
Instead of a specific ConvertToGrayscale function, a DynamicSprite.Tint(int red, int green, int blue, int saturation, int luminance) function might be more useful. It would work exactly like the Character.Tint and Object.Tint functions, except the change would be permanent once performed. Calling DynamicSprite.Tint(100, 100, 100, 100, 100) would turn it grayscale.
#2468
No, once you RawDraw a sprite, it's part of the background and doesn't affect performance at all. But be aware that the footprints will disappear if you leave a room and return to it later (the only workaround I see for this is to export the background to an external file on leaving the room, or storing it as a DynamicSprite, but that would be a waste of memory).
#2469
I believe it's done by RawDrawing footprint sprites at the player.x, player.y coordinates. The Winter Rose also used used this effect for footprints in snow.
#2470
You're right, this is something I wasn't aware of since I've always been using custom GUIs for my dialog options. I just checked it in my own game, and it seems that the default dialog options display does antialias while if you use your own transparent GUI it doesnt.

I assume this is something CJ could implement because nothing can animate while the dialog options are displayed.
#2471
This thread  made me think of how you could use DynamicSprite.CreateFromScreenShot as a workaround to create antialiased text seemingly without a gui background (for use with LucasArts-style dialog, mouseover description etc.).

However, grabbing the whole screen and cropping it to size every frame would make for quit a slowdown, so I was wondering if it would be a huge change to expand the DynamicSprite.CreateFromScreenShot(optional int width, optional int height) function to DynamicSprite.CreateFromScreenShot(optional int width, optional int height, optional int x, optional int y, optional int screenwidth, optional int screenheight) to match the functionality of the CreateFromBackground function? That way we could grab a small bit of the screen as a DynamicSprite and use for a gui background to print antialiased text on.

Thanks for reading, CJ.
#2472
Antialiasing doesn't work on GUIs or overlays without backgrounds (or backgrounds with transparent areas). For that reason LucasArts speech isn't antialiased either since it uses overlays.

Edit: It would actually be possible to do a workaround using the DynamicSprits function by creating a text background from a screenshot.
#2473
SSH, perhaps I didn't explain myself properly. I'm aware you can use (255, 0, 255) as a masking color. That's not the issue. What I meant was acquiring that transparency of an existing sprite, say a character, and applying the transparency to a DynamicSprite of the same dimensions. (Or simply the ability to RawDraw the pink pixels, visibly, from a sprite, but not the rest of the sprite - the reverse of how RawDrawing usually works).
#2474
Yes, that would be very helpful indeed. I would also like a way to copy the alpha channel of one sprite onto another sprite of the same dimension.

Edit: not necessarily alpha channel, since that indicates 32 bit sprites. I rather meant transparency aka pink pixels. For non-antialiased sprites it would be possible to script a workaround if the above suggestion was implemented.
#2475
A quick search brought up wikipedias: "List of cliché lists":
http://en.wikipedia.org/wiki/List_of_clich%C3%A9s

Dare I read this?
#2476
Great work SSH! And good idea to add the WithAnything commands. I wouldn't have thought of that myself.
#2477
I could certainly use a color/brightness manipulation function for DynamicSprites, and I've even thought about suggesting it myself before.
#2478
But why, my next post would be asking somebody to write the review for me ;D

Of course research is part of my job, but I also consider it research to seek out advice on a forum for gamers with an interest in amateur game development. The main problem with these kind of games is that they tend to get exposure mostly by word of mouth rather than in print and online media, which is why we started a section exclusively for these games in our magazine.

Among the games we've previously covered are Mexican Motor Mafia, Samorost 2, Wik and the Fable of Lost Souls, Darwinia and Gish. Small games of high quality that can be purchased and downloaded for less than half the price of a commercial game.

Thank you again for your suggestions and links. I will take another look at the IGF nominees, but I think we wrote about most of the 2006 batch already.
#2479
Thanks a bunch for the suggestions, BOYD1981. I'm aware that the Quake engine is freely available for developers, but the Castlevania remake does seem to belong more among mods (which are covered elsewhere in the magazine) than among the independent games. Is there any of the MegaGames titles in particular you would recommend? I tried a few, but they were rather simplistic.

I should probably note that the emphasis isn't on "free" but rather on "independent", so the most important thing is that it should be a game that really does deserve attention despite not being out there on the store shelves.
#2480
I have to find a game to review in this months indepedent games section of our magazine. I'm already reviewing the remake of Another World, but I need to find a second game to review as well. Preferably something good/unique and quite recent. Any suggestions?

Edit: I should not that I try to stay away from adventure games and AGS games in particular, because otherwise it would be the only thing I write about.
SMF spam blocked by CleanTalk