Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Ilmion on Tue 29/01/2008 20:52:13

Title: Snow effect - Do I really need a plugin ?
Post by: Ilmion on Tue 29/01/2008 20:52:13
I'm still working on the MAGS game of decembre  :-[  on AGS 2.72
I was aiming for something bigger that I have time for, but I'm determine to finish it.

Now, I curently have a VIEW containing 3 large sprite and basicly those sprite have snow flake and transparency. I find my game running smoutly, but has I see there is some plugin made for snow effect, I'm wondering if I'm way of doing it is a good way. So what is the drawback of my method (with sprite) vs using a plugin ?

Secondly, I've notice people mentionning overlay, what are those exactly and how could I use them efficiently.
Title: Re: Snow effect - Do I really need a plugin ?
Post by: Galen on Tue 29/01/2008 20:54:36
You could use raw draw and some code to simulate a particle system but as to my understanding, it would draw behind players.
Title: Re: Snow effect - Do I really need a plugin ?
Post by: Mould Cheeze on Tue 29/01/2008 22:32:41
Quote from: Ilmion on Tue 29/01/2008 20:52:13I'm wondering if I'm way of doing it is a good way. So what is the drawback of my method (with sprite) vs using a plugin ?
I think large objects slow down the game on older computers.
As far as I know the snow plugin uses smaller sprites so its less CPU-intensive.
Title: Re: Snow effect - Do I really need a plugin ?
Post by: DoorKnobHandle on Tue 29/01/2008 22:48:58
Take a look at my tutorial on programming a particle-system. It should contain all information needed. You can find it in my signature or here (http://www.barnettcollege.com/tutorials.htm).
Title: Re: Snow effect - Do I really need a plugin ?
Post by: Ilmion on Tue 29/01/2008 23:25:11
If using big sprite to make snow make the game slower, won't having 100 small sprite slow the game to ?

dkh : I didn't have time to check you tutorial in is whole, but I sure will take the time to look a it. I did some research in the text and I didn't find anything about overlay. I think I'll start another thread of this.
Title: Re: Snow effect - Do I really need a plugin ?
Post by: DoorKnobHandle on Tue 29/01/2008 23:32:06
That's because I use raw-draw to render the particles, and I recommend you to do the same. ;)

But I understand that my tutorial is a lot of text (actually, it appears worse than it is, the design is just very tiny horizontally). Anyways, good luck.
Title: Re: Snow effect - Do I really need a plugin ?
Post by: Dualnames on Wed 30/01/2008 00:22:34
That tutorial owns man... :o
Title: Re: Snow effect - Do I really need a plugin ?
Post by: Radiant on Wed 30/01/2008 10:45:57
The plugin has several options that are difficult to implement, or that run slowly, if written in plain AGS code.

But yes, it's certainly possible. ATOTK uses snow and fog effects, and we made the decision to not use plugins, so that the game can run under Linux as well.
Title: Re: Snow effect - Do I really need a plugin ?
Post by: SSH on Wed 30/01/2008 12:26:52
*cough* SimpleSnow Module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=24075.0) *cough*
Title: Re: Snow effect - Do I really need a plugin ?
Post by: Ilmion on Wed 30/01/2008 12:45:01
I've seen your module SSH and has I explore everything I find, I may choose to use yours  ;), but why should I use a module or a plugin ? I want to know the why, not only the solution.

dkh : You tutorial is very well done, thank you for sharing.
Title: Re: Snow effect - Do I really need a plugin ?
Post by: SSH on Wed 30/01/2008 16:40:52
Well, this is what the module does:

Save Background (could now be done with rawdraw to sprite since v3.0)
Clear BG with magic transparent colour
Draws snowflakes onto BG, randomly
Grab sprite into Dynamic Sprite
Repeat a few times
Restore BG
Then generate an overlay with a random dynamic sprite
move overlay down the screen (and sideways, according to wind speed + random factor)
after a while, do another overlay

Typically had 5 overlays going at once
Title: Re: Snow effect - Do I really need a plugin ?
Post by: FSi++ on Wed 30/01/2008 19:05:25
Quote from: Ilmion on Wed 30/01/2008 12:45:01
but why should I use a module or a plugin
Think of all us Linux users!
If you use plugin we'll have to settle with "GDI-hack" (I wonder whether someone must add that to AGSWiki or not); if you use module, the game will work with Linux port of the interpreter (that's maybe even more painful than GDI-hack).

p.s. GDI-hack: to make AGS game work in Wine, you have to move it to the side of the screen so that a line or two of pixels is obscured. Then AGS will have to switch from DirectX 5 rendering (default, probably Wine's support for that isn't perfect) to GDI one - and it works. Well, sometimes.
Title: Re: Snow effect - Do I really need a plugin ?
Post by: Ilmion on Thu 31/01/2008 02:05:53
Sorry for the Linux user, but I really find Scorpiorus plugin (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=25665) beautiful and interesting.

So my question is about it precisely, but I have notice the same about all the other solution you've propose me : The slow have to start while the player is watching. I want the player to get out from a house and that there is already snow falling. I could I achieve that ?

I know that with a tweak to dkh code I could to something about that, but what really bother about using RawDraw is that the snow fall behind object and character.
Title: Re: Snow effect - Do I really need a plugin ?
Post by: SSH on Thu 31/01/2008 14:33:27
Oh, you can see an example of rain done with an adapted version of the SimpleSnow module in the Blackwell Convergence demo...