Data Realms Fan Forums
http://45.55.195.193/

Dynamic water [Update 3]
http://45.55.195.193/viewtopic.php?f=1&t=27281
Page 1 of 2

Author:  Mehman [ Tue Dec 13, 2011 3:49 pm ]
Post subject:  Dynamic water [Update 3]

As this has been released, this thread will no longer be updated, download updates and post your comments here:
viewtopic.php?f=61&t=28899



Hi,

I'm currently trying to make dynamic water in CC, so I made this:
Attachment:
WaterV3.rar [5.28 KiB]
Downloaded 249 times

old:


Once this is installed open the lua console and type:
Code:
Water(x,y)

To drop some water on the location designated by the coordinates x and y, for example:
Code:
Water(100,0)

Would make water drop from the sky 100 pixels away from the end of the map.

Edit of the edit of the edit:
Updated to V3: Water can now be deployed using the Molotow cocktail, AHumans can swim.
Edit of the edit:
Updated to V2: minor bug fix.
Edit:
I completely recoded the water in a different way that is much more efficient, that means water should be more stable, behave more realistically and most importantly produce almost no lag.

Author:  ludsoe [ Wed Dec 14, 2011 7:19 am ]
Post subject:  Re: Dynamic water

THIS IS IT!!!!!
The mod that changes everything.

Author:  Shakatuko [ Wed Dec 14, 2011 5:24 pm ]
Post subject:  Re: Dynamic water

you could give us an option to generate water in the build mode, so then I, one guy that don't like math, don't have to calculate the place I want to put water. And, I can't get water. I can't even get my lua console in-game!

EDIT: I now can see my console, but I can't see the water. I use that water Molotov you made and my CC lags like hell and The water is invisible.

Author:  unwoundpath [ Wed Dec 14, 2011 9:17 pm ]
Post subject:  Re: Dynamic water

You told the non-believes alright!

Still a prototype, but better than what others said could and could not be done!

Author:  Asklar [ Wed Dec 14, 2011 9:27 pm ]
Post subject:  Re: Dynamic water

I think the problem here is lua, I've also noticed it is very slow.

I wouldn't know how to solve it unless from the basic ideas of "bigger water, less updates per frame", but that is ruining the aesthetics of the mod.

And if you do what you said of using a different program to compute the particle's position, check if there isn't any change in the terrain and "predict" positions the particles might have in the future?

Author:  Sims_Doc [ Thu Dec 15, 2011 9:00 pm ]
Post subject:  Re: Dynamic water

You known the odd thing me and a friend of mine have been working on the same thing, but since someone else is working on a project as of such we can Abaddon it and move on to more important things.

Author:  Roast Veg [ Thu Dec 15, 2011 11:42 pm ]
Post subject:  Re: Dynamic water

Could you possibly stop the erratic movement and just let it "settle" (not become terrain, that would be silly), so that I can actually use it without it looking like a perpetual tsunami?

Author:  trystanr [ Fri Dec 16, 2011 12:33 pm ]
Post subject:  Re: Dynamic water

Could I get a gif to see?
This would munch up my computer.

Author:  Shakatuko [ Fri Dec 16, 2011 4:52 pm ]
Post subject:  Re: Dynamic water

Why is the water invisible to me? I use that water molotov and it blows up and my PC lags and My units start to float and unfloat and float... The thing is: I can't see the water!

Author:  Mehman [ Sat Dec 17, 2011 9:53 pm ]
Post subject:  Re: Dynamic water

I just updated this:
More speed, less bugs, more stability, and much less lag.


Shakatuko wrote:
you could give us an option to generate water in the build mode, so then I, one guy that don't like math, don't have to calculate the place I want to put water. And, I can't get water. I can't even get my lua console in-game!

EDIT: I now can see my console, but I can't see the water. I use that water Molotov you made and my CC lags like hell and The water is invisible.

The molotov doesn't work, I'll make more practical and realistc delivery methods later, also I suggest you download the new version that is much less laggy.

Roast Veg wrote:
Could you possibly stop the erratic movement and just let it "settle" (not become terrain, that would be silly), so that I can actually use it without it looking like a perpetual tsunami?

Corrected in the new version.

trystanr wrote:
Could I get a gif to see?
This would munch up my computer.

The new version doesn't lag very much, you could use it even on an old computer(mine is five years old and it doesn't lag much unless I spawn a whole ocean).

Asklar wrote:
I think the problem here is lua, I've also noticed it is very slow.

I wouldn't know how to solve it unless from the basic ideas of "bigger water, less updates per frame", but that is ruining the aesthetics of the mod.

And if you do what you said of using a different program to compute the particle's position, check if there isn't any change in the terrain and "predict" positions the particles might have in the future?

I found a way to make it more efficient without having to rely on an external program, still thanks for the suggestion.

Author:  nicolasx [ Sun Dec 18, 2011 5:29 am ]
Post subject:  Re: Dynamic water [Update 1]

tried to do this got this error

ERROR: Water.rte/Watc2.lua:71: attempt to index field '?' (a nil value)

did I do something wrong?

I put in this code Water (17,18)

EDIT: it seems to have worked (even tho the error messages were there) its still kinda laggy but pretty nice

Author:  Mehman [ Sun Dec 18, 2011 1:19 pm ]
Post subject:  Re: Dynamic water [Update 2]

You didn't do anything wrong, I forgot to check for near end of the map actors in the floating actors part of the code, so it checked for water at non existing coordinates whenever an actor was near the end of the map, I just corrected that in V2.1.
(V2.0 still has the bug, and another one too because I misspelled a variable, to the person that downloaded it: please download V2.1, for V2.0 will probably not work properly.)

Edit:
Updated to V3: Water can now be deployed using the Molotow cocktail, AHumans can swim.

Also I made a video of this:

Author:  Sims_Doc [ Mon Dec 19, 2011 1:16 am ]
Post subject:  Re: Dynamic water [Update 3]

Ok, i just look at the Video and it seems you've gone for the block base water it seems you've taken a different path.

Author:  ludsoe [ Mon Dec 19, 2011 7:49 am ]
Post subject:  Re: Dynamic water [Update 3]

Sims_Doc wrote:
Ok, i just look at the Video and it seems you've gone for the block base water it seems you've taken a different path.


Now to make it smaller...... And emit particles when a actor collides with it.

Author:  Roast Veg [ Mon Dec 19, 2011 3:23 pm ]
Post subject:  Re: Dynamic water [Update 3]

Once you go below ~8 your timescale is below half of what it should be, which is pretty slow going.

I combined this with some Hydro Plus code, got some flying particles and other objects to behave in a more watery fashion, with very little additional lag. I tried a whole load of sizes and speeds for the water to run at, the best settings I found was a size of twelve (bunker modules normally go in twelves) at 1.5 times the current speed, but I can tell that won't be the best for a lot of machines. I also altered the colour slightly so it didn't go purple inside a cave, and textured it so that it looked more watery.

Page 1 of 2 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/