Snow effect - Do I really need a plugin ?

Started by Ilmion, Tue 29/01/2008 20:52:13

Previous topic - Next topic

Ilmion

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.

Galen

You could use raw draw and some code to simulate a particle system but as to my understanding, it would draw behind players.

Mould Cheeze

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.

DoorKnobHandle

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.

Ilmion

#4
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.

DoorKnobHandle

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.

Dualnames

Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Radiant

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.

SSH

12

Ilmion

#9
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.

SSH

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
12

FSi++

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.

Ilmion

#12
Sorry for the Linux user, but I really find Scorpiorus plugin 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.

SSH

Oh, you can see an example of rain done with an adapted version of the SimpleSnow module in the Blackwell Convergence demo...
12

SMF spam blocked by CleanTalk