Thinking Through Substrate

posted in SnailLife
Published April 04, 2015
Advertisement
After checking in the basic substrate item implementation yesterday I got to thinking - never a good sign.

The original idea was to have some pre-set types of substrate - garden dirt, rock, potting soil, pellets, whatever. But how would these items affect the snails and the jar? Would I need to invent some sort of set of attribute templates? Like "Oh well this garden dirt item is going to decrease jar temperature by 1C." and "Oh well some snails somehow don't like garden dirt and prefer other substrates". But why? Why would a snail prefer one template to another and how would this be decided?

Considering I'm already going for a lot of detail with consumables (making sure consumable items have macro and vitamin attributes based on their real life counterparts), I should maybe do the same thing for substrate. For example, garden dirt isn't just garden dirt...it can contain varying amounts of clay, humus, sand, rock, etc. An item called "Garden Dirt" would really be made up of multiple base elements in varying proportions. And that led me to thinking - while a template called "Garden Dirt" should exist and be available for pre-mixed purchase from the Habitat store, users should also be able to mix these elements themselves. As a user I want to buy my own sand, clay, rocks, whatever, and experiment with proportions of each to create substrates of different moisture, porosity, pH level, etc.

I don't know exactly how this is going to work yet - in fact from this point on I'm kind of making this up as I type. But here's a quick overview of how consumable items already work.

The database has the following item-related tables (with the specified columns):

item_types


  • typeID
  • name

item_templates


  • templateID
  • typeID
  • luminance
  • temperature
  • roughness
  • description
  • enduranceMod
  • speedMod
  • aggressionMod
  • modDurationMins
  • weightG
  • bites
  • baseDaysToRot
  • imageName
  • imageSubdir
  • rarity
  • basePrice
  • priorityLayer
  • pingsJar
  • isApplied

item_nutrition


  • templateID
  • carbohydrates
  • sugar
  • fat
  • protein
  • vitA
  • vitC
  • vitD
  • vitB6
  • vitB12
  • calcium
  • iron
  • magnesium

items


  • itemID
  • templateID
  • ownerID
  • jarID
  • deleted
  • bitesTaken
  • posX
  • posY

I suspect that I will need another table on the same "level" as [font='courier new']item_nutrition[/font]. Something like [font='courier new']item_terrain_elements[/font]...or something. It would contain the following columns (or something like this):

item_terrain_elements


  • templateID
  • pH
  • porosity
  • carbon (primary nutrient)
  • hydrogen (primary nutrient)
  • oxygen (primary nutrient)
  • nitrogen (primary macronutrient)
  • phosphorus (primary macronutrient)
  • potassium (primary macronutrient)
  • calcium (primary macronutrient)
  • magnesium (primary macronutrient)
  • sulfur (primary macronutrient)
  • iron (primary micronutrient)
  • manganese (primary micronutrient)
  • boron (primary micronutrient)
  • copper (primary micronutrient)
  • zinc (primary micronutrient)
  • molybdenum (primary micronutrient)
  • chloride (primary micronutrient)
  • nickel (primary micronutrient)
  • iodine (other)
  • fluorine (other)
  • selenium (other)
  • cobalt (other)
  • arsenic (other)
  • lithium (other)
  • chromium (other)
  • silicon (other)
  • tin (other)
  • vanadium (other)

The primary nutrients would affect plant growth and the "other" nutrients could affect the animals (ie snails) within the jar.

And looking at the above just now, I don't see a reason not to just add the above nutrients to the [font='courier new']item_nutrition[/font] table. Some of the columns (eg magnesium) would already be duplicates anyway...I could maybe just add the above columns to the nutrition table and set anything irrelevant to '0'...would there be something wrong with this? I don't know, I have to think.I wish somebody who actually knew what they were doing and wasn't making all this up as they went along could provide a second opinion.
Previous Entry Jar Substrate Is a Go
1 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement