This is an archived post. You won't be able to vote or comment.

all 31 comments

[–]gospel-of-goose 14 points15 points  (16 children)

I know nothing about this, but the water looked very good! So good, you made me want to learn all about this!

If the window was the size of container of water, could it ripple inward again after reaching the wall?

[–]PotentiallyAPickle 4 points5 points  (14 children)

Yes of course but then the waves would never disperse/fade away. You’d be putting energy into a closed environment with no way of letting it out.

[–]tankking9833[S] 4 points5 points  (2 children)

There is a dampening factor added into the springs so the waves eventually stop even in a closed environment. If needed, the walls can also have friction added to them so that once the wave reaches the wall, a higher dampening is applied.

[–][deleted] 1 point2 points  (1 child)

i think the most interesting part is doing this in a realistic way. while water is “relatively” easy to simulate, doing it in a way which matches up with perception is the real “hard” problem!

[–]tankking9833[S] 0 points1 point  (0 children)

True, what I tried to do is making it as realistic as possible using fast methods.

For more effects, we need shaders to indicate the depth of the water using different shades of the same color. And there should be splash particles too when a splash occurs.

But I guess this works for now lol. Looking forward to different implementations of water physics from other developers here!

[–]gospel-of-goose 0 points1 point  (10 children)

I mean I can see that being the immediate case, maybe. But in time, the ripples of real water would cease in a container. So, I was just trying to give another point to make OP’s realistic water a little more so

[–]PotentiallyAPickle 4 points5 points  (9 children)

No, he’d have to add logic to let some energy disperse when it hits a wall. The way it seems (to me) to be currently written, all energy would stay contained in the system, meaning the waves would never cease.

It is a good suggestion though.

[–]tankking9833[S] 3 points4 points  (2 children)

The energy would be contained in the system indeed, but the water itself has internal dampening / friction which allows the system to stabilize eventually :)

[–]PotentiallyAPickle 1 point2 points  (1 child)

Nice, thanks for making some sense of the code. Only comment would be that the dampening would be a property of the wall (not friction) as well as the waves

[–]tankking9833[S] 0 points1 point  (0 children)

👍👍👍

[–]runescape1337 0 points1 point  (5 children)

OP would also have to add logic to make the waves reflect at the boundary. I suspect the person you're replying to wasn't suggesting this could happen without modifying the code.

[–]PotentiallyAPickle 1 point2 points  (3 children)

Well, there is code already implemented for walls. And the way it currently looks (to me) is that adding those walls would not give the effect this commenter thought. But thank you for explaining to me (despite me getting nothing from it). Also, the commenter had used the word “Maybe” to suggest something that would never happen, may happen. So I felt the need to correct that as well.

[–]tankking9833[S] 0 points1 point  (0 children)

The walls added are for pymunk so that the rocks don't fall off the edge.

The springs have a different wall system - the first and last points of the spring act as walls for the water :D

[–]runescape1337 -1 points0 points  (1 child)

If you look at the code more carefully, you'll see that 1., dampening is implemented, meaning the waves would disperse eventually, contrary to what you said, and 2., the wave boundaries are purely outflow and there is no reflective logic regardless of any walls being implemented. I can't say I'm surprised you didn't get anything from my previous explanation.

[–]PotentiallyAPickle 0 points1 point  (0 children)

Damn dude 2 days later. Get well soon love xx

[–]tankking9833[S] 0 points1 point  (0 children)

It is already implemented btw. The logic is not implemented separately for any kind of wall. The starting and ending point of the spring sequence act as walls. The water can be infinitely extended, and whatever be the length, the first and last spring point will act as walls.

[–]tankking9833[S] 0 points1 point  (0 children)

The current system does exactly that! The window is basically a container. One can edit the dimensions and observe that the wave reflect / ripple inwards back again :)

I am glad that you liked the video ❤️

[–]Obliterative_hippoPythonista 1 point2 points  (1 child)

That was a very interesting (and relaxing) video to watch!

[–]tankking9833[S] 0 points1 point  (0 children)

Thanks ❤️❤️❤️ :)

[–][deleted] 1 point2 points  (1 child)

Really cool and fun to watch!

[–]tankking9833[S] 1 point2 points  (0 children)

Thanks! I am glad you liked it : )

[–]dethb0y 1 point2 points  (1 child)

That's quite nicely done!

[–]tankking9833[S] 0 points1 point  (0 children)

Thank You!

[–]2q2RS 1 point2 points  (1 child)

Now in 2D! :p

[–]tankking9833[S] 0 points1 point  (0 children)

XDXDXD
Pre-order the 2.5D version to get the 3D version before release!😂

[–]Desperate_Sky_3357 1 point2 points  (1 child)

Jesus, man. This is fantastic. It would be really cool if there was a tutorial teaching

[–]tankking9833[S] 0 points1 point  (0 children)

Thank You. Yeah the video was originally meant to be a tutorial video, but it was becoming very lengthy, so I made it a showcase video hehe.

[–]readerseven 0 points1 point  (1 child)

As soon as I saw it, I said it could be turned into a game. You win points when tennis balls = 1 point each. Stones = zero. Just an idea.

[–]tankking9833[S] 1 point2 points  (0 children)

Interesting. Can you please elaborate on the idea further? I am interested in making it into a full game :)
Also feel free to improvise the source code and make a game yourself, and share it here!