I’ve written about snail breeding here before, at length. However, since I now want snail behavior to go through the brain I had to rework the trigger that led to two snails mating and producing offspring. A few different things had to be prototyped to make this work, especially because in a snail’s mind there is no real way of distinguishing food from another snail without learning from experience and some basic instincts to guide the way.
When I started, snails tried to mate with lettuce leaves. Technically possible, but they should learn that this is a little…ineffective.
Crap, a snail just tried to mate with a lettuce leaf.
— Liza Shulyayeva (@Lazer) October 11, 2014
Then, the snails just kept overshooting each other when trying to approach. Approaching inanimate objects is easy - they don’t move. However, one snail kept targeting the other snail’s current position, and vice versa, and they ended up in the wrong spot. The solution (for now) was to have each snail target the other snail’s target position. This is kind of dumb, because of course the Snail A can’t read minds and see where Snail B is going, so I’ll have to find a non-hacky better way of doing it by basically seeing if the two snails will cross paths on their way to one another and meet each other in the middle instead.
The snails are trying to approach each other, but keep overshooting.
— Liza Shulyayeva (@Lazer) October 11, 2014
I feel like one of those matchmakers who keep trying to bring people together, but the people are dumb and keep doing stupid crap.
— Liza Shulyayeva (@Lazer) October 11, 2014
Anyway, then the snails did reach each other but started biting each other as if the other snail was a food item. This resulted in one snail becoming deathly afraid of the other one and trying to run away (and sometimes biting back). Basically the two snails grew to despise each other and want nothing more than to go in opposite directions.
Oh great, now they got to each other and for some reason one got scared and is trying to run away. BREED ALREADY.
— Liza Shulyayeva (@Lazer) October 11, 2014
Then they stopped eating.
Somehow one of the snails has developed an aversion to food. This is infuriating. I just want snail eggs.
— Liza Shulyayeva (@Lazer) October 11, 2014
Then I created scent signatures for other snails and items. Right now this basically just shows an object’s highest macro or fertility rate. This is placeholder, but now snails can “smell” other fertile objects nearby. In the future they’ll also be able to get hungry for certain macros and favor food items which smell more like the thing they’re hungry for.
I also made a sex drive and food drive, so a snail might try to bite an object instead of mating with it if it smells like carbs and its food drive is higher than its sex drive. This can also be used for the snail’s decision about which object it wants to approach (so, we can use this to apply higher weights to certain inputs).
Then I realized there was no good way to test this efficiently without making it easy to move snails around within the jar (without having to go and change positions in the db each time). This way I could place snails next to the objects I wanted them to interact with or detect easier.
Couldn’t test snail behaviour properly/efficiently without being able to easily move snails around, so made a snail drag/drop feature in jar
— Liza Shulyayeva (@Lazer) October 14, 2014
And then…then…well, this happened:
It’s..it’s…happening! pic.twitter.com/FbonFeeRmk
— Liza Shulyayeva (@Lazer) October 14, 2014
Oh crap they won’t stop breeding
— Liza Shulyayeva (@Lazer) October 14, 2014
(Obviously I need to have them get tired and/or have their sex drive go down after they mate)
What have I done?! They won’t stop! pic.twitter.com/Z7eBK68lvY
— Liza Shulyayeva (@Lazer) October 14, 2014
I guess the good news is I can now drag one away from the other so they can’t reach.
— Liza Shulyayeva (@Lazer) October 14, 2014
Got back from eating cheese to see they found each other and are back at it. They can’t be in the same jar pic.twitter.com/IWujhc5eEu
— Liza Shulyayeva (@Lazer) October 14, 2014
Oh god all the eggs. pic.twitter.com/jVHrk2CNdS
— Liza Shulyayeva (@Lazer) October 14, 2014
The eggs don’t hatch until tomorrow…and I’m both curious and terrified of what will happen then, because I do not yet have a minimum maturity rate for snail breeding.