Core RPG handbook · Development build / version notes

Core RPG handbook

Cooking: turn a raw ingredient into food

Create a raw ingredient, choose its cooked and burnt results, and use it on a cooking fire.

On this page

Cooking is an item-on-object interaction. The player chooses Use on a raw ingredient, then clicks a CookingStation. Each attempt replaces one raw item with its cooked or burnt result. Successful cooking grants XP; burning does not.

Start with the supplied Raw Shrimp, Shrimp and Burnt Shrimp definitions so you can follow a complete recipe. If you’ve built the gathering campsite, you already have a source of raw fish and a temporary fire.

Find the three parts of the recipe#

Open Tools → Green Cloak Games → TileTick Core RPG → Item Database. Search for these assets under Demo/Scriptables/Loot/Items:

AssetPurpose
CookableItem_Raw_ShrimpThe ingredient and its recipe settings.
ConsumableItem_ShrimpThe edible result.
LootItem_Burnt_ShrimpThe failed-roll result.

Keep these definitions unchanged while learning. For your own recipe, duplicate them into your own content folder and give each copied item a different, stable Item Id. Point your new raw ingredient at your new results.

Create food the player can eat#

To make the cooked result from scratch, use the Project window’s Create → TileTick → Loot → Consumable Item Definition. Give it a Display Name, Icon and Item Id, then set its food behaviour. For a small example, use Heal Amount: 3, Consume On Use: enabled, Timing Type: Food, and Cooldown Ticks: 3.

Consume Even If No Effect decides whether eating at full health still uses the item. Set it to match the behaviour you want. A basic Item Definition can be a cooking output too, but it won’t heal the player.

Actual Unity Inspector: cooked Shrimp food and timing settings.
The cooked result has its own healing, consumption and cooldown settings. The recipe on the raw item points to this definition. Select the image to enlarge it.

Create the burnt result with Create → TileTick → Loot → Item Definition. It needs its own identity, name, icon and stacking choice. It doesn’t need food behaviour.

Put the recipe on the raw ingredient#

Create the ingredient with Create → TileTick → Loot → Cookable Item Definition, or use Item Database → Create Item → Cookable Item. Assign Cooked Result in the wizard, then inspect the created definition to finish the recipe.

Inspector fieldRaw Shrimp sampleWhat it means
Required Cooking Level1Minimum Cooking level to start.
Cooking Xp60XP for each cooked result; burns grant none.
Cooked ItemConsumableItem_ShrimpThe successful output.
Burnt ItemLootItem_Burnt_ShrimpThe failed-roll output.
Base Success Chance0.7575% at the required level.
Bonus Chance Per Level0.03Adds three percentage points per level above the requirement.
Real Raw Shrimp Inspector, annotated: 1 cooking level and XP, 2 cooked and burnt outputs, 3 success probability fields.
1: level and XP. 2: cooked and burnt outputs. 3: success chance. These are the supplied Raw Shrimp settings. Select the image to enlarge it.

There is no separate burn-chance field. Burning is the unsuccessful outcome of the cooking roll. The sample’s 75% base chance becomes 90% at Cooking level 6 and reaches the 100% cap at level 10.

A new Cookable Item starts with different defaults: 30 XP and a 0.5 base chance. Choose your own balance explicitly rather than expecting a new definition to match Raw Shrimp.

Set up a cooking target#

The simplest starting point is the supplied fire, or a copy of a station already working in your scene. Keep its collider and interaction components. A local station needs:

  • A collider the interaction ray can hit.
  • WorldObjectInteractable with a reachable Interaction Point.
  • CookingStation with Can Cook enabled, on the interactable or one of its parents.
Actual NetworkFire prefab: World Object Interactable, Cooking Station with Can Cook enabled, and Box Collider.
NetworkFire includes CookingStation with Can Cook enabled. Its ordinary Actions list can be empty: the raw item starts cooking through inventory Use. Select the image to enlarge it.

Start with Interaction Range Tiles: 1. A local player must already be in range; the network item command can request an approach and checks the target again on arrival. In multiplayer, use the supplied network fire or a correctly registered network world object so the server can identify the target.

Use the ingredient on the station. The World Object wizard’s Cooking Range option is a draft; its StoveActionHandler doesn’t run a cooking recipe. Adding a menu action named Cook won’t replace the item-on-station setup above.

Cook a few ingredients#

  1. Run your working demo; start a host for the multiplayer scene. Give the player several raw ingredients through a working shop, fishing spot or starter inventory.
  2. Choose Use on Raw Shrimp, then click the fire or station.
  3. Watch the inventory. The first result arrives after two simulation ticks; following attempts are three ticks apart.
  4. On success, one raw item becomes cooked food and adds the recipe’s Cooking XP. On a burn, one raw item becomes the burnt result and adds no XP.
  5. Move or cancel to stop cooking, or let it continue until the raw items run out. Try eating a cooked result to check the food definition separately.

Check item counts and XP as well as animation or messages. A level may not change after one success, even though XP was awarded.

Check your own recipe#

Use a copied test ingredient. Set Base Success Chance to 1 to check the cooked output and XP, then use 0 with Bonus Chance Per Level also 0 to exercise the burn path. Restore the intended values afterward. Also try a player below the required level and a cancellation partway through cooking.

The runtime Inspector examples below use a small test recipe worth 30 XP, rather than the supplied Raw Shrimp recipe’s 60.

Isolated development-code Play Mode: SimpleInventory holds three raw test ingredients before cooking.
Before cooking: three raw test ingredients in SimpleInventory. Select the image to enlarge it.
Isolated development-code Play Mode: actual cooking leaves two raw ingredients and one cooked ingredient.
After one successful attempt: two raw ingredients and one cooked result. Select the image to enlarge it.
Isolated development-code Play Mode: UnitSkills Cooking Total XP is 30 after successful test cooking.
The successful attempt adds the test recipe’s 30 Cooking XP. Select the image to enlarge it.
Isolated development-code Play Mode: one raw test ingredient is replaced with one burnt ingredient.
A failed-roll attempt produces the burnt item. Select the image to enlarge it.
Isolated development-code Play Mode: the burn branch grants no Cooking XP.
The burnt result adds no Cooking XP. Select the image to enlarge it.

If cooking won’t start#

SymptomCheck
Use rejects the ingredient or target.The ingredient must be CookableItemDefinition. Keep CookingStation on the interactable or a parent, and enable Can Cook.
The player cannot click the station.Check its collider, interaction ray layers and reachable Interaction Point.
The action starts, but ingredients don’t change.Assign both Cooked Item and Burnt Item, leave space for the result and check TickManager. A missing chosen output preserves the raw ingredient.
It works locally but fails in multiplayer.Check the registered target identity and the server player’s inventory slot, item and skill controller.
The XP looks wrong.Read Cooking Xp from the raw ingredient. Burns grant none, and new definitions use 30 by default rather than the sample’s 60.
A copied ingredient disappears after loading.Give it a unique stable Item Id and include its folder in the save registry.

To supply this recipe from the world, connect a Fishing Spot to the raw ingredient. To let players make their own station, follow Firemaking.