How do I get Precipitation to work?

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Post Reply
User avatar
Neveos
X-51
Posts: 875
Joined: Wed Mar 03, 2010 1:29 am

How do I get Precipitation to work?

Post by Neveos »

Rain is a must for Seattle, but I can't figure out how to get it to work. I've loaded precipitation.u, I place the PrecipitationZone in the map. Is that all I need to do or do I need to add a particlegenerator called Precipitator or precipitator node?
What I do in my other free time:
http://www.youtube.com/watch?v=e3FfPUKuGsQ
Rabbitslayer
Mole Person
Posts: 4
Joined: Thu Oct 08, 2009 4:01 pm

Re: How do I get Precipitation to work?

Post by Rabbitslayer »

That should be all you have to do.It always worked for me so far.
User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Re: How do I get Precipitation to work?

Post by Jonas »

Yeah if you just plunk a PrecipitationZone actor somewhere in your main zone where you want it to rain, you should be good on the basic rain. There's more to it though, if you want it to work really well, but it depends how your map looks. First of all you may want to tweak the default properties of the PrecipitationZone actor - for example in TNM we always have bSlanty set to false because the slanting effect is too pronounced, it looks artificial. We also generally have the PrecipDensity set to something like 5, since that's easier on the framerate, but 7 may be fine if your map isn't too demanding to begin with.

There are two extra things to take care of if you want to go the whole way. One of course is the sound. The PrecipitationZone has a PrecipNoise field under PrecipSound where you want to input a good rainy sound effect. The Precipitation package comes with RainCity which is very useful. Default NoiseVolume is 255 but in TNM we use 160 - it depends on your sound mix, basically. The great thing about adding the rain sound this way is that if you have a menu option to disable weather effects like we have in TNM, you can make it simultaneously disable the sound, which is pretty important to maintaining immersion.

So far so good, but then there's PrecipitationShelters, which is where it gets hairy. The problem with the otherwise extremely elegant way in which this system works is that the player basically gets a personal rain cloud in order to preserve processing power. If for example you have any long tunnels that are open on both ends, the cloud won't extend all the way over to the other side of the tunnel, so when the player enters the tunnel, it'll be pretty clear there's no rain on the other side, which just looks totally wrong. Check out some of the Forum City maps to see what sort of zone work is required to solve that, but here's the low down:

Zone off all your major shelters - basically, put the general rain in your map and just take a thorough walk around, keeping a look out for any places where it suddenly becomes obvious that the rain cloud is very local. As mentioned this most often happens in tunnels, but it'll also be a problem if you have any really large skylights, covered archways along buildings, and especially if you have any enterable buildings, since there has to be rain outside the windows when you're inside looking out. Just zone that shit off, then put a PrecipitationShelter somewhere in there. It's right there next to PrecipitationZone.

Next order of business is to place a chain of PrecipitationNodes around the whole thing. Good node placement is more art than science, but as long as you understand that the PrecipitationNodes basically spawn a curtain of rain between and beneath them, it should be easy to get the hang of. If we stick to our simple tunnel example, you want to place four nodes: two just outside each end of the tunnel, one to each side of it, just above the top of the tunnel. The important thing to realise is you may only have one chain of PrecipitationNodes per zone, so the chains can get a little complex. To help, each node has a bNullNode property that you can use to tell it not to spawn any rain between it and the next node in the chain.

Example time!

You have a simple zoned-off tunnel with four nodes, two at each end. The first node in the chain is called PrecipitationNode20. You know this because it says so in Object -> Name. There's nothing you can do to change this name, it's automatically assigned by the editor when you add the node to the map. The node at the other side of that end of the tunnel is called PrecipitationNode21 because you placed that one right after you placed PrecipitationNode20. So what you want to do is type "PrecipitationNode21" into the nextNode field of the first node. That tells the game to create a curtain of rain between PrecipitationNode20 and PrecipitationNode21. At the other end of the tunnel are PrecipitationNode22 and PrecipitationNode23. You need to connect PrecipitationNode21 to either of those, let's go with PrecipitationNode22 because it makes more sense. So you type "PrecipitationNode22" into the nextNode field of PrecipitationNode21, but you don't really want any rain between them because that rain would go straight through a wall and be a little pointless. So you set bNullNode to True for PrecipitationNode21. Finally, you type "PrecipitationNode23" into the nextNode field of PrecipitationNode22, creating another curtain of rain between those two nodes. You don't need to do anything with PrecipitationNode23, that one just needs to sit there and be the end of the chain. To start it all off, you need to hook that PrecipitationShelter you placed earlier up to the chain, which you very simply do by typing "PrecipitationNode20" into the PrecipitationShelter's FirstNode property (under PrecipShelter). All good!

Except there's another problem. Because the right rain density for a pair of PrecipitationNodes depends completely on the distance between them. Unfortunately the only way to fix this is trial and error (though if you have enough of these little bastards to set up, you will eventually get a pretty good feel for it so less error is required before you get it right). Basically, check out how it looks in-game when you walk from outside into the tunnel - if the rain looks like it's suddenly way heavier than it was outside, you need to decrease the density a notch or two. And vice versa. Experiment until you get it right. Tricky business.

At some point during all this trial and error, you will have noticed that the ambient rain sound completely cuts off when you enter the shelter zone. You want to use ShelterSound actors to fix that (Keypoint -> AmbientSound). Just place one of those at each end of the tunnel, give 'em a modest radius, and just set 'em up exactly like you would with a normal sound, using the same sound effect for them as you're using for the PrecipitationZone. Give both of 'em a tag that makes sense (such as "TunnelShelterSound") and then put that tag into the SoundTag field of the PrecipitationShelter. That'll make sure they only turn on when the player enters the shelter zone, and it'll make sure they're all duly disabled along with the general ambient sound if the player disables weather effects (and even if you don't have a menu option for that, maybe you'll let the player toggle the weather on or off by changing an ini value).

Pretty sure that's all. Good luck and have fun!
Jonas Wæver
Chief Poking Manager of TNM

I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
User avatar
Neveos
X-51
Posts: 875
Joined: Wed Mar 03, 2010 1:29 am

Re: How do I get Precipitation to work?

Post by Neveos »

Jonas you are BADASS. I will put like a mural of your face in my mod.

-edit- actually just placing the zone in there is not working. It takes me to the dx menu screen. Is there something else besides precipitation.u that needs to be loaded first?

-edit- oh my bad I actually have to put it in the system folder, probably, and this might be related to why my custom sound files arent loading.

-edit- dang, well now the map loads, but there is no precipitation. Any clue what's going on?
What I do in my other free time:
http://www.youtube.com/watch?v=e3FfPUKuGsQ
User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Re: How do I get Precipitation to work?

Post by Jonas »

Be absolutely sure there are no other zone infos in your precipitation zone. Then rebuild the map just in case. If it still doesn't work, I have no idea.
Jonas Wæver
Chief Poking Manager of TNM

I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
User avatar
Neveos
X-51
Posts: 875
Joined: Wed Mar 03, 2010 1:29 am

Re: How do I get Precipitation to work?

Post by Neveos »

Ok I caved. I don't know what it is, but TNM files appear to want to work in concert and not independently, unless I'm doing something wrong. Might have to do with the altered consys.u or the tnmnative.u, which I want to leave out of the iwr mod just in case I find something strange down the road. precipitation.u, however, just plum does not seem to work for me and i dont know why. It works in some of my older maps, but not the more complex ones. It might have to do with having multiple surfaces acting as a ceiling.

But you can download the Rain Mod, which is very much similar in appearance to precipitation.u, with the exception that the rain isn't a zone, but a particle generated placed throughout the map. Doesn't seem to be too difficult, but the sounds of rain will need to be placed sporadically, which are available uopn loading precipitation.u. Not to completely contradict TNM, but the lack of uniformity achieved this way seems a bit more aesthetically appealing, and the rain isn't so harsh. The rain in the rain mod also does not "splash" when it hits the ground, which I kinda prefer, but some might find lacking. The rain does stop when it meets a surface.
What I do in my other free time:
http://www.youtube.com/watch?v=e3FfPUKuGsQ
User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Re: How do I get Precipitation to work?

Post by Jonas »

Neveos wrote:It works in some of my older maps, but not the more complex ones. It might have to do with having multiple surfaces acting as a ceiling.
Define "ceiling". Pretty sure you need a skybox, since Precipitation just spawns the water right beneath your sky.

The rain mod should be fine as long as you don't mind the performance hit.
Jonas Wæver
Chief Poking Manager of TNM

I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
User avatar
Neveos
X-51
Posts: 875
Joined: Wed Mar 03, 2010 1:29 am

Re: How do I get Precipitation to work?

Post by Neveos »

Like I built my map with multiple subtractions... the celing/sky would appear divided many times if not for all being a fake back drop. I didn't make one huge subtracted brush, iow. So, I really don't know how it decides to spawn the rain for that reason. The map that it does work on, is simply a large single subtracted brush with added stuff inside. Most of my map uses the original additive space.
What I do in my other free time:
http://www.youtube.com/watch?v=e3FfPUKuGsQ
User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Re: How do I get Precipitation to work?

Post by Jonas »

Well as long as you've set it to be a fake backdrop, it should spawn rain just fine. I really can't stress the importance of checking your zoning - the whole rainy area must be a single zone, and it must have no other zone infos of any kind in it.
Jonas Wæver
Chief Poking Manager of TNM

I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
User avatar
Neveos
X-51
Posts: 875
Joined: Wed Mar 03, 2010 1:29 am

Re: How do I get Precipitation to work?

Post by Neveos »

Yeah I feel really stupid. Found a Zoneinfo I was using to alter texture pan speed. Thanks Jonas. +o(
What I do in my other free time:
http://www.youtube.com/watch?v=e3FfPUKuGsQ
User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Re: How do I get Precipitation to work?

Post by Jonas »

Awesome, you can control the texture pan speed with your precipitation zone info just fine :)
Jonas Wæver
Chief Poking Manager of TNM

I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
Post Reply