The day of the lettuce leaf

Today I put the first item (a consumable lettuce leaf) into Gastropoda.

The items

The lettuce leaf was to be the first food item in Gastropoda. However, before I could make the leaf itself I had to make the food system, which I hadn’t yet planned out in great detail. Four new tables were involved:

item_templates is the main one, where every possible item is going to be stored. items is the one that actually records each instance of each item currently owned by a user in the world. item_types defines what kind of item a certain entry in the template is (eg “consumable”, “decorative”, “substrate”, etc). item_nutrition is exclusively used for items of the consumable type (which is why I separated it out into a separate table; it’s not going to be relevant for every item template).

So I created a template for the Lettuce Leaf in item_templates:

Lettuce Leaf item template

Then, I looked up the nutritional information of a lettuce leaf and added an entry for it in the item_nutrition table:

Lettuce Leaf nutrition

The energy here is in Joules and the rest of the measurements are in milligrams.

Next, I created an actual lettuce leaf item in the items table, listing my user as the owner:

Lettuce Leaf item

I put it into jar #2, where all of my snails are currently housed.

There is now also an Item class.

The snail stuff

I had to add a few new attributes to the snails:

I read whatever snail nutrition research papers I could find, but there wasn’t that much about their vitamin requirements so at the moment these are largely based on human RDIs modified for snail weights (with some randomization).

This does mean that I’ll have to update the way I do energy depletion. I have to find out how quickly vitamins are metabolized, and decrease energy by burning down carbs, fat, and protein at appropriate rates.

Item consumed

The other stuff

As I mentioned previously, you can’t really feed a snail individually unless it’s in its own jar (or you’re injecting it, which is a bit extreme). So you place food inside a jar and then any snail in that jar has a chance of taking a bite. Right now it’s random, but there are already some attributes in place which, when hooked up, will increase or decrease the likelihood that the snail will try to eat food - and also that it’ll actually get it when competing with the other snails.

The issue right now is that even though you can see the snails crawling around live on the canvas, and the food when it’s there, you do not see snail actions in real time (yet). So you won’t actually see the snail crawl up to the lettuce to eat it - it’ll all be done in the background and you’ll just see a new event on your snail when it’s consumed something. It’s kind of unsatisfying, since if you’re seeing them crawling around you feel like you should be able to see them also performing various actions. I’ll have to work on this down the line.

Lettuce Leaf in a jar (Obviously it's not being properly positioned yet...)

So basically a snail takes a bite of the lettuce leaf and its nutritional stats are updated based on the item it’s consumed. These will then be used to calculate deficiencies and other effects that the snail’s diet has on its health and performance.

When the lettuce leaf has no bites left, it’s simply deleted.

So that’s the gist of it!

© - 2021 · Liza Shulyayeva ·