Softbody Motion in the Multicellular


After watching this video I’ve been thinking about how to smoothly move from cell based movement (flagella and cilia etc) to muscle and skeleton based movement. Basically I’ve got as far as planning an algorithm but can’t make a prototype right now as I literally code 40 hours a week now and can’t face doing any more this weekend. Hopefully I’ll get round to it soon. I thought I would post the algorithm incase anyone else is interested in making it themselves.

So basically you put a load of cells in a plane (this would be the multicellular editor) and then some of them become muscle cells, some of them are normal, and some of them are bone.

Each cell is connected to it’s neighbours. Each cell specifies the length it wants that connection to be. If the length is longer or shorter than this the cell puts a force on itself and on the cell it is connected to (equal and opposite) to try and get the connection to be the right length.

So for example two cells are 20 units apart, they both want to be 10 units apart so they pull towards each other until they are 10 units apart.

The force is determined by a function like a*|current length - desired length|^2 where a is a parameter. So this means two difference cells could desire different distances for the connection and the connections would sit somewhere in between these distances. The parameter “a” is determined by the types of cell. So if a bone cell is connected to a bone cell then “a” is very large (meaning that the cells will try very hard to stay the right distance apart). If a bone cell is connected to another type of cell the parameter “a” is smaller and if it’s two non-bone cells then “a” is small (meaning these areas are flexible).

A muscle cell changes it’s desired connection lengths over time like bsin(xt) + c where b is the size of the expansion and contraction, c is the resting length and x is the period. This means it can pulse which will move it’s neighbours closer and further away which will mean the cell will wiggle.

Putting symmetry on the cell and having the left side be out of phase with the right side will get a swimming motion.

You can then calculate the speed of the cell by working out the net motion after one complete cycle, which is something I can talk about in more detail later.

Anyway then you can add more and more bone and muscle until you have a larger creature and we can move to a fully skeletal creature editor. I think this is a nice approach as it’s smooth.

I emailed the guy who made that video and he responded and says he might open source his code soon so that might be really helpful.


I don’t have time to right a full response now, but check out this paper:


This video shows something similar to what you describe, and it’s open source, so it may be useful.
This one is the same on 3D.

Microbe stage objective

Yeah that guys stuff is pretty cool. Similar idea.


So I’ve had a bit of time to work on a prototype for this stuff. I’ve been using this paper and following it closely. Big props to Michał Joachimczak.

This is as far as I’ve got. Code in the prototypes repo.

The algorithm is basically make a Gabriel diagram of the points (which is a subset of a Delaunay triangulation) which I have done. You can place the points (cells) wherever you like and the algorithm will connect them and compute which cells are exterior (blue) or interior (red). It can also compute the interior chambers of the creature (which are pressurised to give something to push off) and compute their volume. The code is pretty terrible even by my standards, but it does work.

However I’m a bit stuck on the physics of it. The paper says they use bullet and I think it might be easier to use an actual physics engine rather than have me try to implement one. If anyone is interested in working on it with me that would be great.

In general I’m thinking (based on the discussions we’ve had so far) the overall process could be something like this.

First you play the multicellular and you get a summoning agent (which causes some other members of your species to flock around with you).

Second you get a bonding agent which causes some of these cells to snap together (maybe 3?)

Third you then play as a multicellular organism but which is still mostly pushed around by flagella and cilia, you can set some jiggling motion up but it won’t help you so much.

Fourth, over time you add more and more cells to the network and their motion becomes more important for your locomotion, the flagella and cillia start to become ineffective.

Fifth you can start to specialise the cells. If you want to make a connection between two cells more rigid than a certain threshold you have to start giving them bone like adaptations. If you want to make the pulsation a cell does more powerful than a certain (low) threshold you have to start giving it muscle like adaptations. Moreover you can adapt other cells for other functions (digestion, reproduction etc but that is rather a separate issue).

Sixth you start to use tissues rather than individual cells and at some point the view goes 3d and you’re in a different editor.

There’s quite a deep question about how ai softbody creatures evolve. Are we going to actually evolve them? (I.e. something along the lines of make 5 adaptations of each creature and then test them and then keep the best one?) Or is there some shortcut to work out what shapes would be good?

All input welcome.

Another Newbie Introduction