I revisited Sumas and Nubas today. Mostly I researched single-celled organisms, though I made some changes to the code as well:
- New color scheme: blue background (“water”), green nubas (“chloroplasts”), tan sumas.
- Elements are drawn more realistically: no black borders, and sumas are ellipses instead of squares.
- When a suma dies, it fades away instead of instantly vanishing.
- Nubas are 1/4 the size, instead of roughly the same size as the sumas, who eat them.
Future goals:
- Add collision detection, so two sumas cannot occupy the same space.
- Refine suma locomotion, so they have to swim toward their food instead of starting and stopping on a dime / instantly changing direction.
- Sumas should asexually reproduce when they’ve eaten enough food, instead of “playing” (spinning in a circle).
- Allow sumas to ‘team up’ into multicellular organisms.
Nice work. These sorts of projects are always fun to play around with.
One thing you can do is have the sumas apply additive “bursts” of velocity (think Asteroid-style controls) that drive them closer to the current location of their desired food. When they’re within a given radius of the food, they can then “lock on” and eat.
Pretty simple, assuming you update the location of the suma’s food for every tick. If you then take this a step further and tie the mechanism that updates their food location to a probability seed that is decided at creation time (say 1 out of 5 ticks for some, and 4 out of 5 for others) you’ve come up with a simple way to have some sumas appear more intelligent than others. The less intelligent sumas would get less food, causing them to theoretically die off and now you’ve got the basis for evolution.
As it turns out, this concept is also useful for rudimentary swarm behavior when applied across multiple axes.