Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Pages: [1] 2 3  All

Author Topic: WeatherGod 0.2 (real time snow/rain)  (Read 22876 times)

0 Members and 1 Guest are viewing this topic.

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 689
    • View Profile
WeatherGod 0.2 (real time snow/rain)
« on: December 12, 2003, 01:25:11 AM »

Hiya Wintermutees,

ok, you want snow or rain in realtime ? Here it is. It's not really what I wanted it to be, but I just had a nice conversation with Mnemonic in our IRC channel, which was kind of frustrating for me, therefore I'm not that motivated to continue this little experiment anymore. (It's not his fault though ! ;) )

While rewriting my old snow script, I always had in mind, how easy it could be if there already were video entities, so I could just use a rendered snow video with an alpha channel and display it in background and foreground. Does there ring a bell ?

... well of course: you can ANYWAY it's FAR more COOL 8) to calculate every single snowflake in realtime (hehe), although of course it has its restrictions, every movement of every snowflake has to be calculated, set and displayed...

So I found out it works quite fine with about up to 200 snowflakes/raindrops, but 300 really affect the FPS too much. Well, maybe some smart WME user can optimize it, I'm curious. At least I hope it's a fine piece of code to get the idea of it.

Now to the package:

The main part is done in scenes\snowflakes\makesnow.script. There is a settings part, which is by default a nice snow fall. In the root of the project folder, you'll find two TXT files with settings for snow and rain (sorry about the sprites, please create your own!), just substitute the settings part in the snow-script with them to get other results. Most settings are already commented. If not, punish or ask me here...

Recommended: Once you found the right setting for you, you should cut away all script parts that are not necessary in the animation part to get more speed. The current version handles ALL possible settings, which is not necessary and decreases the speed.

So here it is:

http://wme.jerrot.de/snowflakes03.rar

EDIT: This is the bugfixed version from 2004-06-25, which shouldn't result in long load/save times anymore.

I'd be happy about comments, optimizing ideas and credits if you ever use it. ;)

Greetings,
Jerrot.
« Last Edit: June 25, 2004, 09:02:36 AM by Jerrot »
Logged
Mooh!

creatorbri

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 61
  • I'm a llama!
    • View Profile
Re:WeatherGod 0.2 (real time snow/rain)
« Reply #1 on: December 12, 2003, 05:32:46 AM »

That's fabulous Jerrot! It looks so real!

It's just too bad my FPS drops down to an average of about 12 -- and that's without any additions to the project. Definitely need to find some ways to optimize. At the moment I'm trying to pinpoint the areas that require the most heavy duty processing, but that's one area I'm not too good at yet.
Logged

Nihil

  • Supporter
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 528
  • Fear me! I'm evil!
    • View Profile
    • Order of Dagon
Re:WeatherGod 0.2 (real time snow/rain)
« Reply #2 on: December 12, 2003, 08:13:08 AM »

YES YES YES!

Can't wait to get home and try out!



Me and the boys are singing the Happy-Happy-Joy-Joy-Song now :)

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1454
  • Lamp dog!
    • View Profile
Re:WeatherGod 0.2 (real time snow/rain)
« Reply #3 on: December 12, 2003, 08:50:36 AM »

Thanks for the code Jerrot.

Here it is. It's not really what I wanted it to be, but I just had a nice conversation with Mnemonic in our IRC channel, which was kind of frustrating for me, therefore I'm not that motivated to continue this little experiment anymore. (It's not his fault though ! ;) )

 ??? :-\ ??? :-\

EDIT: This is my 500th post  ;D
« Last Edit: December 12, 2003, 08:52:29 AM by odnorf »
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5677
    • View Profile
    • Dead:Code Site
Re:WeatherGod 0.2 (real time snow/rain)
« Reply #4 on: December 12, 2003, 09:40:22 AM »

All hail hypnotoad..err, I mean Jerrot!


ok, you want snow or rain in realtime ? Here it is. It's not really what I wanted it to be, but I just had a nice conversation with Mnemonic in our IRC channel, which was kind of frustrating for me, therefore I'm not that motivated to continue this little experiment anymore. (It's not his fault though ! ;) )

Well, if I knew that, I wouldn't say that! You can still feel pretty much motivated, since prerendered snow in THIS quality would take up inredible amounts of memory, especially in high resolutions.
If I wanted to make snow, I'd choose scripting as well!
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 689
    • View Profile
Re:WeatherGod 0.2 (real time snow/rain)
« Reply #5 on: December 12, 2003, 12:10:25 PM »

That's fabulous Jerrot! It looks so real!
It's just too bad my FPS drops down to an average of about 12 -- and that's without any additions to the project.

Thanks - well 12 FPS is really low. I get about 120 fps with this setting (200 snowflakes) on my GeForce 2 MX, on Mnemonic's monster card it were even 250.
Of course you can try how many FPS you can win by stripping all the if-clauses you don't need for your settings, but I doubt it would be THAT much more.

Definitely need to find some ways to optimize. At the moment I'm trying to pinpoint the areas that require the most heavy duty processing, but that's one area I'm not too good at yet.

Well, I'm curious. The main part doesn't use very much of the code finally, that's why I wrote the "reset_snowflake()" already. Another way could be to get the users FPS and make the "max_flakes" dynamic, but I don't like that idea too much... :)

What graphic card (or chip set ?) do you use ? I even get 67 FPS in software mode. (Although that looks stupid without alpha channels... ;) !)

Me and the boys are singing the Happy-Happy-Joy-Joy-Song now :)

Hm, I just read a book where the crazy killers always wear T-Shirts with these words... :)

[[...]I'm not that motivated to continue this little experiment anymore.
??? :-\ ??? :-\

Now, I'd still be happy to optimize the code, but I don't know if there really is a need to create a GUI for it to adjust the values in real-time. You can try to convince me of course. ;)

All hail hypnotoad..err, I mean Jerrot!

LOL  :D

Well, if I knew that, I wouldn't say that!

Don't take this too seriously. ;)

You can still feel pretty much motivated, since prerendered snow in THIS quality would take up inredible amounts of memory, especially in high resolutions.
If I wanted to make snow, I'd choose scripting as well!

Gee... ok! I'm motivated.  ;) But I guess there is not too much room to optimize the code anymore without directly accessing the engine's graphic layer (which I don't want, that's the way AGAST went and that's too much for a script language in my opinion). When you checked it with the C++ Profiler, what was the second heaviest part though ?
Logged
Mooh!

Nihil

  • Supporter
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 528
  • Fear me! I'm evil!
    • View Profile
    • Order of Dagon
Re:WeatherGod 0.2 (real time snow/rain)
« Reply #6 on: December 12, 2003, 12:38:30 PM »


Hm, I just read a book where the crazy killers always wear T-Shirts with these words... :)

Hehe, I think a Ren&Stimpy-Shirt is a good choice for the stylisch Mass-Murder of today :)

Nihil

  • Supporter
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 528
  • Fear me! I'm evil!
    • View Profile
    • Order of Dagon
Re:WeatherGod 0.2 (real time snow/rain)
« Reply #7 on: December 12, 2003, 09:00:22 PM »

I had no time to look into the code until now, but I tested the scene, and it looked very good :)

I get also more FPS than in the prior version -> now it's around 30 FPS.

The 120 you get, are they with optimized code?

I have a Athlon at 1 Ghz, 512 MB Ram and a Geforce 2MX with 64 MB Ram ... but I will try to optimize the code and look how much I get then (though I'm pretty sure that after my optimize it won't do anything anymore ;) ).

And next week I get my new Geforce 5600, then all FPS-Problems should be history for me :)

But thanks for sharing it with us, it's really a pretty cool piece of code.

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 689
    • View Profile
Re:WeatherGod 0.2 (real time snow/rain)
« Reply #8 on: December 12, 2003, 09:11:20 PM »

I get also more FPS than in the prior version -> now it's around 30 FPS.
The 120 you get, are they with optimized code?
I have a Athlon at 1 Ghz, 512 MB Ram and a Geforce 2MX with 64 MB Ram ...

No, 120-130 fps with the same version you downloaded (in windowed mode). And I've got the same graphic card (but only 32 MB). Only my computer is faster (Athlon 2 GHz), but is that all ? If I ever use this in my game, I don't want to make a system requirement of 2 GHz for a 2D adventure. ;-)

Quote
but I will try to optimize the code and look how much I get then (though I'm pretty sure that after my optimize it won't do anything anymore ;) ).

Well, I'm curious to hear the result. :)
Logged
Mooh!

creatorbri

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 61
  • I'm a llama!
    • View Profile
Re:WeatherGod 0.2 (real time snow/rain)
« Reply #9 on: December 13, 2003, 10:21:48 PM »

Thanks - well 12 FPS is really low. I get about 120 fps with this setting (200 snowflakes) on my GeForce 2 MX, on Mnemonic's monster card it were even 250. Of course you can try how many FPS you can win by stripping all the if-clauses you don't need for your settings, but I doubt it would be THAT much more.

...

Well, I'm curious. The main part doesn't use very much of the code finally, that's why I wrote the "reset_snowflake()" already. Another way could be to get the users FPS and make the "max_flakes" dynamic, but I don't like that idea too much... :) What graphic card (or chip set ?) do you use ? I even get 67 FPS in software mode. (Although that looks stupid without alpha channels... ;) !)

I really don't think this has much to do with the video card... it seems more CPU-intensive than video-intensive.

My system is a P3 550 Mhz with 256 MB RAM (and a GeForce 256 DDR 32 MB, which performs at the same level as a GeForce2 MX 32 MB).

Also, maybe placing the reset_snowflake() code into the main body of the script instead of making the function call would speed things up?
Logged

Nihil

  • Supporter
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 528
  • Fear me! I'm evil!
    • View Profile
    • Order of Dagon
Re:WeatherGod 0.2 (real time snow/rain)
« Reply #10 on: December 13, 2003, 11:41:28 PM »

Also, maybe placing the reset_snowflake() code into the main body of the script instead of making the function call would speed things up?

I tried this, but it didn't made a difference in FPS.

Same with commenting out unneeded code.

The only thing that helped was reducing the amount of flakes.

But then, when my game will be finished, the standart-game-pc will have 5 Ghz minimum, so it should be no problem at all :)

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 689
    • View Profile
Re:WeatherGod 0.2 (real time snow/rain)
« Reply #11 on: December 14, 2003, 01:36:01 AM »

Thanks Nihil and irbrian!

Also, maybe placing the reset_snowflake() code into the main body of the script instead of making the function call would speed things up?
I tried this, but it didn't made a difference in FPS.
Same with commenting out unneeded code.
The only thing that helped was reducing the amount of flakes.

Too bad - now, at least I tried it. ;) And maybe - with less and smaller snowflakes - it's still useable.

Hey Mnemonic, speed up the engine!  :-X ;)
Logged
Mooh!

Nihil

  • Supporter
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 528
  • Fear me! I'm evil!
    • View Profile
    • Order of Dagon
Re:WeatherGod 0.2 (real time snow/rain)
« Reply #12 on: December 15, 2003, 09:12:21 AM »

Hopefully my new graphics-card arrives this week, then I can tell you if it makes a big difference.

For my scenes I now use 125 flakes, put all the functions in the main code and use them all with the same speed so the random calculation is not needet. It's still good looking (not so good as in your original code, but still ok) and I achieve a bit more than 70 FPS that way, I think this is ok.

Next thing I will try how it works with an actor in the scene.

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5677
    • View Profile
    • Dead:Code Site
Re:WeatherGod 0.2 (real time snow/rain)
« Reply #13 on: December 15, 2003, 10:07:13 AM »

I'll see what I can do to speed up some critical parts.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 689
    • View Profile
Re:WeatherGod 0.2 (real time snow/rain)
« Reply #14 on: December 15, 2003, 12:04:16 PM »

I'll see what I can do to speed up some critical parts.

(Actually I was joking... because I think WME already is quite fast considering the comfort and its abstraction layer, but forget I wrote this! ;) !)
Logged
Mooh!
Pages: [1] 2 3  All
 

Page created in 0.255 seconds with 22 queries.