Lua for precipitation

Discuss and unveil current Marathon projects.

Post Oct 19th '09, 01:51

I've created a lua script that when combined with shapes and physics, will create snow, rain or whatever else you may want on map. The precipitation spawns under polygons that have a landscape ceiling. You can even set the wind speed and direction if you want. Just change the SNOW_MONSTER to whatever monster you want to use for the precipitation and include shapes and physics to make it look like the kind of precipitation you want.

The precipitation in this script will not block projectiles, so it should have no effect on gameplay.
Attachments
snow.zip
(1.47 KiB) Downloaded 139 times
User avatar

Wrkncacnter

Post Oct 19th '09, 02:10

let it never be said that wrk never contributed to the community.
D?rovací tvá?í.

Fobo: I find it hard to keep a sentence down under two paragraphs.
User avatar

tehWastedJamacan
SuFu, SD

Post Oct 19th '09, 02:31

The code looks fascinating. If I am reading this right, you've got a random distribution of particles moving in a defined direction and speed, which should look a hell of a lot nicer than the old way of making rain, as it were. Also, you like shit and ballsacks, which at $15 dollars is a bargain when compared to competing queef and cunt products which offer less than stellar results, comparable to this wonder of 80 or so lines.

Fun! I think I'll get to trying this out right now.
Image
Kurinn

Post Oct 19th '09, 02:34

WastdJamacan wrote:let it never be said that wrk never contributed to the community.

No one was saying that prior to this script.
User avatar

RyokoTK
Saint Paul, MN

Post Oct 19th '09, 02:35

I never said they did.
D?rovací tvá?í.

Fobo: I find it hard to keep a sentence down under two paragraphs.
User avatar

tehWastedJamacan
SuFu, SD

Post Oct 19th '09, 03:24

Well, there are a couple of limitations to this now that I've gone and tested it.

One, the script creates so many monsters that it runs itself dry every so often, and you get a cycle where the amount of monsters spawned peak above the limit, thus not allowing any more until enough die. Increasing the dynamic limit with MML only slows things down. I played with your code to try to deal with this, but to no avail. I would say that you could check the x y for where the monsters spawn to see if it's within a certain range of the player, and use fog liberally, but this problem exists even on the tiny map I tested it out on.

Two, the dead monsters splash in liquids if they should land there. The snowflakes are splashing like rocks, as a result. Not sure how to overcome this, aside from not placing liquids underneath landscaped ceilings.

Three, the dead monsters show up on the motion detector, which makes the motion detector kind of useless.


Do you have any workarounds for these problems? I must say, it really looks great, otherwise.




Last edited by Kurinn on Oct 19th '09, 03:28, edited 1 time in total.
Image
Kurinn

Post Oct 19th '09, 03:28

Kurinn wrote:One, the script creates so many monsters that it runs itself dry every so often, and you get a cycle where the amount of monsters spawned peak above the limit, thus not allowing any more until enough die.


For some reason I noticed this only in single player, it seemed to even itself out online.
User avatar

$lave

Post Oct 19th '09, 03:32

Well I've only tried this with the map $lave created, and I haven't noticed the first problem you mentioned (except for maybe the first 10 seconds of gameplay, where it's really messed up). You may get different effects depending on how much "outside" area there is on a given map. I doubt I can make it much better without seeing the problem, and even then there may not be a lot I can do about it.

For the second thing, I guess use rain if you want water outside :P. Rain causing ripples in the water could be pretty cool. But yeah, I don't know of anything I can do about that. Maybe you can edit the physics/shapes to get rid of the splashes? I'm no expert on physics or shapes.

For number 3: oh well!

Edit: OK, I can kind of see the problem with #1. Try this update out and let me know if you think it's any better. The script has to learn how often it should spawn over time, based on how much outside area the map has. So the first 10 seconds will be very weird, and then it'll start to even out slowly. It seems to snow less at first and then gradually it starts snowing harder until things even out. It may take 30 seconds or so to even out.
Attachments
snow.v2.zip
(1.55 KiB) Downloaded 141 times
Last edited by Wrkncacnter on Oct 19th '09, 04:55, edited 1 time in total.
User avatar

Wrkncacnter

Post Oct 19th '09, 05:27

Kurinn your liquids screw up my A1 in multiplayer.
Nice script, why is the snow made of stars?
Si tratta di una lacrimosa.
User avatar

envy
Land of the New Rising Sun

Post Oct 19th '09, 05:46

Some of these problems would go away if you just spawned projectiles directly instead of spawning monsters, which lua can do. That saves you from wasting a monster slot, they don't show on radar, less memory is used, etc.
User avatar

Crater Creator

Post Oct 19th '09, 05:57

We've thought about this and there will most likely be a new version coming out soon that uses projectiles. I don't know if it will really solve all the problems you mentioned in the other thread, it looks like different people are getting different results.
User avatar

Wrkncacnter

Post Oct 19th '09, 08:08

The latest script you uploaded works very well on the latest A1 build (15october).
User avatar

goran

Post Oct 19th '09, 08:27

Oh my God. It can finally be raining Bobs!
Atomic Potato. Veteran Since '95.

"If you aren't running Mac OS 10.4.10, then you aren't running the exact same operating system that I am running." -- Me
Atomic Potato

Post Oct 19th '09, 08:44

Hmm... raining BoBs...
Polyplicity my second (less sucky) net pack. Go on. Download it. You know you don't want to.
Marathon Aeon- My scenario in the works ~on Simplici7y

riveting six-vertice amnesty ratifications
User avatar

Dugit
Hampshire, UK

Post Oct 19th '09, 12:35

D?rovací tvá?í.

Fobo: I find it hard to keep a sentence down under two paragraphs.
User avatar

tehWastedJamacan
SuFu, SD

Post Oct 19th '09, 13:07

Yes. Very funny.
Polyplicity my second (less sucky) net pack. Go on. Download it. You know you don't want to.
Marathon Aeon- My scenario in the works ~on Simplici7y

riveting six-vertice amnesty ratifications
User avatar

Dugit
Hampshire, UK

Post Oct 19th '09, 13:10

A FRIGGIN' RAINBOW
(seizure warning)
Thank the sun that went nova so that Earth could have iron and silicon.
User avatar

effigy

Post Oct 19th '09, 13:47

W wrote:The script has to learn how often it should spawn over time, based on how much outside area the map has. So the first 10 seconds will be very weird, and then it'll start to even out slowly. It seems to snow less at first and then gradually it starts snowing harder until things even out. It may take 30 seconds or so to even out.

I don't know why it should have to do this. You know how many monsters are on the map. You know how many polygons are outside, and what their area is. You know how many monster slots are available. You know how quickly monsters fall, and how tall each polygon is.


Crater Creator wrote:Some of these problems would go away if you just spawned projectiles directly instead of spawning monsters, which lua can do. That saves you from wasting a monster slot, they don't show on radar, less memory is used, etc.

It's a trade off. The default max for projectiles is much lower (128 vs 512), so I don't know why you're concerned about monster slots--I'd be more concerned about not being able to fire my weapon! Projectiles and dead monsters use the same amount of memory, but projectiles have the potential to use more CPU since the engine has to do collision detection on them, which it doesn't for dead monsters. Of course, with projectiles you could use a juggernaut as an umbrella.
Last edited by treellama on Oct 19th '09, 13:48, edited 1 time in total.
User avatar

treellama
Pittsburgh

Post Oct 19th '09, 14:02

Really? Hmm...
Polyplicity my second (less sucky) net pack. Go on. Download it. You know you don't want to.
Marathon Aeon- My scenario in the works ~on Simplici7y

riveting six-vertice amnesty ratifications
User avatar

Dugit
Hampshire, UK

Post Oct 19th '09, 15:01

I downloaded this, and it's raining yetis!!!!!!!!!
Why????

EDIT:Don't worry... me being stupid
Last edited by Fishman92 on Oct 19th '09, 15:05, edited 1 time in total.
Fishman92

Post Oct 19th '09, 15:27

Treellama wrote:I don't know why it should have to do this. You know how many monsters are on the map. You know how many polygons are outside, and what their area is. You know how many monster slots are available. You know how quickly monsters fall, and how tall each polygon is.

Of course I don't have to, but it will take some time to figure out a good formula that will work well with every map. Unless you know one off the top of your head? In the meantime, I'm letting the script do the thinking.
User avatar

Wrkncacnter

Post Oct 19th '09, 15:59

Is there any way to turn of the sound when it hits water?? Because it's really annoying.
Fishman92

Post Oct 19th '09, 16:20

Envy wrote:Kurinn your liquids screw up my A1 in multiplayer.
Nice script, why is the snow made of stars?


How exactly do they screw up?

It's because I was lazy enough to just replace the sequences for the tiny yeti's deaths with the sequences for fusion contrail.

EDIT:

Tried the new script, and it works better.

There's still the problem with the motion sensor to work around, anyway. The idea of working around this by switching to projectiles seems to be no better a trade-off for reasons explained prior. If you really want to get this to work seamlessly, it's going to involve some kind of modification of the engine itself, it would seem. But by itself, this snow could work well given the caveat that you can't let the player get close enough to the snow for it to show up on the motion sensor, and that you don't want any liquids for it to splash into.
Last edited by Kurinn on Oct 19th '09, 16:32, edited 1 time in total.
Image
Kurinn

Post Oct 19th '09, 16:58

Agreed.
Polyplicity my second (less sucky) net pack. Go on. Download it. You know you don't want to.
Marathon Aeon- My scenario in the works ~on Simplici7y

riveting six-vertice amnesty ratifications
User avatar

Dugit
Hampshire, UK

Post Oct 19th '09, 20:59

the darkness shows up funny, the texture gets all weird, and or it gets really dark around the texture, and then when you can actually see it, its weird. when i say weird, i mean it looks like radio static and green shit combined.
Si tratta di una lacrimosa.
User avatar

envy
Land of the New Rising Sun

Next

Return to Projects



Who is online

Users browsing this forum: No registered users