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.