# Fluid Dynamics - Curl Noise

**URL:** https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98
**Category:** Theory
**Created:** [August 1, 2015, 12:46pm UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98 "2015-08-01T12:46:26Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![TheCreator](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/thecreator/32/64_2.png) [@TheCreator](https://forum.revolutionarygamesstudio.com/u/TheCreator)
#### Post date: [February 21, 2016, 5:40pm UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/42 "2016-02-21T17:40:29Z")

</div>

Well, the spore system uses particle emitters -\_- which we decided not to use in favor of a grid based approach (so that we can actually collect the compound clouds).

I completely agree that they are too solid, and it bothers me, but I don’t think that I can do much. It would be nice if I had a concept image (no terrain just a cloud) I could be replicating. Speaking of which, who drew the Thrive concept above? I’d love to hear what they did to get the clouds looking the way they are.

Actually, now that I think about it, putting a Perlin noise texture above the existing cloud to use as an alpha channel might work.

The clouds don’t look any better in a video, sadly. Maybe later.

---

<div class="post-metadata">

### Author: ![Oliveriver](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/oliveriver/32/1962_2.png) [@Oliveriver](https://forum.revolutionarygamesstudio.com/u/Oliveriver)
#### Post date: [February 21, 2016, 5:51pm UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/43 "2016-02-21T17:51:01Z")

</div>

> [@TheCreator](#):
>
> Speaking of which, who drew the Thrive concept above? I’d love to hear what they did to get the clouds looking the way they are.

Luckily for you, you’re speaking to him.

I have the original file on an old laptop somewhere and could get at it if need be, but I think I remember what I did. I drew a green circle, gave it circular transparency (so that it gets more transparent the closer you are to the outer edge), then put a fractal cloud transparency over the top of that. Doing that with a couple of circles and overlapping them produces something like this:

 ![](https://thrivedevforum-uploads.b-cdn.net/original/1X/e2486e02b2b147bda6a0cbe7a6623cfb903c4e50.png)

I think something like that could work really well for the compound clouds in-game too. This is what the above looks like without the alpha noise, pretty similar to the compound clouds at the moment:

 ![](https://thrivedevforum-uploads.b-cdn.net/original/1X/b325b5b1163968f8104b2cd5c0fca1438bdcdb26.png)

Don’t look at it too long. It might do weird things to your eyes.

---

<div class="post-metadata">

### Author: ![TheCreator](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/thecreator/32/64_2.png) [@TheCreator](https://forum.revolutionarygamesstudio.com/u/TheCreator)
#### Post date: [February 21, 2016, 6:11pm UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/44 "2016-02-21T18:11:42Z")

</div>

That I can do 🙂 If you could send me the fractal noise texture you used, it should be easy to implement.

---

<div class="post-metadata">

### Author: ![Oliveriver](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/oliveriver/32/1962_2.png) [@Oliveriver](https://forum.revolutionarygamesstudio.com/u/Oliveriver)
#### Post date: [February 21, 2016, 6:35pm UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/45 "2016-02-21T18:35:39Z")

</div>

It was just the graphics program’s default noise map, but if you want it specifically [here you go](http://i.imgur.com/qwikxI0.png). Any alpha noisemap should work I guess.

---

<div class="post-metadata">

### Author: ![TheCreator](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/thecreator/32/64_2.png) [@TheCreator](https://forum.revolutionarygamesstudio.com/u/TheCreator)
#### Post date: [February 21, 2016, 7:54pm UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/46 "2016-02-21T19:54:12Z")

</div>

Yeah, I need the texture so that I can overlay it. Doesn’t have to be the same one. Is it supposed to be a black screen?

---

<div class="post-metadata">

### Author: ![Oliveriver](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/oliveriver/32/1962_2.png) [@Oliveriver](https://forum.revolutionarygamesstudio.com/u/Oliveriver)
#### Post date: [February 21, 2016, 7:58pm UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/47 "2016-02-21T19:58:57Z")

</div>

It shouldn’t be…it should be partially black and partially transparent. Is your browser background black or something?

---

<div class="post-metadata">

### Author: ![TheCreator](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/thecreator/32/64_2.png) [@TheCreator](https://forum.revolutionarygamesstudio.com/u/TheCreator)
#### Post date: [February 21, 2016, 11:30pm UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/48 "2016-02-21T23:30:25Z")

</div>

Oh, oh, oh! Much better:

 ![](https://thrivedevforum-uploads.b-cdn.net/original/1X/5f465db6c611c0fd5fc390b56f62ea29e0c4e68f.png)  
But I don’t like this fractal image too much, I’ll need to play with the parameters a bit.

Okay, so I think I’m just going to use perlin noise like this:

 ![](https://thrivedevforum-uploads.b-cdn.net/original/1X/61ab3713febea2e97b1b3dac516e419423b8c142.png)

Which image do you like better?

---

<div class="post-metadata">

### Author: ![NickTheNick](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/nickthenick/32/17_2.png) [@NickTheNick](https://forum.revolutionarygamesstudio.com/u/NickTheNick)
#### Post date: [February 22, 2016, 12:48am UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/49 "2016-02-22T00:48:20Z")

</div>

I personally prefer the first one, but is it possible for different compounds to have different textures to their clouds? That way both colour and texture could be used to distinguish between compound and agent clouds.

For colours, some of the one I can remember discussing were:  
Glucose - White  
Amino Acids - Pinkish Red  
Proteins - Darkish Red  
Calcium - Cream / Beige  
Hydrogen Sulfide - Light Yellow  
(I remember when we last brought up the topic of colours for the compound clouds, we discussed whether oxygen and carbon dioxide should be omnipresent and not be represented as clouds. However, if we’re not going for that approach, or if we will switch to that later, the colours were…)  
Oxygen - Light Grey  
Carbon Dioxide - Dark Grey

---

<div class="post-metadata">

### Author: ![TheCreator](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/thecreator/32/64_2.png) [@TheCreator](https://forum.revolutionarygamesstudio.com/u/TheCreator)
#### Post date: [February 22, 2016, 1:21am UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/50 "2016-02-22T01:21:35Z")

</div>

Yep, they’ll definitely have different colors and textures, but I think what I have now is good enough:

 ![](https://thrivedevforum-uploads.b-cdn.net/original/1X/446363567a08802b8ebe04886cce878ae0828a6d.png)  
No point perfecting it until I actually have the compound clouds fully functional. Plus, the material is really easy to change, takes like 10 seconds to recompile.

I agree with your colors mostly. Here are my comments:

1. What is the point of calcium, I don’t think cells really use it.
2. What about ammonia?
3. I think we decided to have oxygen and carbon dioxide as really large, but dilute clouds that swirl around you. I think oxygen was light blue and carbon dioxide was dark blue.

---

<div class="post-metadata">

### Author: ![NickTheNick](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/nickthenick/32/17_2.png) [@NickTheNick](https://forum.revolutionarygamesstudio.com/u/NickTheNick)
#### Post date: [February 22, 2016, 1:37am UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/51 "2016-02-22T01:37:19Z")

</div>

1. I don’t really know what calcium would be used for actually, I just remember it was brought up.
2. If we use light and dark blue for oxygen and carbon dioxide, we could use light grey for ammonia.
3. Sure, that works.

Also the toned down opacity of that latest picture makes it look much better.

---

<div class="post-metadata">

### Author: ![TheCreator](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/thecreator/32/64_2.png) [@TheCreator](https://forum.revolutionarygamesstudio.com/u/TheCreator)
#### Post date: [February 22, 2016, 5:05am UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/52 "2016-02-22T05:05:51Z")

</div>

Is this good enough? I feel like I made it a bit too transparent. Basically, I made the player cell continuously emit the compound clouds, and a bunch of other work under the hood. I’ll try to post a video tomorrow.

 ![](https://thrivedevforum-uploads.b-cdn.net/original/1X/1d2d6f6690a274276629b77e425639c578e25d47.png)

Here it is again in red:

 ![](https://thrivedevforum-uploads.b-cdn.net/original/1X/2f182ebe49d8561937cda39cdb62df6c83cd918e.png)

The next big step will be to make cells absorb the compound cloud, but I’m not quite sure how to do that yet (though I have some ideas).

---

<div class="post-metadata">

### Author: ![NickTheNick](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/nickthenick/32/17_2.png) [@NickTheNick](https://forum.revolutionarygamesstudio.com/u/NickTheNick)
#### Post date: [February 22, 2016, 5:10am UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/53 "2016-02-22T05:10:56Z")

</div>

That one is good too, and although it’s harder to see the thinner parts of the cloud, I think that’s fine because it blends in with the environment.

---

<div class="post-metadata">

### Author: ![Oliveriver](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/oliveriver/32/1962_2.png) [@Oliveriver](https://forum.revolutionarygamesstudio.com/u/Oliveriver)
#### Post date: [February 22, 2016, 5:22pm UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/54 "2016-02-22T17:22:56Z")

</div>

Amazing! It’s looking much better already.

I’m starting to think the background is far too bright, because not only are the cells difficult to make out but compound clouds are too. If you get a chance, could you swap in the background you used for the new editor to see if that makes a difference?

> [@TheCreator](#):
>
> What is the point of calcium, I don’t think cells really use it.

I remember reading ~sciocont’s idea for this: basically a cell would produce calcium carbonate (utilising calcium from the environment) and on excretion it would harden to form simple structures, like shells or “fortresses”.

---

<div class="post-metadata">

### Author: ![Moopli](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/moopli/32/6_2.png) [@Moopli](https://forum.revolutionarygamesstudio.com/u/Moopli)
#### Post date: [February 23, 2016, 1:18am UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/55 "2016-02-23T01:18:13Z")

</div>

Don’t worry about Nick’s example compounds – those are just colour ideas from the elder days, and we have a pretty different compound list now. We’ll probably have about a dozen compounds or so, and a whole bunch of agents, so as long as we have enough textures/colours for them all we should be fine.

There are a bunch of nice ways to procedurally generate colours that are at least a certain distance apart, so we shouldn’t really have any problems colour-wise.

For the rest of the talk about new compounds etc go to another thread 😜

---

<div class="post-metadata">

### Author: ![TheCreator](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/thecreator/32/64_2.png) [@TheCreator](https://forum.revolutionarygamesstudio.com/u/TheCreator)
#### Post date: [February 23, 2016, 5:03pm UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/56 "2016-02-23T17:03:09Z")

</div>

> [@Oliveriver](#):
>
> If you get a chance, could you swap in the background you used for the new editor to see if that makes a difference?

It’s honestly the same background image 🙂 But sure, I’ll dim the brightness. That’s partially what @NickTheNick wanted anyway.

> [@Oliveriver](#):
>
> basically a cell would produce calcium carbonate (utilising calcium from the environment) and on excretion it would harden to form simple structures, like shells or “fortresses”.

Ooo! Like real life corals! I think that would be pretty awesome, but it’ll have to wait until early multicellular.

> [@Moopli](#):
>
> There are a bunch of nice ways to procedurally generate colours that are at least a certain distance apart

I don’t think we should procedurally generate the colors. They should be set in stone so that the player won’t get confused.

> [@Moopli](#):
>
> For the rest of the talk about new compounds etc go to another thread

Well, it’s related to the fluid dynamics, and I don’t think it’s worth it to make a new thread for 2-3 posts, unless you were talking about actually _making up_ new compounds (not their color and texture) and how they will work in game; then yeah, a new thread would be better.

And now for the moment you’ve all been waiting for, a video of compound clouds in action:

[![](https://img.youtube.com/vi/hMoNwnSK-Uo/maxresdefault.jpg "Thrive Compound Clouds - Test 8") ](https://www.youtube.com/watch?v=hMoNwnSK-Uo)

---

<div class="post-metadata">

### Author: ![Moopli](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/moopli/32/6_2.png) [@Moopli](https://forum.revolutionarygamesstudio.com/u/Moopli)
#### Post date: [February 23, 2016, 5:36pm UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/57 "2016-02-23T17:36:39Z")

</div>

> [@TheCreator](#):
>
> I don’t think we should procedurally generate the colors. They should be set in stone so that the player won’t get confused.

Not for the regular compounds, no, but agents would have to have colours chosen procedurally somehow. I think what we could do is make a lattice of colours of constant saturation, each point a certain distance apart, and the agents would pick these colours as they’re generated. Then, the regular compounds would be either substantially more saturated, or substantially less saturated, so it is always pretty clear what’s what. We could even modify the lattice of available agent colours to exclude agent colours too close in hue to the regular compounds, making it even easier to recognize different compounds.

can the fluid sim handle compounds that have a scaled-down response to diffusion/circulation? I’d like to see a test where you have an ‘agent’ that diffuses more slowly and has a bright colour, on a background of clouds of compounds that are more desaturated and spread out.

> [@TheCreator](#):
>
> Well, it’s related to the fluid dynamics, and I don’t think it’s worth it to make a new thread for 2-3 posts, unless you were talking about actually making up new compounds (not their color and texture) and how they will work in game; then yeah, a new thread would be better.

Pretty much, though we have enough compounds that _will_ appear in the game, that we could have a discussion on what colours _they_ can have 😉

---

<div class="post-metadata">

### Author: ![TheCreator](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/thecreator/32/64_2.png) [@TheCreator](https://forum.revolutionarygamesstudio.com/u/TheCreator)
#### Post date: [February 23, 2016, 5:57pm UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/58 "2016-02-23T17:57:42Z")

</div>

> [@Moopli](#):
>
> Then, the regular compounds would be either substantially more saturated, or substantially less saturated, so it is always pretty clear what’s what.

I was thinking they would just have a grainy texture and would be more dense.

> [@Moopli](#):
>
> can the fluid sim handle compounds that have a scaled-down response to diffusion/circulation?

There is a diffusionCoeffision and a vAmp parameter in the function call for diffusion and advection, respectively. Currently, I hard coded them in, but it’s easy to have the compoundCloudsComponent dictate the value.

> [@Moopli](#):
>
> I’d like to see a test where you have an ‘agent’ that diffuses more slowly and has a bright colour, on a background of clouds of compounds that are more desaturated and spread out.

It’s possible, but you’ll have to wait. I’m not going to be working on agents until 0.3.4. What’s more important now is to have bacteria generate the clouds instead of having them get randomly spawned.

---

<div class="post-metadata">

### Author: ![TheCreator](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/thecreator/32/64_2.png) [@TheCreator](https://forum.revolutionarygamesstudio.com/u/TheCreator)
#### Post date: [February 27, 2016, 11:29pm UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/59 "2016-02-27T23:29:02Z")

</div>

Well, this took longer than expected, but I finally managed to allow for multiple compound clouds, as you can see in the image below. I also fixed two game-crashing bugs I accidentally made (oops), and I’m pretty sure that there are more still.

 ![](https://thrivedevforum-uploads.b-cdn.net/original/1X/aee1309848a678bf7f51168b0a1e94ea4d8620cd.png)  
With all that said, I’m going to try to clean up my code, and we can hopefully release in 1 or 2 weeks. **UNLESS** , we want to add more features. Namely, I’m speaking about toxic compound clouds. At the current moment, the non-engulfing predator species is unable to shoot the toxic x’s. We can wait until 0.3.4 to fix that, or I could work on it now. What do you guys think?

---

<div class="post-metadata">

### Author: ![Oliveriver](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/oliveriver/32/1962_2.png) [@Oliveriver](https://forum.revolutionarygamesstudio.com/u/Oliveriver)
#### Post date: [February 28, 2016, 10:47am UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/60 "2016-02-28T10:47:46Z")

</div>

I’d wait a bit before releasing so we can add some extra features as well. Compound clouds are a massive improvement but alone probably don’t quite constitute a whole new release. If we’re going by [this list](http://forum.revolutionarygamesstudio.com/t/future-release-plans/129), there are still a few things to add.

Also, how difficult will it be to have the fluid simulation move the microbes? It doesn’t have to be added now, but eventually we’ll want microbes to float along in the current and only be able to fight against it if they have flagella/cilia.

---

<div class="post-metadata">

### Author: ![TheCreator](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/thecreator/32/64_2.png) [@TheCreator](https://forum.revolutionarygamesstudio.com/u/TheCreator)
#### Post date: [February 29, 2016, 12:43am UTC](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98/61 "2016-02-29T00:43:39Z")

</div>

I’d need to create another system, but it shouldn’t take more than one or two days to implement.

[Previous page](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98.md?page=2)

[Next page](https://forum.revolutionarygamesstudio.com/t/fluid-dynamics-curl-noise/98.md?page=4)
