Xonotic Forums
Suggestions on reforming func_rain and func_snow - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10)
+--- Forum: Xonotic - Development (https://forums.xonotic.org/forumdisplay.php?fid=12)
+--- Thread: Suggestions on reforming func_rain and func_snow (/showthread.php?tid=1902)



Suggestions on reforming func_rain and func_snow - MirceaKitsune - 06-13-2011

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.


RE: Suggestions on reforming func_rain and func_snow - theShadow - 06-14-2011

the problem with detecting if the player is touching the brush is that the effects aren't only rendered if the player isin it. for example, of the player is inside looking out at the rain.

however, I agree that the current system could be improved.


RE: Suggestions on reforming func_rain and func_snow - Minkovsky - 06-14-2011

Could be reformed with foliage I think? Or simple view-radius limiting, that'd do just fine.