game dev post: cooking and crafting in Weird West

More stuff I did on Weird West: the Cooking/Crafting system.

You can cook raw food over a fire or stove, use forges and tanning racks to craft weapon upgrades and armour, smelt ingots from nuggets or melt ingots back down into nuggets, etc. Arguably what I did for this ended up being a little overengineered versus the game's requirements.


Most cooking is simple - pickups have a CookedPickupClass, so, a Raw Chicken is easily cookable into a Roast Chicken in this UI. We also do this in-world - you can drop a raw chicken out of your inventory, set fire to it, and it'll become a roast chicken! But the system also supports Recipes.

For a long time, we had a janky placeholder system for cooking that I had hooked into the dialogue system - if you wanted to cook a chicken, you literally had to talk to the stove about it. When it was time to make a proper UI, it still wasn't clear how complex the system had to be yet. Is it always just RawItem->CookedItem? Are there different types of crafting stations? Do they overlap? Can you roast a chicken on a forge? Can one recipe have multiple ingredients? Can you only cook a pie using the cooking UI or can you get it by throwing all the ingredients in pot like Breath of the Wild?

All that being unknown, I decided it'd be best to just support all that stuff in a data-driven way, rather than doing the minimum viable thing and risk someone being sad they can't do a "get every ingredient to make an apple pie" quest. I gather this is a pretty Arkane way to operate (WolfEye was made out of a lot of ex-Arkane folks) - a ton of Weird West was "build a system out even though we're not sure how it fits into the design yet and see what happens". In the final game, you pretty much just cook raw food into cooked food, but the system I built fully supports multiple ingredients (with a specific number of each) and multiple results - a feature only used at ship to let you upgrade guns using worse guns and metal ingots, and also for one or two easter eggs.

So this example recipe will let you use a raw chicken, an apple, a bone, a bottle of beer and some cornbread to craft 3 cans of beans and a shotgun:

Crafting stations can support multiple Types, so while it's no longer enabled in the game, you can allow a forge to also cook meat. Anyway, the cool thing about this system is the cool thing about everything data-driven: if someone wants to add a recipe, they can do it in a simple UI or a spreadsheet without adding any code or talking to a coder, and bam, the recipe is in the game. It's nice when it works out that you can take a relatively vague prompt and put together a system that handles most of the possibilities designers might end up wanting, and isn't gonna mess you up later.

The beaut ingame UI for this was designed by Julien Mario, who you might recognise from his similar work on Deathloop, and implemented by me, which was great. UI implementation is a hell of a lot more enjoyable when you have a super pro designer handling that end of it.