Back to the Korax Forum Archives


Forum

Weather!

Mon, 24 Dec 2007 17:03:13

Crimson Wizard

[img:zdt0dhj2]http://downloads.orcishweb.com/koraxdev/crimson/krpg/shots/snowfall.jpg[/img:zdt0dhj2] The snow is made by particles. It slows down game from 70 fps to 15-20 though. Needs some optimization. Ofcourse, less density = less slowdown. And it's beautiful <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Mon, 24 Dec 2007 18:03:16

Firebrand

Before particle effects could be customized, I made a simple projectile for it that made no damage, the same slowdowns were noticeable too, heh!
Mon, 24 Dec 2007 18:47:59

The 4th Class

Wouldn't it be easier and more efficent just to make the snow a screen effect? Like, instead of particles occuping space on the map, the code just generates various white dots on the screen.
Tue, 25 Dec 2007 09:32:39

Crimson Wizard

I played with parameters a bit and made it normal density, so game plays on 23-30 fps which is good IMO. [quote="The 4th Class":3kn277nv]Wouldn't it be easier and more efficent just to make the snow a screen effect? Like, instead of particles occuping space on the map, the code just generates various white dots on the screen. That would be worst of all. General idea of particles is that they give 3d effect. that is - you can see that snow falls not just "anyhow" but before and beyond some objects. By the way, I noticed that this effect quickly fades if you look on that static picture above. <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Perhaps it is effective only in action. Then, more about this. First of all, this feature will require override of default particles limit, otherwise most of the snow will not be visible. Secondly. It would be a craziest idea to spawn it just everywhere at once. First, I used to spawn it around player with 2048 radius, and it slowed game down to 3-4 fps. Currently I decided to choose 768 units radius. Still, I think it is possible that player would be fast enouph to run out of this area so quickly that snow won't appear in time (but that's fixable issue). After some thinking I have planned following methods to use snow (and maybe some other effects in future): 1. ACS command that starts snow over whole map (still it would be created only in player sight). This should detect those sectors with sky texture and spawn snow there. 2. Special thing to spawn snow in exact sector. 3. Particle limiters (basically - floor limiter, which won't allow particles to go beyond some height) At the moment I have 1st and 3rd. 3rd one is a nice thing, I believe, I managed to make so that particles will not go beyond 3d floor, so it looks like they are stopped by "roof". Looks fine, still imperfect however, primarily because Vavoom progs lack square root function <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> which is needed to calculate particle lifetime depending on its velocity and acceleration, so currently I take only velocity in consideration.
Tue, 25 Dec 2007 17:15:50

Firebrand

Sounds cool, did you know you can now increase or decrease the size of particles with "size" attribute? I don't know if it'll have a performance improvement if snow is smaller or not. As for particles limit, I think it's a CVAR in the game, but I'm not sure <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->.
Tue, 25 Dec 2007 18:39:05

Crimson Wizard

[quote="Firebrand":3tlmzz6s]Sounds cool, did you know you can now increase or decrease the size of particles with "size" attribute? I know it is implemented but I haven't updated to that svn version yet, so I cannot check this. Anyway I doubt smaller particles will decrease slowdow, it's different thing. [quote="Firebrand":3tlmzz6s]As for particles limit, I think it's a CVAR in the game, but I'm not sure <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->. It's a command line parameter.
Tue, 25 Dec 2007 21:02:50

RambOrc

I guess rain can be done with pretty much the same code?
Wed, 26 Dec 2007 14:49:36

Firebrand

Your guess is right, with a few small modifications it can be done too <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->, windy maps, etc. There's a lot of possibilities <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->.
Wed, 26 Dec 2007 14:54:05

Crimson Wizard

I'll try this next.
Wed, 26 Dec 2007 19:29:26

Crimson Wizard

Well, it looks lame on screenshot [img:3u4g5v5a]http://downloads.orcishweb.com/koraxdev/crimson/krpg/shots/rainfall.jpg[/img:3u4g5v5a]
Wed, 26 Dec 2007 22:50:22

RambOrc

I think they need to be longer and of a darker grey color.
Thu, 27 Dec 2007 00:09:54

The 4th Class

Could you try another screenshot in a brighter room? <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? -->
Thu, 27 Dec 2007 16:54:01

Crimson Wizard

Ok, I made these be customizable in script: velocity, colour and pattern. Pattern is 'light/mediocre and heavy rain" - this determines chunks length. Also I managed to made them spawn small splashes when they hit surface height - this happens not always, but often.
Thu, 27 Dec 2007 17:03:23

The 4th Class

It'd be very cool if the raindrops accumulate and form a puddle. And if the puddle gets bigger and bigger than there's a flood. <!-- s:twisted: --><img src="{SMILIES_PATH}/icon_twisted.gif" alt=":twisted:" title="Twisted Evil" /><!-- s:twisted: -->
Thu, 27 Dec 2007 17:11:43

Crimson Wizard

[quote="The 4th Class":369mgzp2]It'd be very cool if the raindrops accumulate and form a puddle. And if the puddle gets bigger and bigger than there's a flood. <!-- s:twisted: --><img src="{SMILIES_PATH}/icon_twisted.gif" alt=":twisted:" title="Twisted Evil" /><!-- s:twisted: --> Hmmm.. with new Vavoom particles implementation it should be poissible. Though I am not sure it is a good idea to make these puddles from particles, it will require alot of them kept in memory, and game already slows down significantly during snow/rain. Perhaps this needs some different workaround.
Thu, 27 Dec 2007 17:15:06

Ichor

You could probably just use ACS scripts for that.
Thu, 27 Dec 2007 17:17:32

Crimson Wizard

Well, yeah. Anyway - not from particles. Some objects maybe, that grow in time. we have blood stain in Hexen, we may use similar graphic (blue coloured). EDIT: huh, no, not that sprite objects; but decals. Yeah. Decals. Decals, we need decals... Decals, we need decals... Decals, we need decals... <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) -->
Thu, 27 Dec 2007 18:53:48

The 4th Class

I was thinking more along the lines of changing floor height and texture.
Thu, 27 Dec 2007 19:21:47

Crimson Wizard

Then yes - you better do this in script on certain maps. Its too much for a generic effect.

Back to the Korax Forum Archives