Oblivion Mod:Cobl/Projects/Wrye Crafting
< Mod / Oblivion: Oblivion Mod: Cobl: Mods ! Modding ! ProjectsCobl: Old Project Page: This is an old and now inactive discussion article for a Cobl project. If you have questions about this or other Cobl projects, do not edit this page, but instead discuss it at the official forums on Relz topic. |
Because this is a fairly specific and complicated proposal and may be countered with other proposals, I'm tagging it with my name. If it's accepted it will become "Cobl Crafting". The first two sections are all written by me (please do respond in them). To respond or discuss, please use Discussion section and sign comments as usual.
Wrye: Intial ThoughtsEdit
I'm not really into crafting mods, so handling crafting in Cobl has not been at the top of my to do list. (Besides, having not played with such mods, I'm not familiar with the popular variations.) However, it's looming up on the do list for a couple of reasons (upcoming MMM work, integrating Coleen's Oblivion Farmers Market, etc.). So, here goes...
Prefer NeutralityEdit
Cobl has a policy of preferring to remain neutral when there are competing implementations of popular features. E.g. Cobl water sources should work fine with any Cobl-aware thirst mod. However, in defining commonality, sometimes some implementation decisions need to be standardized. E.g. the Dinner Plate for cooking provides a consistent, single way of consuming foods, which while being optional is strongly preferred to be used by eating mods.
For crafting mods, the need for a common interface will necessarily draw more interface choices into Cobl.
Cobl CommonalityEdit
Keeping in mind that Cobl's goal is establishing commonality, I see two main commonality considerations here:
- Ability To Extend: It's important for various mods to be able to extend what can be crafted. E.g. one mod might allow crafting of Amber armor, while another might allow crafting of Obsidian armor. It should be easy for Cobl aware mods to add additional crafting "recipes".
- Common Interface: The various crafting extensions provided by different mods should behave in a consistent way. E.g. if one cooking mod requires that a saucepan must be equipped in order to fry grits, then another mod that's going to fry rice should behave in the same way.
TriggersEdit
A fundamental question is how do you trigger a crafting action? I.e. if you want to fletch an arrow, then how do you start doing it? The main approaches are:
- Activate something in the outside world. I.e. to begin cooking the player activates an oven, which provides a menu. Or maybe you activate the oven while holding (somehow?) an item that needs to be cooked.
- Equip some item in inventory. E.g. equip a pen to write a scroll. Equip a saucepan to fry some food. (Of course, it's possible to allow both activating in the exterior world and equipping from inventory.)
- Knowledge based approach. Equip a recipe, and if your conditions are correct (i.e. if you have the correct equipment, and/or have the right condition, e.g. are near an oven), then you'll carry out the action.
A consideration here is how much immersion is desirable. Extreme immersionists want the solution to be as close to real life as possible. (Get butter in hand. Put butter in saucepan. Equip potato. Use potato on shredder to get shredded potatoes. Get that and put it in saucepan. Etc.) The problems with this are:
- It's quite difficult to do given the limitations of the game engine;
- It's object expensive -- you need a lot of objects with a lot of scriped behaviors;
- It's (IMO) ridiculously tedious;
- It's inconsistent with level of mechanics provided in default Oblivion (where e.g. to repair armor, you just equip a hammer and click through a menu several times; similarly for alchemy).
(Insert several hours of pacing around and thinking here.) Okay, I've got a plan (next section). I had originally been thinking of a pure knowledge approach, but I'm going to go with mixed activators/equippers instead. However, I'm (generally) not going to go with extreme immsersion.
Specific DesignEdit
Okay, here's my plan of how to do things. Keep in mind that I really haven't played with crafting mods at all (other than a looking at MMM crafting briefly and skimming over some crafting topics), so I don't know how much of this is done and not done.
OverviewEdit
Essentially you will make items either through recipes or through converters.
For converters, there's a container where that you place items in and later get different items out.
- Immediate converters convert materials immediately. Put items in, and then immediately (or almost immediately) get different items out. Current grinder works like this.
- Continuous processing converters (this is the way the grinder should work) will process items one at a time, taking x number of seconds per item. You can interrupt the process at any time and remove both the converted and non-converted items.
- Batch processing converters will take take an amount of time to process material. E.g. a tanning barrel. Put 10 hides in, come back in an hour and get ten tanned hides out. While hides are tanning, you won't be able to open the container.
For recipes, you activate or equip an item. This brings up a recipes menu which you then use to create stuff.
- The created items may go directly into player's inventory (if you made it continuously by hand), or may go into a container to be recovered later after enough time has passed (e.g an oven or cooking pot).
- Recipes are divided into separate menus: BakingMenu, GrillingMenu, FryingMenu, HotForgeMenu, FletchingMenu, LeatherWorkingMenu, WritingMenu, etc. Each of these is triggered by activating/equipping specific items.
- Recipe menus will work just like Cobl's Options menu. Mods can add new recipes into the recipe menu/container (most likely this would happen in the course of gameplay: reading a recipes book, being taught by someone, etc.)
Time Consumption: When making items directly by hand, each item made will use up a specific amount of time. E.g. 10 minutes for 10 arrows, or four hours for a complex piece of armor.
- When you exit the crafting menus, the consumed time will kick in in the form of the clock jumping ahead. E.g. spend 6 hours crafting and the gametime clock will jump ahead six hours.
- Player will have limited amount of time available to craft. Something like six to eight hours. After that time is used up, you won't be able to craft more. Or rather more accurately, the time left will be checked before you make the item. If the item takes two hours and you've only got one work hour left, then you won't be able to make the item.
- As you spend time away from crafting your "craft available time" will recover steadily up to the max (6 or 8 hours).
Skills: Crafting skills level can be maintained for each type of crafting (cooking, fletching, etc.) Crafting skill might be used to:
- Determine if you can make an item at all. And/or what your chance of success at making it is. Or determine how high quality it is.
- Determine how long it takes you to make the item. Higher skill level will allow you to create more items in a given amount of time.
Hopper ConvertersEdit
One by one converter: Suppose something like the grinder, but have it take a given amount of time per conversion. E.g., like so...
on activate set timer to 0 if timer > 0 set timer to timer - getSecondsPassed return endif if self.getitemCount Bone self.removeItem bone 1 set timer to timer + 1 elseif self.getItemCount BigBone self.removeItem bigBone 1 set timer to timer + 2 endif
Now suppose that the player leaves the cell (thus suspending the script). No problem. In this case, when the player re-enters the cell, check time-date and compare to previous time-date, then remove that amount of time from the timer. (set timer to timer - timeAway). The script will then run every frame until the extra time is used up.
Suppose that an external script wants to extend this, then the script needs to be on an unplayable token in the container. It does the same trick of waiting until timer <= 0 and doing its grinding one by one. This script can be placed on an unplayable token that is inserted into the container. (Note that since the script can't access the container's timer variable, it would use its own.)
Batch ConvertersEdit
A batch converter converts a limited number of items in a fixed amount of time. E.g. a tanning barrel might tan 10 hides in a day. In actuality, the conversion is done immediately, but the player is not allowed to access the contents of the container until the allotted time has elapsed.
Batch converters might not be necessary. Perhaps Batch recipes will be sufficient? (An advantage of batch recipes is that you would know exactly what you'll be getting out before the batch process starts. Also avoids the problem of putting detritus (unprocessable items) into the converter.)
Labor RecipesEdit
Labor recipes are recipes that require the direct action the player. There's no item involved, but item crafted consumes personal time. (See discussion in Overview above.)
Typical examples:
- Fletching arrows (triggered by fletching tool?)
- ForgedItems: (triggered by activating a forge)
- Leatherwork: triggered by equipping leatherworking equipment
Batch RecipesEdit
For an oven, you don't put items directly into the container, but instead are given a recipe menu which will put items into the container and which will be available after a given amount of time. Another consideration here is the limited storage capacity of the container.
Overview: The general process here (from the player's point of view) is:
- Activate container: Presents list of recipes. Choose recipes until satisfied, and/or container is full.
- Go away and wait for process to finish. If ty to activate container before process is done, you'll get a "busy" message.
- When process is done, activate container -- all items will be removed to player, and player will get option to view recipes and make more items.
Now a bit more detail (focussing on an oven)...
Activation: If activated and there's nothing in it then it brings up the BakingRecipes menu. If it's busy baking then you get a message saying "x minutes to go". If it's finished baking, then it does a remove all to player.
Baking activation: Assuming it was empty, then it sets a capacity variable on the baking menu to say 10. A loaf of bread would consume 2 slots, a roast pig would consume 8 slots. So you could simul-cook one roast pig and one loaf of bread or five loaves of bread. As you activate recipes from the book, they consume capacity. They also set a time variable. So when adding bread, they all bake for one hour, so time variable is set to 1 hour. The time variable will be the maximum of individual items baked.
As you go through your recipe book, you'll use up capacity. When capacity is empty, then recipes will say something like "not enough space." If there is enough space, then the recipe will execute and the completed item will be placed in the oven. (I.e. they're actually already there, but you won't see them until the cooking time has completed).
Ideally, while stuff is cooking, frying, etc. you'll get some nice visual and/or sound effects. Sound effects are easy, visual effects will require some skilled modelling work.
Something like a saucepan or pot would have a capacity of only one.
If player does not revisit oven, pot soon enough, items might be discarded as burned or moldy. Player would get a message that hopelessly ruined items have been discarded.
Pots on RangesEdit
Suppose that you have a cooking pot which has to be on top of a fire source to be usable (and that fire source has to be activated)... Hmm... I don't know how to do this. Something with trigger zones? Activation, spell casting? Dunno. Maybe the item gets a reference to the fire source and then checks to see if it hasFlames?
Recipe MenusEdit
Possible recipe menus and their triggers.
- BakingMenu (oven, roasting pot)
- GrillingMenu (grill)
- FryingMenu (frying pan)
- HotForgeMenu (forge)
- FletchingMenu (fetching tool?)
- LeatherWorkingMenu (leatherworking tool?)
- WritingMenu (quill)
- Different quills might vary in quality.
- Spellbook (virtual spell book)
- This would actually be not a real book, but the set of spells you know. So it would be a misc. quest item always in inventory. Entries in it could be used to add/remove spells.
- Could be used to turn individual spells in geomancy off/on.
- Could also support limited cast spells. E.g. maybe you're only able to cast a spell five times before you lose it again.
- Might integrate this with the spellbooks mod.
- Misc (virtual hand item)
- Equipper would be a quest misc. item with icon of a hand.
- Misc. recipes that require no specific tool. E.g. switching a mage's staff in your possession between several modes.
Acquiring RecipesEdit
Recipe tokens can be added to loot lists and placed in the world for the player to pick up. When the player acquires one (i.e. when it moves into the players inventory), then it can sense that move itself to the appropriate container menu with a message like "You have acquired the recipe for x. This would avoid the necessity of defining a scroll which teaches you the recipe. (Note: This is only possible, not required. Recipes would be acquired in other ways as well -- probably usually by reading a book or being trained by someone.)
DiscussionEdit
So that's the proposal. Any discussion/comments/criticism should go here. --Wrye 17:19, 19 February 2008 (EST)
- Time consumption: I can see the purpose of a limited workday, but this might be better left to other mods. In particular, the problem of working all through the night is naturally eliminated by Sleep mods. For those who don't want to worry about sleep and workdays (e.g. tireless undead PCs, or lazy players like me), letting them craft all day and night is a preferable default. Possibly, this could be made a variable that defaults to 24 and which Cobl-aware crafting mods could adjust as desired. A menu option for this would similarly mitigate people's desire to customise or eliminate that limit.
- Batch Recipes: Discarding things left too long in an oven is certainly a simple default. However, better would be to remove them and add a number of Ashes equal to the number of capacity slots that were occupied. This is a feature of Craftybits OBSE that can be used to naturally acquire as much ash as desired. (Why would anyone do that? Dunno, but it's immersive without added complexity or tedium. Maybe a gardening mod will come along that uses ash as an amendment.)
- The capacity mechanism is great. EggDropSoap 18:24, 19 February 2008 (EST)
-
- If the time consumption is built in from the beginning, then it's easy enough to disable it in a central way, e.g. through an options setting. Keep in mind that no time passes while you're in any sort of menu, hence sleep mods don't handle this sort of thing. (Unless they count time spent in menus.) Even if you count raw seconds used in menus, that's not very accurate -- picking a spell takes about as long as hitting the "Do" button on a crafting script, but obviously the latter should consume more time. But short answer is that there will be an option to dsiable.
-
- Ashes. Hmm... Sounds reasonable. I was figuring the oven automatically turns off. (I don't want to be so cruel as to make the user be there at just the right time -- I've got enough of that in RL. But ashes or no ashes can be configurable. --Wrye 21:16, 19 February 2008 (EST)
- Ashes should became ingredients and there should be a few types of it (baking ash, wooden ash, burned clay, fruit ash, etc) Majaczek 12:52, 8 May 2008 (EDT)
- Ashes. Hmm... Sounds reasonable. I was figuring the oven automatically turns off. (I don't want to be so cruel as to make the user be there at just the right time -- I've got enough of that in RL. But ashes or no ashes can be configurable. --Wrye 21:16, 19 February 2008 (EST)
- Pots on hot surfaces is pretty easy. The hot surface can be a collision box- either hand-placed, summoned by activating a fire or build into the mesh of an object (like a stove). Hitting the col box with a pot then triggers the cooking. One approach would be for cobl to provide a standard "hot spot" so that devices and homes with cooking areas would be compatible with any cobl aware cooking mod. -CLShade 19:05, 19 February 2008 (EST)
-
- Cool. I figured there was probably some way to do it. --Wrye 21:16, 19 February 2008 (EST)
I think about not only the recipe thing, but with some collision box activators, and real anim... and not instant wait for cooking-like... some animations as in 'craftybits OBSE' mod (their video examples are really great)
- so let divide crafting into four types:
- not needed to interaction, only wait (eg. baking,cooking) - it maybe left and go out or wait in room - it should proove an animation on object (ie. shakeing, skipping) and over time (ingame) it would transform - it should have stages ie. dough (acquired from flour and water) -> glutty bread -> bread -> burn bread -> baking ash (the breads are retextured bread)
- interaction needed with time consuming eg. changing ore to armour - it generally need an activator when activated then 1)really few times repeated then 2)the menu then looping animation until activate button is pressed then 3)flow gametime make exchange the item then 4) repeats step 2-3 until work done then 5) play animation that work was exhausting
- instant merging ie. water+flour -> dough - this should be done like in crafty bits - by grabbing one near one (sometimes place with activator needed, it may be prooved with special item eg. mixing plate (I'll like steel one), sometimes not needed anything)
- in-hand done actions - only simple menu and changes
-
-
-
-
-
- (last two is similair and can be exchanged)
-
-
-
-
Majaczek 12:51, 8 May 2008 (EDT)
I asked autor of CLS version of crafty bits (continuating of original abandoned) for help/permission of including his work on his project page Majaczek 14:32, 8 May 2008 (EDT)