Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: JGZinv on October 24, 2008, 03:25:12 pm

Title: Making rain?
Post by: JGZinv on October 24, 2008, 03:25:12 pm
Just an idea I had...

Could it be possible to simulate rain, either in a nebula or elseware within
the FSO engine?

Mod some function... hack together... etc.

...and no I don't care if real "rain" as we know it is possible in space.
I can make up reasons it can be there.

Discuss?
Title: Re: Making rain?
Post by: Rodo on October 24, 2008, 03:29:39 pm
I would prove to be a valuable addition to those mods that take place on planetary surface, that's for sure.

Title: Re: Making rain?
Post by: Solatar on October 24, 2008, 04:14:26 pm
Make a weapon whose effect looks like rain. Then create a sexp in mission to "create weapon". Have the XYZ coordinates of the originating point be a random area in a large space. Set a very high repeat count and you should have weapons all flying in one direction coming from a random location (you can set them to all point the same direction).

I don't remember the exact syntax offhand, but that's the general technique. I used that technique a few years back to try and simulate planetary defense guns (it didn't really look like them...looked more like rain, lol)

Hope this helps.
Title: Re: Making rain?
Post by: Snail on October 24, 2008, 04:29:04 pm
Make a weapon whose effect looks like rain. Then create a sexp in mission to "create weapon". Have the XYZ coordinates of the originating point be a random area in a large space. Set a very high repeat count and you should have weapons all flying in one direction coming from a random location (you can set them to all point the same direction).
That would almost definitely hit the ceiling for the maximum number of projectiles in-mission. Bad idea.
Title: Re: Making rain?
Post by: Galemp on October 24, 2008, 04:46:37 pm
Nebula poof with an animated rain texture? Plus lightning?
Title: Re: Making rain?
Post by: DaBrain on October 24, 2008, 04:59:31 pm
Not a bad idea. I had the same idea for a snow storm... but the nebula pofs are rotated randomly and the follow the player's rotation.
Title: Re: Making rain?
Post by: Herra Tohtori on October 24, 2008, 05:13:11 pm
The only thing I can think of is particles that translate to same direction (down), but I don't know how much of a stress it would be for CPU/GPU to deal with it.

The particle filesize itself wouldn't need to be big at all; for rain, you would probably go far with a 1*8 pixels long gray line (fading to transparent on one end) that aligns itself based on the combined vector angle of itself falling down and the viewpoint's velocity. Snow, similar but instead it could be a 4*4 blurred white dot falling slower.

Combined with a nebula system-based haze, it could work reasonably well... provided that the game doesn't choke on the number of particles required.
Title: Re: Making rain?
Post by: Solatar on October 24, 2008, 06:46:01 pm
Make a weapon whose effect looks like rain. Then create a sexp in mission to "create weapon". Have the XYZ coordinates of the originating point be a random area in a large space. Set a very high repeat count and you should have weapons all flying in one direction coming from a random location (you can set them to all point the same direction).

That would almost definitely hit the ceiling for the maximum number of projectiles in-mission. Bad idea.

You're probably right under further inspection. It works fairly well, but in order to create the amount of projectiles for RAIN it'd break.
Title: Re: Making rain?
Post by: Snail on October 24, 2008, 06:47:18 pm
It would work for one of those epic one-on-one dogfights but not for large battles.
Title: Re: Making rain?
Post by: JGZinv on October 24, 2008, 06:47:48 pm
From a player perspective, you don't need rain all over the map.
Just in the view of the player. Perhaps that would reduce your load....
Title: Re: Making rain?
Post by: Herra Tohtori on October 24, 2008, 06:49:27 pm
How about tweaking the motion debris system? :nervous:
Title: Re: Making rain?
Post by: Snail on October 24, 2008, 06:58:31 pm
How about tweaking the motion debris system? :nervous:
I think that'd be the best idea.



Though I really can't see any situation for why you'd need rain in space. It'd be better to re-implement the FS1 nebulae than do something like this, unless there's a reason behind it.
Title: Re: Making rain?
Post by: JGZinv on October 24, 2008, 07:03:17 pm
I never said it had to be in space....

There's just as much potential for it to be used in a station, with a mod that's using a planet
surface... or perhaps a chunk of ice in space is vaporized. Maybe it's for a hydroponics dome
and you get to pilot a tiny little drone around inside an deactivate a bomb...

Whatever really... like I said.. I can make reasons it exists.
Title: Re: Making rain?
Post by: Flipside on October 24, 2008, 07:05:13 pm
Animated texture on a Sphere that centres on the player ship but orients itself to the world, though that would still cause problems with 'up' and 'down' through the UV mapping...

Hmmmm...
Title: Re: Making rain?
Post by: JGZinv on October 24, 2008, 07:11:34 pm
What about the specks that fly at you normally that change direction based on which way you
are moving around? You turn left, you get the illusion of turn because the specks fly to the right.

I can't remember the proper term for it... windscreen.. particle sheer...

Variation of that?
Title: Re: Making rain?
Post by: Droid803 on October 24, 2008, 07:17:00 pm
Maybe an animated texture in the skybox?
You could have transparency set and sincet he player is always locked in the center of the skybox, they'll see RAIN!

What about the specks that fly at you normally that change direction based on which way you
are moving around? You turn left, you get the illusion of turn because the specks fly to the right.

I can't remember the proper term for it... windscreen.. particle sheer...

Variation of that?
That's motion debris.
Title: Re: Making rain?
Post by: LeGuille on October 25, 2008, 02:31:23 am
Well, as far as planetary goes, you could make a square skybox with a transparent sphere inside of it.

Or, you could do a sphere inside a sphere.

The transparent inner-background would have an animated texture of rain falling. Then you could FRED a subtitle sexp to display 'plops' of rain on the player screen at random intervals. That's the best I can think of. Alot of work, though. Have big plops, little plops. All random small images that are animated to appear and disappear. Or you could make a giant animated 'plop' effect as to ease on the CPU/GPU.
Title: Re: Making rain?
Post by: Snail on October 25, 2008, 02:37:14 am
The transparent inner-background would have an animated texture of rain falling. Then you could FRED a subtitle sexp to display 'plops' of rain on the player screen at random intervals. That's the best I can think of. Alot of work, though. Have big plops, little plops. All random small images that are animated to appear and disappear. Or you could make a giant animated 'plop' effect as to ease on the CPU/GPU.
That actually sounds pretty feasible.
Title: Re: Making rain?
Post by: Nuke on October 26, 2008, 12:07:52 am
use the new draw model feature in scripting. then model an invisible cube with a raindrop sprite as a glow point.
Title: Re: Making rain?
Post by: Bobboau on October 26, 2008, 01:58:13 am
the best idea I've heard so far is to modify the motion debris.
Title: Re: Making rain?
Post by: shiv on October 26, 2008, 02:52:30 am
What about scripting? And do effect like in NFS, with drops that leave on the screen :D IMO it'd look cool.
Title: Re: Making rain?
Post by: Turnsky on October 26, 2008, 05:15:10 am
the rain effect coupled with other things such as shader trickery would make for very sweet eyecandy.
add into that the odd lighting strike to craft would make for interesting situations.  :drevil:
Title: Re: Making rain?
Post by: Aardwolf on October 26, 2008, 05:26:06 pm
I doubt it would take much codework to make an option to disable the random rotation of nebula poofs, and at the same time add in on-screen splooshes.
Title: Re: Making rain?
Post by: Galemp on October 27, 2008, 08:45:28 am
the best idea I've heard so far is to modify the motion debris.

Ditto. I think what could be done is to force all the motion debris to drift in a particular direction-- as if your fighter was constantly sliding that way.
Title: Re: Making rain?
Post by: Mobius on October 27, 2008, 03:09:06 pm
What a nice idea! :D

I think we should give modifed nebula poofs a try. Modify only one of them as set it as the only poof in FRED, that'd create an interesting effect.

While modifying motion debris may seem the most effective solution I'd like to see what a "particular" nebula can do. We can even use thunders with no textures and change thunder sounds to get a proper noise ingame! :)

I know, there's no rain in space, but think about atmospheric missions for a second... ;)
Title: Re: Making rain?
Post by: JGZinv on October 27, 2008, 03:45:46 pm
Or a slowly vaporising ice field...
Title: Re: Making rain?
Post by: Herra Tohtori on October 27, 2008, 05:18:39 pm
What a nice idea! :D

I think we should give modifed nebula poofs a try. Modify only one of them as set it as the only poof in FRED, that'd create an interesting effect.

While modifying motion debris may seem the most effective solution I'd like to see what a "particular" nebula can do. We can even use thunders with no textures and change thunder sounds to get a proper noise ingame! :)

I know, there's no rain in space, but think about atmospheric missions for a second... ;)



If the nebula poof alignment can be fixed, then it can be used to create a very good effect of "background rain" and to limit the visibility, but the close proximity rain/snow would probably be better with motion debris system.

What we need is two features (although either of them would be great) from the coders:

1. A way to adjust motion debris density and consistency so that it uses particles rather than models, and can be set to drift to a direction with some velocity

2. A way to fix the nebula poofs to a single gameworld vector.


Clouds are going to be a problem, though.
Title: Re: Making rain?
Post by: redsniper on October 27, 2008, 05:51:08 pm
Just make a model with LOOOOOOTS of fluffy glow points. BAM, volumetric cloud.
Title: Re: Making rain?
Post by: JGZinv on October 27, 2008, 06:11:50 pm
Lots of small localized white/gray nebulas with lightning added?
Title: Re: Making rain?
Post by: Mobius on October 27, 2008, 06:17:26 pm
We don't necessarily need lightnings. We want a rain effect, it doesn't mean the rain has to be like the one we see in cloudy days. :)
Title: Re: Making rain?
Post by: Trivial Psychic on October 27, 2008, 10:36:57 pm
How about adding to the lightning by having a random flashes in the background, followed by the thunder sound?  Have the flashes vary in size, and have the size of the flash as well as the thunder delay and volume related so they can appear to be from greater distances.
Title: Re: Making rain?
Post by: Galemp on October 27, 2008, 10:43:12 pm
Uh... we already have lightning. Played a nebula mission recently?
Title: Re: Making rain?
Post by: Trivial Psychic on October 28, 2008, 12:53:44 am
With the current lightning you see bolts near you.  I'm talking about distant lightning, kinda like sheet lightning.
Title: Re: Making rain?
Post by: Bluepilot on November 03, 2008, 01:46:28 am
In order to make rain we should not forgot that cockpit are coming and if the rain directly splash on the screen it'll looks quite weird.
It should be able to splash on the cockpit winshield only no?
Title: Re: Making rain?
Post by: LeGuille on November 04, 2008, 02:21:15 pm
With the current lightning you see bolts near you.  I'm talking about distant lightning, kinda like sheet lightning.

You could make a weapon that just 'flashes' like you're talking about, and spawn in a make-weapon SEXP around the player at a random interval / random distance from player.

Since weapons emit light, the closer, the better. Just some modified weapons work, too. And poofs are excellent: white/grey poofs.

We need an option in the FRED2_O to 'pull down' poofs just like nebulae effects. Modified lightning to make rain is a neat idea as well.