
function MakeFrogVariant (addInfo, score, seasons)

	critterGroup = dbCritterGroup("frog_group" .. addInfo)
	critterGroup.CritterSubInfo = addInfo
	critterGroup.CritterClass = "Proteus.World.Frog"
	critterGroup.DrawDistance = 10
	critterGroup:SetSeasons(seasons)
	critterGroup.MaxAltitude = 3.25
	critterGroup.MinAltitude = 0.1
	critterGroup.PlacementScore = score
	critterGroup:SetSoilAffs("1,0  1,0  1,1  1,1  1")
	critterGroup.ColorName = "creature_frog" .. addInfo
	AddItem(critterGroup)

end

function MakeSquirrelVariant(addInfo, placeScore, maxInstances, color, appearsInWinter)
	critterGroup = dbCritterGroup("squirrel" .. addInfo)
	critterGroup.CritterClass = "Proteus.World.Squirrel"
	critterGroup.CritterSubInfo = addInfo
	critterGroup:SetCount(1)
	critterGroup.DrawDistance = 10
	if appearsInWinter then
		critterGroup:SetSeasons("summer;autumn;winter")
	else
		critterGroup:SetSeasons("summer")
	end
	critterGroup.MaxAltitude = 5
	critterGroup.MinAltitude = 0.2
	critterGroup:SetSoilAffs("1,1  1,1  1,1  1,1  1")
	critterGroup.PlacementScore = placeScore
	critterGroup:SetTreeAffinities("scots_pine;hawthorn;oak;spruce") -- spruce scots_pine hawthorn oak
	critterGroup.RequiresTree = true
	critterGroup.MaxInstances = maxInstances
	critterGroup.ColorName = color
	AddItem(critterGroup)
end

function MakeQuailVariant(addInfo, placeScore, maxInstances, color)
	critterGroup = dbCritterGroup("quail_flock" .. addInfo)
	critterGroup.CritterSubInfo = addInfo
	critterGroup.CritterClass = "Proteus.World.Quail"
	critterGroup:SetCount(9)
	critterGroup.DrawDistance = 10
	critterGroup:SetSeasons("spring;summer")
	critterGroup.MaxAltitude = 5
	critterGroup.MinAltitude = 0.2
	critterGroup:SetSoilAffs("1,1  1,1  1,1  1,1  1")
	critterGroup.PlacementScore = placeScore
	critterGroup:SetTreeAffinities("scots_pine;hawthorn;oak;spruce") -- spruce scots_pine hawthorn oak
	critterGroup.RequiresTree = true
	critterGroup.MaxInstances = maxInstances
	critterGroup.ColorName = color
	AddItem(critterGroup)
end

GRASS_DRAW_DIST = 20

-- World Database Initialisation file

trunkdat_Apple 			= PgTrunkInitData("trunks.png", Vector2i(32,64), Size(32,64), 3, 1, 0.5, 1.0, 0.25, "trunk_MidBrown")
trunkdat_ShortGnarled 	= PgTrunkInitData("trunks.png", Vector2i(32,0), Size(32,64), 3, 1, 0.5, 1.0, 0.25, "trunk_DarkGrey")
trunkdat_TallGrey 		= PgTrunkInitData("trunks.png", Vector2i(0,0), Size(32,128), 3, 1, 0.25, 1.5, 0.25, "trunk_MidGrey")
trunkdat_NotSpruce 	  = PgTrunkInitData("trunks.png", Vector2i(64,0), Size(32,64), 3, 1, 0.5, 1.0, 0.25, "trunk_MidBrown")
trunkdat_LargeSpreading	= PgTrunkInitData("trunks.png", Vector2i(64,64), Size(64,64), 3, 1, 1.0, 1.0, 0.25, "trunk_MidBrown")
trunkdat_Swampy 		= PgTrunkInitData("trunks.png", Vector2i(0,0), Size(32,128), 3, 1, 0.25, 1.0, 0.25, "trunk_MidBrown")
trunkdat_Fruit 		= PgTrunkInitData("trunks.png", Vector2i(0,0), Size(32,128), 3, 1, 0.25, 1.0, 0.25, "trunk_Fruit")

foliage_Fluffy 			= AnimInitData("foliage", Size(32, 32), 0, 0, 4, true);
foliage_Spiky 			= AnimInitData("foliage", Size(32, 32), 0, 1, 4, true);
foliage_Weeping			= AnimInitData("foliage", Size(32, 32), 0, 2, 4, true);
foliage_Bare 			= AnimInitData("foliage", Size(32, 32), 0, 3, 4, true);

--------------------------------------------------------------------------------------------
--- Objects
--------------------------------------------------------------------------------------------

-- oak tree (dead)
item = dbTree("bogTree")
item.PgTrunkInitData = trunkdat_Swampy
item.FoliageSprites = foliage_Weeping
item.BareCanopySprites = foliage_Bare
item.LosesLeavesInWinter = true
item.FoliageCentreHeight = 0.5
item.FoliageCentreHeightVariation = 0.1
item.FoliageMinRad = 0.25
item.FoliageMaxRad = 0.5
item.FoliageHeightVariation = 0.1
item.FoliageCount = 7
item.HeightCompetitionScalar = 0.3
item.ShedsLeaves = true
item:AddFoliageColourOption("fol_Oak3")
item:SetSoilAffs("1,0  1,1  1,1  1,0  0.5")
AddItem(item)

-- oak tree
item = dbTree("oak") 
item.PgTrunkInitData = trunkdat_ShortGnarled
item.FoliageSprites = foliage_Fluffy
item.BareCanopySprites = foliage_Bare
item.LosesLeavesInWinter = true
item.FoliageCentreHeight = 0.5
item.FoliageCentreHeightVariation = 0.1
item.FoliageMinRad = 0.25
item.FoliageMaxRad = 0.5
item.FoliageHeightVariation = 0.1
item.FoliageCount = 7
item.HeightCompetitionScalar = 0.5
item.ShedsLeaves = true
item:AddFoliageColourOption("fol_Oak1")
item:AddFoliageColourOption("fol_Oak2")
item:AddFoliageColourOption("fol_Oak3")
item:SetSoilAffs("1,1  1,1  1,1  1,0  1")
AddItem(item)

giantFolCol = "fol_Oak2";
giantTrunkCol = "trunk_DarkGrey";

-- oak tree - GIANT
item = dbTree("oak_giant")
item.PgTrunkInitData = PgTrunkInitData("trunksGiant.png", Vector2i(0,0), Size(128,128), 5, 2, 0.95, 2.0, 0.25, giantTrunkCol)
item.PgTrunkInitData:SetLimbs("trunksGiant.png", Vector2i(0,2), Size(64,64), 4, 5, 2.0, 2.5)
item.PgTrunkInitData:SetGroundPrint(2,4,1,32)
item.FoliageSprites = AnimInitData("foliageGiant", Size(128, 128), 0, 0, 2, true)
item.BareCanopySprites = AnimInitData("foliageGiant", Size(128, 128), 0, 1, 2, true)
item.LosesLeavesInWinter = true
item.FoliageCentreHeight = 2.0
item.FoliageCentreHeightVariation = 0.1
item.FoliageMinRad = 1.35
item.FoliageMaxRad = 1.45
item.FoliageHeightVariation = 0.1
item.FoliageCount = 7
--item.FoliageScale = 0.7
item.ShedsLeaves = true
item.IsGiant = true
item:AddFoliageColourOption(giantFolCol)
item.CollisionRadius = 0.95
item.BlocksRoads = true
AddItem(item)

-- giant tree outlying thing
for n = 1,3
do

item = dbTree("oak_giant_outlier" .. n)
item.PgTrunkInitData = PgTrunkInitData("trunks.png", Vector2i(32,0), Size(32,64), 3, 1, 0.65, 2.55, 0.25, giantTrunkCol)
--item.PgTrunkInitData = trunkdat_ShortGnarled
item.FoliageSprites = foliage_Fluffy
item.BareCanopySprites = foliage_Bare
item.LosesLeavesInWinter = true
item.FoliageScale = 3
item.FoliageCentreHeight = 1.6
item.FoliageCentreHeightVariation = 0.1
item.FoliageMinRad = 0.25
item.FoliageMaxRad = 0.5
item.FoliageHeightVariation = 0.1
item.FoliageCount = 7
item.HeightCompetitionScalar = 0.5
item.ShedsLeaves = true
item:AddFoliageColourOption(giantFolCol)
item.BlocksRoads = true
AddItem(item)

end

-- weird stumps

item = dbTree("weirdStump1")
item.PgTrunkInitData = PgTrunkInitData("trunksGiant.png", Vector2i(0,192), Size(32,64), 3, 4, 0.25, 1.0, 0.1, "trunk_DarkGrey")
AddItem(item)

item = dbTree("weirdStump2")
item.PgTrunkInitData = PgTrunkInitData("trunksGiant.png", Vector2i(128,192), Size(32,64), 3, 2, 0.25, 1.0, 0.1, "trunk_DarkGrey")
AddItem(item)

item = dbTree("weirdStump3")
item.PgTrunkInitData = PgTrunkInitData("trunksGiant.png", Vector2i(192,192), Size(32,64), 3, 2, 0.25, 1.0, 0.1, "trunk_DarkGrey")
AddItem(item)

-- scots pine tree
item = dbTree("scots_pine")
item.PgTrunkInitData = trunkdat_TallGrey
item.FoliageSprites = foliage_Spiky
item.BareCanopySprites = foliage_Bare
item.LosesLeavesInWinter = true
item.ShedsLeaves = true
item.FoliageCentreHeight = 1.24
item.FoliageCentreHeightVariation = 0.0
item.FoliageMinRad = 0.2
item.FoliageMaxRad = 0.3
item.FoliageHeightVariation = 0.1
item.FoliageCount = 7
item.HeightCompetitionScalar = 0.1
item:AddFoliageColourOption("fol_DarkPine1")
item:AddFoliageColourOption("fol_DarkPine2")
item:AddFoliageColourOption("fol_DarkPine3")
item:SetSoilAffs("0,1  1,1  1,1  1,0  1")
AddItem(item)

-- christmas tree
item = dbTree("xmasTree")
item.PgTrunkInitData = PgTrunkInitData("conifers.png", Vector2i(0,0), Size(64,96), 2, 1, 0.66, 1.5, 0.02, "fol_Xmas")
item.PgTrunkInitData:SetGroundPrint(-1,-1,-1,-1)
--item:SetSoilAffs("0,1  1,1  1,1  1,1  1")
AddItem(item)

-- christmas tree
item = dbTree("spruce")
item.PgTrunkInitData = trunkdat_NotSpruce --PgTrunkInitData("trees.png", Vector2i(0,0), Size(64,96), 2, 1, 0.66, 1.5, 0.02, "fol_Spruce")
item.FoliageSprites = foliage_Spiky
item.BareCanopySprites = foliage_Bare
item:AddFoliageColourOption("fol_Spruce")
item.FoliageCentreHeight = 0.4
item.FoliageCentreHeightVariation = 0.0
item.FoliageMinRad = 0.15
item.FoliageMaxRad = 0.25
item.FoliageHeightVariation = 0.1
item.FoliageCount = 5
item.HeightCompetitionScalar = 0.5
item:SetSoilAffs("0,1  1,1  1,1  1,1  1")
item.ShedsLeaves = true
AddItem(item)

item = dbTree("hawthorn")
item.PgTrunkInitData = trunkdat_Apple
item.FoliageSprites = foliage_Fluffy
item.BareCanopySprites = foliage_Bare
item.LosesLeavesInWinter = true
item.FoliageCentreHeight = 0.5
item.FoliageCentreHeightVariation = 0.1
item.FoliageMinRad = 0.2
item.FoliageMaxRad = 0.3
item.FoliageHeightVariation = 0.1
item.FoliageCount = 7
item.HeightCompetitionScalar = 0.5
item.ShedsLeaves = true
item.ShedsBlossom = true
item:AddFoliageColourOption("fol_Yellowish")
item:SetSoilAffs("0,1  1,1  1,1  1,0  1")
AddItem(item)


item = dbTree("hawthorn2")
item.PgTrunkInitData = trunkdat_Fruit
item.FoliageSprites = foliage_Fluffy
item.BareCanopySprites = foliage_Bare
item.LosesLeavesInWinter = true
item.FoliageCentreHeight = 0.5
item.FoliageCentreHeightVariation = 0.1
item.FoliageMinRad = 0.2
item.FoliageMaxRad = 0.3
item.FoliageHeightVariation = 0.1
item.FoliageCount = 7
item.HeightCompetitionScalar = 0.5
item.ShedsLeaves = true
item.ShedsBlossom = true
item:AddFoliageColourOption("fol_Blossom2")
item:SetSoilAffs("0,1  1,1  1,1  1,0 0.5")
AddItem(item)

item = dbTree("hawthorn3")
item.PgTrunkInitData = trunkdat_Fruit
item.FoliageSprites = foliage_Fluffy
item.BareCanopySprites = foliage_Bare
item.LosesLeavesInWinter = true
item.FoliageCentreHeight = 0.5
item.FoliageCentreHeightVariation = 0.1
item.FoliageMinRad = 0.2
item.FoliageMaxRad = 0.3
item.FoliageHeightVariation = 0.1
item.FoliageCount = 7
item.HeightCompetitionScalar = 0.5
item.ShedsLeaves = true
item.ShedsBlossom = true
item:AddFoliageColourOption("fol_Blossom3")
item:SetSoilAffs("0,1  1,1  1,1  1,0 0.5")
AddItem(item)


------------------------------

item = dbHerb("xmasPresents")
item.StemSprite = AnimInitData("herbs", 16, 0, 12, 4, true)
item.DrawDistance = GRASS_DRAW_DIST
--item.ColorName = "plant_magicred"
--item.SoundCue = item.Name
item:SetSeasons("winter")
item.Density = 11
AddItem(item)


item = dbHerb("uniqueflower")
item.StemSprite = AnimInitData("herbs", 16, 0, 4, 4, true)
item.DrawDistance = GRASS_DRAW_DIST
item.ColorName = "plant_magicred"
--item.SoundCue = item.Name
item:SetSeasons("autumn")
item.Density = 11
AddItem(item)

item = dbHerb("uniqueflower_grave")
item.StemSprite = AnimInitData("herbs", 16, 0, 4, 4, true)
item.DrawDistance = GRASS_DRAW_DIST
item.ColorName = "plant_magicred"
--item.SoundCue = "melancholy2"
item:SetSeasons("autumn")
item.GrowsInClumps = true
item.ClumpRadius = 0.5
item.Density = 15
AddItem(item)


item = dbHerb("dandelion")
item:SetSeasonSprites(AnimInitData("herbs", Size(16,16), 0, 3, 4, true), 
					  AnimInitData("herbs", Size(16,16), 0, 2, 4, true), 
					  AnimInitData("herbs", Size(16,16), 0, 6, 4, true), nil)
item.DrawDistance = GRASS_DRAW_DIST
item.ColorName = "plant_yellowflower"
item:SetSeasons("spring;summer;autumn")
item:SetSoilAffs("0,1  1,1  1,1  1,0  1")
item:SetTreeAffs(1,0.4)
item.InhibitsTrees = true
item.SoundCue = "dandelions"
item:SetNectar(1,1,0,0)
AddItem(item)

item = dbHerb("willowherb")
--item.StemSprite = 
item:SetSeasonSprites(AnimInitData("herbs", Size(16,16), 8, 5, 4, true), 
					  AnimInitData("herbs", Size(16,32), 8, 3, 4, true), 
					  AnimInitData("herbs", Size(16,32), 12, 3, 4, true), nil)
item.DrawDistance = GRASS_DRAW_DIST * 2
item.ColorName = "plant_willowherb"
item.SoundCue = item.Name
item.GrowsInClumps = true
item.ClumpRadius = 0.5
item.Density = 10
item:SetSoilAffs("1,1  0,1  1,1  1,0  1")
item:SetTreeAffs(1,0)
item.InhibitsTrees = true
item:SetNectar(0,1,0,0)
AddItem(item)

item = dbHerb("bracken")
item.StemSprite = AnimInitData("herbs", Size(16, 32), 4, 3, 4, true)
item.DrawDistance = GRASS_DRAW_DIST
item.ColorName = "plant_bracken"
item.HalfUnderground = true
item:SetSoilAffs("1,1  1,0.5  1,1  0.5,1  1")
item:SetTreeAffs(1,1)
item.InhibitsTrees = true
AddItem(item)

-- mossy lump
item = dbHerb("mossLump")
item.StemSprite = AnimInitData("herbs", Size(16, 32), 4, 0, 4, true)
item.DrawDistance = GRASS_DRAW_DIST
item.ColorName = "plant_moss"
item.HalfUnderground = true
item:SetSoilAffs("1,1  1,0.5  1,1  0.5,1  1")
item:SetTreeAffs(1,1)
item.InhibitsTrees = false
AddItem(item)

-- bluebell
item = dbHerb("bluebell")
item:SetSeasonSprites(AnimInitData("herbs", 16, 0, 1, 4, true), 
					  AnimInitData("herbs", 16, 0, 1, 4, true), 
					  AnimInitData("herbs", 16, 0, 5, 4, true), nil)
item.DrawDistance = GRASS_DRAW_DIST
item.ColorName = "plant_blueflower"
item:SetSeasons("spring;summer")
item.GrowsInClumps = true
item.ClumpRadius = 0.5
item.Density = 3
item:SetSoilAffs("0,1  1,1  1,1  1,0  1")
item:SetTreeAffs(0.6,1)
item.InhibitsTrees = false
item.SoundCue = item.Name
item:SetNectarBySeasons()
AddItem(item)

item = dbHerb("anemone")
item.StemSprite = AnimInitData("herbs", 16, 4, 2, 4, true)
item.SoundCue = item.Name
item.DrawDistance = GRASS_DRAW_DIST
item:SetSeasons("spring;summer")
item.ColorName = "plant_cranberry"
item.GrowsInClumps = true
item.ClumpRadius = 0.35
item:SetSoilAffs("0.75,1  1,1  1,1  1,0  1")
item:SetTreeAffs(0.5,1)
item.InhibitsTrees = false
item:SetNectarBySeasons()
AddItem(item)

item = dbHerb("chanterelle")
item.StemSprite = AnimInitData("herbs", 16, 4, 5, 4, true)
item.DrawDistance = GRASS_DRAW_DIST
item:SetSeasons("autumn")
item.ColorName = "plant_chanterelle"
item.GrowsInClumps = true
item.ClumpRadius = 0.25
item.Density = 5
item:SetSoilAffs("0,1  1,1  1,1  1,0  1")
item:SetTreeAffs(0,1)
item.InhibitsTrees = false
item.SoundCue = item.Name
AddItem(item)

-- foxfire
item = dbHerb("foxfire")
item.StemSprite = AnimInitData("herbs", 16, 0, 1, 4, true)
item.TrampledSprite = AnimInitData("herbs", 16, 0, 0, 4, true)
item.DrawDistance = GRASS_DRAW_DIST
item.ColorName = "plant_greennoctilucent"
item:SetSeasons("autumn")
item:SetSoilAffs("1,1  1,1  1,1  1,0  1")
item:SetTreeAffs(0,1)
item.InhibitsTrees = false
item.SoundCue = item.Name
AddItem(item)

item = dbHerb("reed")
item:SetSeasonSprites(AnimInitData("herbs", 16, 8, 0, 4, true), 
					  AnimInitData("herbs", 16, 8, 1, 4, true), 
					  AnimInitData("herbs", 16, 8, 1, 4, true), 
					  AnimInitData("herbs", 16, 8, 2, 4, true))
item.ColorName = "plant_bullrush"
item.SoundCue = item.Name
item.DrawDistance = GRASS_DRAW_DIST
item.GrowsInClumps = true
item.ClumpRadius = 0.5
item.Density = 9
item:SetSoilAffs("1,0  1,0.5  1,1  0.5,1  1")
item:SetTreeAffs(1,1)
item.InhibitsTrees = false
AddItem(item)

item = dbHerb("bogberries")
item:SetSeasonSprites(nil, 
					  AnimInitData("herbs", 16, 8, 3, 4, true), 
					  AnimInitData("herbs", 16, 8, 4, 4, true), 
					  nil)
item.ColorName = "plant_cranberry"
item.SoundCue = item.Name
item.DrawDistance = GRASS_DRAW_DIST
item.GrowsInClumps = true
item.ClumpRadius = 0.25
item:SetSeasons("summer;autumn")
item.Density = 5
item:SetSoilAffs("1,0  1,0.5  1,1  0.5,1  1")
item:SetTreeAffs(1,1)
item.InhibitsTrees = false
item:SetNectar(0,1,0,0)
AddItem(item)

item = dbHerb("pimpernel")
item:SetSeasonSprites(nil, 
					  AnimInitData("herbs", 16, 0, 3, 4, true), 
					  nil, --AnimInitData("herbs", 16, 8, 4, 4, true), 
					  nil)
item.ColorName = "plant_pimpernel"
item.SoundCue = item.Name
item.DrawDistance = GRASS_DRAW_DIST
--item.GrowsInClumps = true
--item.ClumpRadius = 0.25
item.NumOffspring = 1;
item:SetSeasons("summer")
item.Density = 3
item:SetSoilAffs("0,1  1,1  1,1  1,0  0.1")
item:SetTreeAffs(1,0.4)
item.InhibitsTrees = true
item.LimitedSpread = 0.5
item:SetNectar(0,1,0,0)
AddItem(item)

item = dbHerb("uplandSpike")
item:SetSeasonSprites(AnimInitData("herbs", Size(16,16), 8, 9, 4, true), 
					  AnimInitData("herbs", Size(16,32), 8, 5, 4, true), 
					  AnimInitData("herbs", Size(16,32), 12, 5, 4, true), nil)
item.DrawDistance = GRASS_DRAW_DIST
item.ColorName = "plant_cranberry"
item:SetSoilAffs("0,1  1,0.5  1,1  0,1  1.1")
item.Density = 4
item.GrowsInClumps = true
item.ClumpRadius = 0.05
item.LimitedSpread = 0.05
item:SetTreeAffs(1,1)
item.InhibitsTrees = false
--AddItem(item)

item = dbHerb("seaweed")
item:SetSeasonSprites(AnimInitData("herbs", Size(16,16), 4, 8, 4, true), 
					  AnimInitData("herbs", Size(16,16), 4, 8, 4, true), 
					  AnimInitData("herbs", Size(16,16), 4, 8, 4, true), 
					  AnimInitData("herbs", Size(16,16), 4, 9, 4, true))
item.ColorName = "plant_seaweed"
--item.SoundCue = item.Name
item.DrawDistance = GRASS_DRAW_DIST
item.GrowsInClumps = true
item.ClumpRadius = 0.25
--item:SetSeasons("summer;autumn")
item.Density = 5
item:SetSpecficTerrainAffs("beach")
item:SetTreeAffs(1,1)
item.InhibitsTrees = false
item.UseInScatterStep = false
AddItem(item)

------------------------------


-- log cabin
item = dbBuilding("logCabin")
item.Model = "resources/models/LogCabin.obj"
item.CollisionRadius = 0.8
item.BlocksRoads = true
item.SoundCue = "village"
item:SetSpecial("Home")
AddItem(item)

-- -- Post Office
-- item = dbBuilding("townPostOffice")
-- item.Billboard = AnimInitData("newtownobjects", Size(16, 64), 3, 1, 1, true)
-- item.CollisionRadius = 0.7
-- item.BlocksRoads = true
-- AddItem(item)

-- --
-- item = dbBuilding("townBuildingH")
-- item.Billboard = AnimInitData("newtownobjects", Size(16, 64), 3, 0, 1, true)
-- item.CollisionRadius = 0.7
-- item.BlocksRoads = true
-- AddItem(item)

--
item = dbBuilding("ghosttower")
--item.Billboard = AnimInitData("newtownobjects", Size(16, 64), 3, 1, 1, true)
item.CollisionRadius = 0.7
item.ColorName = "built_Tower"
item.BlocksRoads = true
item.SoundCue = "tower"
item:SetSpecial("TownBlock")
AddItem(item)

-- route marker
item = dbBuilding("townSign")
item.Billboard = AnimInitData("glyphs", Size(32,32), 0, 1, 1, true);
item.CollisionRadius = 0.1
item:SetSpecial("Signpost")
AddItem(item)

-- statues/gravestones
item = dbBuilding("grave")
item.ColorName = "built_Tower"
item.BlocksRoads = true
item.CollisionRadius = 0.2
item:SetSpecial("Memorial")
AddItem(item)

item = dbBuilding("spiritStatue")
item.ColorName = "built_Tower"
item.BlocksRoads = true
item.CollisionRadius = 0.2
item:SetSpecial("SpiritStatue")
AddItem(item)

item = dbBuilding("bonfire")
item.BlocksRoads = true
item.ColorName = "trunk_DarkGrey"
item.CollisionRadius = 0.5
item:SetSpecial("Bonfire")
AddItem(item)


-- standing stones (number of variants)
for n = 1,7
do
	item = dbBuilding("stone" .. n)
	item.Model = "resources/models/stone" .. n .. ".obj"
	item.ColorName = "terr_bare2"
	item.BlocksRoads = true
	item.CollisionRadius = 0.2
	item:SetSpecial("SeasonGateClue")
	AddItem(item)
end

item = dbBuilding("stoneX")
item.CollisionRadius = 0
item:SetSpecial("SeasonGate")
item.BlocksRoads = true
AddItem(item)

-- astronomic architectures
item = dbBuilding("archHalf")
item.Model = "resources/models/archHalf.obj"
item.ColorName = "built_Tower"
item.BlocksRoads = true
AddItem(item)

item = dbBuilding("gnomon")
item.Model = "resources/models/gnomon.obj"
item.ColorName = "built_Tower"
item.BlocksRoads = true
AddItem(item)

------------------------------


critterGroup = dbCritterGroup("tuneworm_nest1")
critterGroup.CritterClass = "Proteus.World.TuneWorm"
critterGroup.CritterSubInfo = "wormcritter"
critterGroup:SetCount(5,9)
critterGroup.SongType = 0
critterGroup.DrawDistance = 20
critterGroup:SetSeasons("spring;summer")
critterGroup.MaxAltitude = 1000
critterGroup.MinAltitude = 0.2
critterGroup.PlacementScore = 0.3
--critterGroup:SetHerbAffinities("") -- dandelion bluebell foxfire bracken mossLump
--critterGroup:SetTreeAffinities("") -- spruce scots_pine hawthorn oak
--critterGroup:SetTerrains("grass") -- bare ocean beach grass highland snow
critterGroup:SetSoilAffs("0,1  1,1  1,1  1,0  1")
critterGroup.ColorName = "creature_worm1"
AddItem(critterGroup)

critterGroup = dbCritterGroup("tuneworm_nest2")
critterGroup.CritterClass = "Proteus.World.TuneWorm"
critterGroup.CritterSubInfo = "wormcritter2"   -- The "pincer" type
--critterGroup.NestLoopSoundCue = "metal critter loop"
critterGroup:SetCount(4,7)
critterGroup.SongType = 3
critterGroup.SongRhythm = 2
critterGroup.DrawDistance = 20
critterGroup:SetSeasons("summer")
critterGroup.MaxAltitude = 1000
critterGroup.MinAltitude = 0.2
critterGroup.PlacementScore = 0.3
--critterGroup:SetHerbAffinities("") -- dandelion bluebell foxfire bracken mossLump
--critterGroup:SetTreeAffinities("") -- spruce scots_pine hawthorn oak
--critterGroup:SetTerrains("grass") -- bare ocean beach grass highland snow
critterGroup:SetSoilAffs("0,1  1,1  1,1  1,0  1")
critterGroup.ColorName = "creature_worm2"
AddItem(critterGroup)

critterGroup = dbCritterGroup("tuneworm_nest3")
critterGroup.CritterClass = "Proteus.World.TuneWorm"
critterGroup.CritterSubInfo = "wormcritter3"
critterGroup:SetCount(5,9)
critterGroup.SongType = 2
critterGroup.DrawDistance = 20
critterGroup:SetSeasons("spring;summer;autumn")
critterGroup.MaxAltitude = 1000
critterGroup.MinAltitude = 0.2
critterGroup.PlacementScore = 0.3
--critterGroup:SetHerbAffinities("bracken;mossLump") -- dandelion bluebell foxfire bracken mossLump
--critterGroup:SetTreeAffinities("") -- spruce scots_pine hawthorn oak
--critterGroup:SetTerrains("highland") -- bare ocean beach grass highland snow
critterGroup:SetSoilAffs("1,0  1,1  1,1  1,1  1")
critterGroup.ColorName = "creature_worm3"
AddItem(critterGroup)

critterGroup = dbCritterGroup("tuneworm_nest4")
critterGroup.CritterClass = "Proteus.World.TuneWorm"
critterGroup.CritterSubInfo = "wormcritter"
critterGroup:SetCount(5,9)
critterGroup.SongType = 1
critterGroup.DrawDistance = 20
critterGroup:SetSeasons("autumn")
critterGroup.MaxAltitude = 1000
critterGroup.MinAltitude = 0.2
critterGroup.PlacementScore = 0.6
critterGroup:SetSoilAffs("0,1  1,1  1,1  0,1  1")
--critterGroup:SetTerrains("grass") -- bare ocean beach grass highland snow
critterGroup.ColorName = "creature_worm4"
AddItem(critterGroup)

critterGroup = dbCritterGroup("flashbug_swarm")
critterGroup.CritterClass = "Proteus.World.FlashBug"
critterGroup.CritterSubInfo = "sand"
critterGroup:SetCount(10,20)
critterGroup.DrawDistance = 10
critterGroup.SoundCueName = "firefly"--"insect"--
critterGroup:SetSeasons("spring;summer") -- not autumn, as the "ghost dust" takes their place
critterGroup.MaxAltitude = 1000
critterGroup.MinAltitude = 0.2
critterGroup.PlacementScore = 2
--critterGroup:SetHerbAffinities("") -- dandelion bluebell foxfire bracken mossLump
critterGroup:SetTreeAffinities("spruce;scots_pine;hawthorn;oak")
critterGroup:SetSoilAffs("1,1  1,1  1,1  1,1  1")
--critterGroup:SetTerrains("") -- bare ocean beach grass highland snow
critterGroup.ColorName = "creature_flashbug"
AddItem(critterGroup)

critterGroup = dbCritterGroup("cricket_group")
critterGroup.CritterClass = "Proteus.World.Cricket"
critterGroup:SetCount(5)
critterGroup.DrawDistance = 10
critterGroup.SoundCueName = "cricket"--"insect"--
critterGroup:SetSeasons("summer")
critterGroup.MaxAltitude = 1000
critterGroup.MinAltitude = 0.2
critterGroup.PlacementScore = 2
critterGroup:SetSoilAffs("1,1  1,1  1,1  1,1  1")
--AddItem(critterGroup)

critterGroup = dbCritterGroup("drumcrab_swarm")
critterGroup.CritterClass = "Proteus.World.DrumCrab"
critterGroup.CritterSubInfo = "sand"
critterGroup:SetCount(10,20)
critterGroup.DrawDistance = 10
critterGroup.SoundCueName = "crab loop"
critterGroup:SetSeasons("summer;autumn")
critterGroup.MaxAltitude = 0.5
critterGroup.MinAltitude = 0
critterGroup.PlacementScore = 2
critterGroup.ColorName = "creature_crab"
--critterGroup:SetHerbAffinities("") -- dandelion bluebell foxfire bracken mossLump
--critterGroup:SetTreeAffinities("") -- spruce scots_pine hawthorn oak
critterGroup:SetTerrains("beach") -- bare ocean beach grass highland snow
AddItem(critterGroup)

critterGroup = dbCritterGroup("owl")
critterGroup.CritterClass = "Proteus.World.Owl"
critterGroup.DrawDistance = 10
critterGroup.SoundCueName = "owl"
critterGroup:SetSeasons("spring;summer;autumn")
critterGroup.MaxAltitude = 1000
critterGroup.MinAltitude = 0.2
critterGroup:SetSoilAffs("1,1  1,1  1,1  1,1  1")
critterGroup.PlacementScore = 0.5
critterGroup.ColorName = "creature_owl"
critterGroup:SetTreeAffinities("scots_pine;hawthorn;oak;spruce") -- spruce scots_pine hawthorn oak
critterGroup.RequiresTree = true
critterGroup.AllowAiDirectorRedistibution = false
AddItem(critterGroup)

critterGroup = dbCritterGroup("bee_hive")
critterGroup.CritterClass = "Proteus.World.Bee"
--critterGroup.CritterSubInfo = "sand"
critterGroup:SetCount(18,24)
critterGroup.DrawDistance = 10
critterGroup:SetSeasons("summer")
critterGroup.MaxAltitude = 1000
critterGroup.MinAltitude = 0.0
critterGroup:SetSoilAffs("1,1  1,1  1,1  1,1  1")
critterGroup.PlacementScore = 1
critterGroup.RequiresNectar = true
critterGroup.RequiresTree = true
critterGroup.ColorName = "creature_bee"
--critterGroup:SetHerbAffinities("") -- dandelion bluebell foxfire bracken mossLump
critterGroup:SetTreeAffinities("scots_pine;hawthorn;oak;spruce") -- spruce scots_pine hawthorn oak
--critterGroup:SetTerrains("") -- bare ocean beach grass highland snow
critterGroup.AllowAiDirectorRedistibution = false
AddItem(critterGroup)

critterGroup = dbCritterGroup("mayfly_swarm")
critterGroup.CritterClass = "Proteus.World.Mayfly"
critterGroup.SoundCueName = "mayfly"
critterGroup:SetCount(5,20)
critterGroup.DrawDistance = 10
critterGroup:SetSeasons("spring;summer;autumn")
critterGroup.MaxAltitude = 3.25
critterGroup.MinAltitude = 0
critterGroup.PlacementScore = 1
critterGroup:SetSoilAffs("1,1  1,1  1,1  1,0  1")
critterGroup.ColorName = "creature_mayfly"
AddItem(critterGroup)

MakeFrogVariant("A", 1, "spring;summer")
MakeFrogVariant("B", 1, "spring;summer")
MakeFrogVariant("C", 0.5, "summer;autumn")
MakeFrogVariant("D", 1, "summer")
MakeFrogVariant("E", 1, "summer")

critterGroup = dbCritterGroup("lovebird_pair")
critterGroup.CritterClass = "Proteus.World.Lovebird"
--critterGroup.SoundCueName = ""
critterGroup:SetCount(2)
critterGroup.DrawDistance = 10
critterGroup:SetSeasons("summer;autumn")
critterGroup.MaxAltitude = 3.25
critterGroup.MinAltitude = 0.1
critterGroup.PlacementScore = 0.0
--critterGroup:SetHerbAffinities("reed;bogberries")
critterGroup:SetTreeAffinities("scots_pine;hawthorn;oak;spruce") -- spruce scots_pine hawthorn oak
critterGroup:SetSoilAffs("1,1  1,1  1,1  1,1  1")
critterGroup.RequiresTree = true
critterGroup.ColorName = "creature_lovebird"
critterGroup.AllowAiDirectorRedistibution = false
AddItem(critterGroup)

critterGroup = dbCritterGroup("bat_roost")
critterGroup.CritterClass = "Proteus.World.Bat"
--critterGroup.SoundCueName = ""
critterGroup:SetCount(5,9)
critterGroup.DrawDistance = 10
critterGroup:SetSeasons("summer")
critterGroup.MaxAltitude = 3.25
critterGroup.MinAltitude = 0.1
critterGroup.PlacementScore = 0.2
--critterGroup:SetHerbAffinities("reed;bogberries")
critterGroup:SetTreeAffinities("scots_pine;hawthorn;oak;spruce") -- spruce scots_pine hawthorn oak
critterGroup:SetSoilAffs("1,1  1,1  1,1  1,1  1")
critterGroup.RequiresTree = true
critterGroup.ColorName = "creature_bat"
critterGroup.AllowAiDirectorRedistibution = false
AddItem(critterGroup)

critterGroup = dbCritterGroup("guidething")
critterGroup.CritterSubInfo = 
				"guiderock;"
				--"testnumbers;"
				--"insect;"
				.. "songdog;32;" 
				.. "0,0.5,0,0,5;" 
				.. "1,0.5,0,1,5;" 
				.. "2,0.5,0,2,6;"
				.. "3,0.5,0,3,6;"
				.. "4,0.5,0,4,6;"
				.. "5,0.5,0,5,5;" 
				.. "6,0.5,0,6,5;"
				.. "7,0.5,0,7,5;"
				--.. "8,0.5,0,4,4; 9,0.7,4,4,4;"
critterGroup.CritterClass = "Proteus.World.GuideThing"
critterGroup.DrawDistance = 30
--critterGroup.MaxAltitude = 3.25
--critterGroup.MinAltitude = 0.1
critterGroup.PlacementScore = 0.0 -- not in world gen
critterGroup.MaxInstances = 1
-- critterGroup:SetHerbAffinities("reed;bogberries")
-- critterGroup:SetTreeAffinities("scots_pine;hawthorn;oak;spruce") -- spruce scots_pine hawthorn oak
-- critterGroup:SetSoilAffs("1,1  1,1  1,1  1,1  1")
critterGroup.ColorName = "built_Tower"
AddItem(critterGroup)

critterGroup = dbCritterGroup("watsonfox")
critterGroup.CritterClass = "Proteus.World.WatsonFox"
critterGroup.DrawDistance = 10
critterGroup:SetSeasons("autumn")
critterGroup.MaxAltitude = 1000
critterGroup.MinAltitude = 0.2
critterGroup:SetSoilAffs("1,1  1,1  1,1  1,1  1")
critterGroup.PlacementScore = 0.0 -- not in world gen
critterGroup:SetTreeAffinities("scots_pine;hawthorn;oak;spruce") -- spruce scots_pine hawthorn oak
critterGroup.RequiresTree = true
critterGroup.ColorName = "creature_foxspirit"
AddItem(critterGroup)

MakeSquirrelVariant("1", 0.5, 3, "creature_squirrel", false)
MakeSquirrelVariant("2", 0.35, 2, "creature_frogD", false)
MakeSquirrelVariant("3", 0.15, 1, "creature_quail", false)
MakeSquirrelVariant("4", 0.05, 1, "creature_frogE", true) -- appears in winter - ensure this is a low-instance one

MakeQuailVariant("1", 0.5, 3, "creature_quail")
MakeQuailVariant("2", 0.15, 1, "creature_quail2")

