Fluid Dynamics - Curl Noise


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:

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:

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


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


It was just the graphics program’s default noise map, but if you want it specifically here you go. Any alpha noisemap should work I guess.


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?


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


Oh, oh, oh! Much better:

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:

Which image do you like better?


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


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

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.

  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.


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.

Here it is again in red:

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).


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.


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?

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”.


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 :stuck_out_tongue_winking_eye:


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

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

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

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:


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.

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 :wink:

CPA Master List

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

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.

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.


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.

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?


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, 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.


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


The compound clouds are done.


Once @tjwhale or someone else gives me the finalized list of compounds and their colors, I will merge. The next step would probably be working on fixing the toxins and their accurate ejection.