06-13-2011, 08:43 AM
I made a map a while ago, where I needed to add some falling snow. I used a func_snow brush for that purpose, and took a look at how func_rain and func_snow work like. I found a few things that I disagree with however, so I thought to post my ideas on how I believe these entities could be improved.
One issue is that I don't see why snow and rain need to be separate entities. Why not make a single func_weather instead, and allow the mapper to setup weather properties via entity keys? Mappers could also make their own weather that way, such as falling sand in desert areas. Or better off, we could put the weather effects in effectinfo.txt, and make them selectable with the mdl key (like in func_pointparticles).
The second problem I noticed is a functionality issue on how they work, which IMO is incorrect and unoptimized for weather. The func_rain and func_snow entities spawn particles inside the whole brush. But when used in larger amounts, this easily makes performance unplayable, due to the number of particles rendered. For that reason, weather is almost impossible to use on any medium-sized map (I can confirm this from experience).
The fix for this is using a common technique in many games with weather; Spawning the particles client-side, and inside a limited radius around the camera position. That way, fewer particles are used, and weather can be more intense with much lower performance loss. So if possible, I would suggest making our func_weather detect if a player is touching the brush, and spawn particles around their view origin if so.
I don't know when I can look into this, which is why I wanted to point out these ideas first... if someone else wishes to look into it sooner. Shouldn't be hard to make both changes, if everyone agrees they would be better this way. We should probably create the func_weather entity first, using the new spawning system I mentioned. Then let func_rain and func_snow deprecated, but still functional for existing maps that used them.
One issue is that I don't see why snow and rain need to be separate entities. Why not make a single func_weather instead, and allow the mapper to setup weather properties via entity keys? Mappers could also make their own weather that way, such as falling sand in desert areas. Or better off, we could put the weather effects in effectinfo.txt, and make them selectable with the mdl key (like in func_pointparticles).
The second problem I noticed is a functionality issue on how they work, which IMO is incorrect and unoptimized for weather. The func_rain and func_snow entities spawn particles inside the whole brush. But when used in larger amounts, this easily makes performance unplayable, due to the number of particles rendered. For that reason, weather is almost impossible to use on any medium-sized map (I can confirm this from experience).
The fix for this is using a common technique in many games with weather; Spawning the particles client-side, and inside a limited radius around the camera position. That way, fewer particles are used, and weather can be more intense with much lower performance loss. So if possible, I would suggest making our func_weather detect if a player is touching the brush, and spawn particles around their view origin if so.
I don't know when I can look into this, which is why I wanted to point out these ideas first... if someone else wishes to look into it sooner. Shouldn't be hard to make both changes, if everyone agrees they would be better this way. We should probably create the func_weather entity first, using the new spawning system I mentioned. Then let func_rain and func_snow deprecated, but still functional for existing maps that used them.