View unanswered posts | View active topics It is currently Sat Dec 28, 2024 5:52 pm



Reply to topic  [ 29 posts ]  Go to page 1, 2  Next
 Dynamic water [Update 3] 
Author Message
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post 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.


Last edited by Mehman on Tue Jan 03, 2012 11:54 pm, edited 10 times in total.



Tue Dec 13, 2011 3:49 pm
Profile
User avatar

Joined: Tue Jan 18, 2011 7:50 am
Posts: 170
Location: 2 Miles underground on some planet in a vault.
Reply with quote
Post Re: Dynamic water
THIS IS IT!!!!!
The mod that changes everything.


Wed Dec 14, 2011 7:19 am
Profile
User avatar

Joined: Mon Oct 10, 2011 12:50 am
Posts: 75
Location: Look behind you... Haha I tricked you, I am in Brazil.
Reply with quote
Post 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.


Last edited by Shakatuko on Thu Dec 15, 2011 12:27 am, edited 1 time in total.



Wed Dec 14, 2011 5:24 pm
Profile
User avatar

Joined: Sun Mar 07, 2010 7:19 am
Posts: 1279
Location: Places. And things.
Reply with quote
Post Re: Dynamic water
You told the non-believes alright!

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


Wed Dec 14, 2011 9:17 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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?


Wed Dec 14, 2011 9:27 pm
Profile
User avatar

Joined: Fri Aug 20, 2010 4:45 am
Posts: 911
Location: No Comment.
Reply with quote
Post 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.


Thu Dec 15, 2011 9:00 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post 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?


Thu Dec 15, 2011 11:42 pm
Profile
User avatar

Joined: Sat Oct 09, 2010 10:01 am
Posts: 303
Location: Afrique d' Sud
Reply with quote
Post Re: Dynamic water
Could I get a gif to see?
This would munch up my computer.


Fri Dec 16, 2011 12:33 pm
Profile YIM WWW
User avatar

Joined: Mon Oct 10, 2011 12:50 am
Posts: 75
Location: Look behind you... Haha I tricked you, I am in Brazil.
Reply with quote
Post 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!


Fri Dec 16, 2011 4:52 pm
Profile
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post 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.


Sat Dec 17, 2011 9:53 pm
Profile
User avatar

Joined: Sun Mar 13, 2011 6:17 pm
Posts: 646
Reply with quote
Post 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


Sun Dec 18, 2011 5:29 am
Profile
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post 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:


Sun Dec 18, 2011 1:19 pm
Profile
User avatar

Joined: Fri Aug 20, 2010 4:45 am
Posts: 911
Location: No Comment.
Reply with quote
Post 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.


Mon Dec 19, 2011 1:16 am
Profile
User avatar

Joined: Tue Jan 18, 2011 7:50 am
Posts: 170
Location: 2 Miles underground on some planet in a vault.
Reply with quote
Post 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.


Mon Dec 19, 2011 7:49 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post 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.


Mon Dec 19, 2011 3:23 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 29 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: Google [Bot]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.059s | 16 Queries | GZIP : Off ]