Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Question about plants  (Read 1752 times)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Question about plants
« on: November 04, 2016, 10:00:44 pm »

Hey guys,

I'm currently working on graphics for plants, using TWBT.

My WIP sheet looks like this atm, for the first 50-ish plants:
Spoiler (click to show/hide)

But I'm somewhat unsure what is displayed in which circumstances ingame. Lets just take an artichoke:
Code: [Select]
[PLANT:ARTICHOKE] cynara cardunculus
[NAME:artichoke][NAME_PLURAL:artichokes][ADJ:artichoke]
[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]
[DRY][BIOME:GRASSLAND_TEMPERATE]
[VALUE:2]
[USE_MATERIAL_TEMPLATE:DRINK:PLANT_ALCOHOL_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:frozen artichoke wine]
[STATE_NAME_ADJ:LIQUID:artichoke wine]
[STATE_NAME_ADJ:GAS:boiling artichoke wine]
[MATERIAL_VALUE:2]
[DISPLAY_COLOR:6:0:0]
[EDIBLE_RAW]
[EDIBLE_COOKED]
[PREFIX:NONE]
[DRINK:LOCAL_PLANT_MAT:DRINK]
[SPRING][SUMMER][AUTUMN][WINTER]
[USE_MATERIAL_TEMPLATE:HEART:FRUIT_TEMPLATE]
[EDIBLE_VERMIN]
[EDIBLE_RAW]
[EDIBLE_COOKED]
[STOCKPILE_PLANT_GROWTH]
[MATERIAL_REACTION_PRODUCT:DRINK_MAT:LOCAL_PLANT_MAT:DRINK]
[MATERIAL_REACTION_PRODUCT:SEED_MAT:LOCAL_PLANT_MAT:SEED]
[USE_MATERIAL_TEMPLATE:LEAF:LEAF_TEMPLATE]
[STATE_COLOR:ALL:GREEN]
[DISPLAY_COLOR:2:0:0]
[USE_MATERIAL_TEMPLATE:FLOWER:FLOWER_TEMPLATE]
[STATE_COLOR:ALL:PURPLE]
[DISPLAY_COLOR:5:0:0]
[USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
[MATERIAL_VALUE:1]
[EDIBLE_VERMIN]
[SEED:artichoke seed:artichoke seeds:0:0:1:LOCAL_PLANT_MAT:SEED]
[FREQUENCY:50]
[CLUSTERSIZE:5]
[PREFSTRING:yummy hearts]
[GROWTH:LEAVES]
[GROWTH_NAME:artichoke leaf:artichoke leaves]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:LEAF]
[GROWTH_DENSITY:1000]
[GROWTH_PRINT:43:43:2:0:0:ALL:1]
[GROWTH:HEART]
[GROWTH_NAME:artichoke heart:STP] bud not fruit
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:HEART]
[GROWTH_DENSITY:1000]
[GROWTH_TIMING:0:59999]
[GROWTH_PRINT:43:43:4:2:1:0:59999:3]
[GROWTH:FLOWERS]
[GROWTH_NAME:artichoke flower:STP]
[GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:FLOWER]
[GROWTH_DENSITY:1000]
[GROWTH_TIMING:60000:119999]
[GROWTH_PRINT:43:43:2:13:0:60000:119999:2]
[SHRUB_TILE:43][SHRUB_COLOR:2:0:0]
[DEAD_SHRUB_TILE:43][DEAD_SHRUB_COLOR:6:0:0]
[PICKED_TILE:43][PICKED_COLOR:2:0:0]

It has Shrub-Tile, dead Shrub-Tile, Picked-Tile, in theorie a dead Picked-Tile, and GROWTH Flowers, GROWTH Heart and GROWTH Leaves. Each of the 3 growths has 2 tile-numbers, for plant (shrub tile?) and item (picked tile?).

Some are easy enough:
Shrub: The plant growing in the wild.
Dead Shrub: Plant growing in the wild, wilted and dead.
Picked: Dwarf got the plant, stored in a stockpile.
Dead Picked: Dwarf got the plant, stored in a stockpile, wilted and dead.

But the growths... I dont know. When does it show artichoke leaf, artichoke flower and artichoke heart? Will it overwrite the shrub? So it gets a flower first, overwrites the shrub, then gets a heart, overwrites the flower... but it has leaves all the time. Is there a wild and a farmplot version of this?

In the end I want to follow the idea up top: One graphic for the plant in the wild, one graphic for the plant in a farmplot, one graphic for the harvested product in the stockpile. Maybe 1 extra tile for all leaves of all plants. Making all growths for all plants seems to be impossible, because it would be more than 256 different growths, and TWBT can override more than that.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

DragonDePlatino

  • Bay Watcher
  • [HABIT:COLLECT_WEALTH]
    • View Profile
Re: Question about plants
« Reply #1 on: November 05, 2016, 12:38:12 pm »

If I recall correctly, once a plant has a growth the first value in GROWTH_PRINT overrides the crop's tile. So for this red spinach, you'd display a different tile if it has leaves or flowers. That means there's usually 2-4 different crop tiles for each plant. Yikes!

Code: [Select]
[PLANT:RED_SPINACH]
[PICKED_TILE:25][PICKED_COLOR:12:0:0]
[DEAD_PICKED_TILE:25][DEAD_PICKED_COLOR:6:0:0]
[SHRUB_TILE:3][SHRUB_COLOR:12:4:0]
[DEAD_SHRUB_TILE:3][DEAD_SHRUB_COLOR:6:14:0]
[GROWTH:LEAVES]
[GROWTH_PRINT:0:6:12:0:0:ALL:1]
[GROWTH:FLOWERS]
[GROWTH_PRINT:0:5:15:0:0:60000:119999:2]
      
But here, notice how the overworld tile of GROWTH_PRINT is always 0. If you do that, then DF will always display the PICKED_TILE and DEAD_PICKED_TILE regardless of how many growths there are. The same goes for shrubs, I believe. And the picked-and-in-stockpile tile is always the same as PICKED_TILE? I'm not sure if you can change that one.

For dropped growths, I think you can overwrite those with item overrides. There aren't enough characters for each growth for each plant, but you can sidestep that by doing just leaves or generic "categories" of growths like this:

Code: [Select]
[OVERRIDE:5:I:PLANT_GROWTH:PLANT_GROWTH:0:2:101::1] Flowers
[OVERRIDE:5:I:PLANT_GROWTH:PLANT_GROWTH:1:2:101::1] Flowers
[OVERRIDE:5:I:PLANT_GROWTH:PLANT_GROWTH:2:2:101::1] Flowers
[OVERRIDE:5:I:PLANT_GROWTH:PLANT_GROWTH:3:2:101::1] Flowers
[OVERRIDE:6:I:PLANT_GROWTH:PLANT_GROWTH:0:2:102::1] Leaves
[OVERRIDE:6:I:PLANT_GROWTH:PLANT_GROWTH:1:2:102::1] Leaves
[OVERRIDE:6:I:PLANT_GROWTH:PLANT_GROWTH:2:2:102::1] Leaves
[OVERRIDE:6:I:PLANT_GROWTH:PLANT_GROWTH:3:2:102::1]         Leaves
[OVERRIDE:7:I:PLANT_GROWTH:PLANT_GROWTH:0:2:103::1] Small Fruit
[OVERRIDE:7:I:PLANT_GROWTH:PLANT_GROWTH:1:2:103::1] Small Fruit
[OVERRIDE:7:I:PLANT_GROWTH:PLANT_GROWTH:2:2:103::1] Small Fruit
[OVERRIDE:7:I:PLANT_GROWTH:PLANT_GROWTH:3:2:103::1] Small Fruit
[OVERRIDE:37:I:PLANT_GROWTH:PLANT_GROWTH:0:2:104::1] Large Fruit
[OVERRIDE:37:I:PLANT_GROWTH:PLANT_GROWTH:1:2:104::1] Large Fruit
[OVERRIDE:37:I:PLANT_GROWTH:PLANT_GROWTH:2:2:104::1] Large Fruit
[OVERRIDE:37:I:PLANT_GROWTH:PLANT_GROWTH:3:2:104::1]        Large Fruit
[OVERRIDE:42:I:PLANT_GROWTH:PLANT_GROWTH:0:2:105::1] Spiny Fruit
[OVERRIDE:42:I:PLANT_GROWTH:PLANT_GROWTH:1:2:105::1] Spiny Fruit
[OVERRIDE:42:I:PLANT_GROWTH:PLANT_GROWTH:2:2:105::1] Spiny Fruit
[OVERRIDE:42:I:PLANT_GROWTH:PLANT_GROWTH:3:2:105::1] Spiny Fruit
[OVERRIDE:111:I:PLANT_GROWTH:PLANT_GROWTH:0:2:106::1] Melons
[OVERRIDE:111:I:PLANT_GROWTH:PLANT_GROWTH:1:2:106::1] Melons
[OVERRIDE:111:I:PLANT_GROWTH:PLANT_GROWTH:2:2:106::1] Melons
[OVERRIDE:111:I:PLANT_GROWTH:PLANT_GROWTH:3:2:106::1] Melons

Note: For growth items, make sure you overwrite subtypes 0, 1, 2 and 3 for each plant. The subtypes have the same order as the growths in the raws, so you want to catch every possible case. e.g. a plant could have flowers in the 1st, 2nd, 3rd or 4th "layer" and this will catch all of those cases.

For GemSet, I took the lazy route and used a single tile for every version of every plant. When plants were dead, they used the same tile but colorized yellow/brown. In the wild, they used one of 12 generic "shrub tiles" which were also colorized when dead. In total, I ended up taking half of an entire TWBT sheet for everything.

On a side note, are you still using BAMM? It makes things so much easier to maintain when you can write graphics-only raws like these and patch them into any modded or vanilla version of the game.
« Last Edit: November 05, 2016, 12:43:59 pm by DragonDePlatino »
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Question about plants
« Reply #2 on: November 05, 2016, 03:34:53 pm »

Thank you! I was wondering about the 0 at so many plants.

I havent even looked at dropped growths from trees... I was thinking of just making them look like normal grass, otherwise the tileset looks too busy on the surface.

I'm mostly trying to figure out if I can do this:
Strawberry plant => Looks like a plant.
Strawberry plant with strawberry growths on it => Looks like a plant with berries.
Strawberry plant, picked => Looks like strawberries.

I guess that works. SHRUB_TILE:strawberry plant, followed by GROWTH_PRINT:strawberry plant with berries:strawberries:, and PICKED_TILE also: strawberries.

Dont think I will do the flowers, buds, and all that. Too many tiles for TWBT to handle.

BTW: You can do overrides for corpses, so in theory you can make 256 custom corpse-tiles. Like making a dead, beaten elf with X for eyes and blood around him, instead of just a grey elf tile. Just use CREATURE_TILE:0 for one creature, CREATURE_TILE:1 for the next, and go from there.

Why do you do this btw?
Code: [Select]
[OVERRIDE:42:I:PLANT_GROWTH:PLANT_GROWTH:0:2:105::1] Spiny Fruit
[OVERRIDE:42:I:PLANT_GROWTH:PLANT_GROWTH:1:2:105::1] Spiny Fruit
[OVERRIDE:42:I:PLANT_GROWTH:PLANT_GROWTH:2:2:105::1] Spiny Fruit
[OVERRIDE:42:I:PLANT_GROWTH:PLANT_GROWTH:3:2:105::1] Spiny Fruit

The first number behind PLANT_GROWTH, I just leave that empty. What does it change in your set?
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

DragonDePlatino

  • Bay Watcher
  • [HABIT:COLLECT_WEALTH]
    • View Profile
Re: Question about plants
« Reply #3 on: November 05, 2016, 05:00:48 pm »

Strawberry plant => Looks like a plant.
Strawberry plant with strawberry growths on it => Looks like a plant with berries.

Doing either is easy, but doing both will be difficult. plant_crops, plant_garden and plant_standard have 34, 57 and 52 plants respectively, for a total of 143. Subtract the 31 trees in plant_standard, and you have 112 crop tiles. These tiles would be set with PICKED_TILE and use slots 0-111. Then you have the plant-with-berries tiles. To get those, I think you would change the GROWTH_PRINT of the berries to some unique tile not used by any crops. So assuming every plant has a minimum of 2 tiles, you'd use up slots 112-224 for the plants with growths. That'd leave you with 32 slots for modded plants.

On one hand, this is an overestimation because not all plants will have 2 tiles. On the other hand, it is an underestimation because you cannot use tiles 0, 32, 205, 247 or 255 for plants. Why? I don't know. I wrote myself a note in GemSet that I can't do that, and I'll trust my past judgement on that. :P

A good workaround for this problem is what I did in GemSet: Have the normal part of the plant be whatever color you want, then have the growth be a see-through background like barrels in most tilesets. The berries on your strawberry plant would be green, then turn red once they're read to be picked. I believe you would do this by setting the GROWTH_PRINT tile to 0 but changing the background color. To achieve the see-through part and keep the shading, you would convert the berries to grayscale then use an image editor to convert grayscale to transparency. In GIMP, I believe you can do this with layer masks. This would be a lot of work, but it would be well worth it as it would free up roughly 112 tile slots for modded plants. :)

Strawberry plant, picked => Looks like strawberries.

I'm not positive on this, but I think you can make an item override for that. In GemSet, every plant has the overrides:

Code: [Select]
[OVERRIDE:96:B:FARM_PLOT:FarmPlot::4:224]
[OVERRIDE:96:I:PLANT:PLANT::4:224]

With the first being the crop and second being the picked plant. Both have the same image in GemSet but I think you could easily separate them. Keep in mind, there are some quirks to which picked plants use growths and which use the entire plant. Button describes this here.

BTW: You can do overrides for corpses, so in theory you can make 256 custom corpse-tiles.

Hey, that's pretty awesome! I think I'll try that in future projects.

The first number behind PLANT_GROWTH, I just leave that empty. What does it change in your set?

Erm...in retrospect, it's probably unecessary for me to be adding the 0, 1, 2 and 3. I do that to catch every possible "layer" a growth could be in (like I described above). If I excluded that number like you, I think it would act as a wildcard and handle it for me.
« Last Edit: November 05, 2016, 07:06:21 pm by DragonDePlatino »
Logged