Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Thinking Through Substrate

Sign in to follow this  
Liza Shulyayeva


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):


  • typeID
  • name


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


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


        • 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):


          • 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.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!