Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Reactions (yet another boring raws suggestion)  (Read 2557 times)

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Reactions (yet another boring raws suggestion)
« on: November 14, 2008, 06:12:07 am »

Here are some specific ideas for making reactions more useful.  1 and 2 are not new ideas, but they make a good lead-in.

  • Include a skill token in the reaction entry to specify what kind of labor the job needs.  Currently only furnace operators will do a reaction job.  Skill tokens already exist, so hopefully this isn't too hard.  A few wildcard tokens like ANY_METALSMITHING might be needed.
  • Include a building type token so that reactions can be done at buildings other than smelters.  Building tokens don't seem to exist yet, but they should.  Wildcard tokens might be useful for buildings too (ANY_SMELTER).
  • Include an ID string in each reagent.  The ID should be unique within the reaction. 
  • Allow products to inherit material from a reagent by specifying its reagent ID, rather than specifying a particular material.  This lets you create "generic" reactions -- for example, a reaction that takes bones of any type, and turns them into weapons made of that same type of bone.  From what Toady said about the new material system, it could even preserve the identity of the person the bone came from.
  • Allow unconsumed reagents via a special tag like CATALYST or maybe NEUTRAL.
  • Allow declaration of one or more containers in which products can be placed.  The CONTAINER tag should specify its own ID and a container type (bin, barrel, bucket, bag) to be brought to the workshop with other reagents, but unlike true reagents, the container material does not matter.  Products place themselves in a container by specifying a container ID.  Attempts to place products in full or unsuitable containers should just result in a "spill."
  • Respect stacked reagents, i.e. treat a stack of 9 bones as 9 bones.  This probably depends on a lot of other stack fixes, so it's kind of a can of worms.

Note that this proposed system still is NOT flexible enough to handle jobs such as:
  • butchering -- needs creature size
  • item decorating and coinmaking
  • anything involving live animals -- creatures aren't items
  • cooking -- variable stack sizes
  • intelligent ore smelting, i.e. doesn't require a separate reaction for each ore -- game has to look up the resulting metal in matgloss_stone_mineral

But I think it can handle pretty much all other workshop jobs, including oddball stuff like brewing and tanning, and certainly simple stuff like furniture and weapons.  If people want, I can make some examples of what those reactions could look like.

Now it's your turn to tell me why I'm wrong!  Oh, and Impaler's idea for a variable FUEL tag is essential too.
« Last Edit: November 17, 2008, 09:34:35 am by Footkerchief »
Logged

Appelgren

  • Bay Watcher
    • View Profile
Re: Reactions (yet another boring raws suggestion)
« Reply #1 on: November 14, 2008, 10:37:02 am »

Very good ideas.
Logged

Granite26

  • Bay Watcher
    • View Profile
Re: Reactions (yet another boring raws suggestion)
« Reply #2 on: November 14, 2008, 11:26:33 am »

I'd like to see a Profession Raw file, a Reaction Raw file.

Profession:
Reaction_Class:A
Reaction_Class:B
Reaction_Class:C

Reaction
Input_Type:A
Input_Type:B
Output_Type:A
Output_Type:B
Reaction_Class:A
Building_Class:A

Building
Building_Class:A

Where Reaction_Class and Building_Class are any unique word, and Buildings, Reactions and Professions are completely defined in the raws.

Impaler[WrG]

  • Bay Watcher
  • Khazad Project Leader
    • View Profile
Re: Reactions (yet another boring raws suggestion)
« Reply #3 on: November 14, 2008, 11:31:56 am »

Excellent ideas all around, I'd personally add some new tags that reflect some of your new concepts rather then incorporating them in the current tags.

Quote
5# Allow certain reagents to pass through the reaction unconsumed.  Just needs a simple boolean flag in the reagent tag.

I'd do this with a [CATALYST] tag which appears in place of [REAGENT] and is like it in every other way, the Catalyst is needed to complete the reaction but is not altered or consumed as you stated, this avoids adding additional booleans to reagents which could possibly trip you up when editing the raws when you confuse it with the quantity value.  I see uses for this outside of just contains.

Quote
Allow products to get placed inside an unconsumed reagent or another product (by specifying its ID), as long as that item is actually a container.  This lets you handle jobs that place the product inside a bucket or bag -- the container is just another reagent.  It would also allow neat (bizarre, useless) things like a reaction that takes two pieces of wood and produces a wooden bin with a wooden toy inside.

I'd use a new tag for that as well [PRODUCT_CONTAINER:container type:ID for which product goes here], this would make it clear that the container is not a 'real' reagent and you would only have to specify the container once rather then something like [REAGENT: empty container] [PRODUCT: container full of actual product] which is more entries and more error prone.  The correct number of empty container are automatically brought to the workshop based on the maximum amount of product that could be created and the size of the containers.  In addition it would allow for 'smart' behavior like automatically using any container that reagents came in to count towards the needed product containers if their compatible.   

For example, converting Strawberry wine to Strawberry vinegar would have the wine as the reagent and the vinegar as the product and if I specify Barrel as the Product container then the AI will recognize that the barrel the wine comes in is usable for the vinegar and no extra barrel fetching is needed.  But say I wanted to bottle the vinegar I could put bottles as the container and this would require that an appropriate number of bottles be fetched and used for the product.  Allowing the game to determine how many of the specified product containers are necessary on the fly will avoid impossible to fulfill 'cramming' or loss of products or excessive containers being used if someone miscalculates the number of necessary containers.
Logged
Khazad the Isometric Fortress Engine
Extract forts from DF, load and save them to file and view them in full 3D

Khazad Home Thread
Khazad v0.0.5 Download

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Reactions (yet another boring raws suggestion)
« Reply #4 on: November 15, 2008, 11:46:26 pm »

Excellent ideas all around, I'd personally add some new tags that reflect some of your new concepts rather then incorporating them in the current tags.

I'd do this with a [CATALYST] tag which appears in place of [REAGENT] and is like it in every other way, the Catalyst is needed to complete the reaction but is not altered or consumed as you stated, this avoids adding additional booleans to reagents which could possibly trip you up when editing the raws when you confuse it with the quantity value.  I see uses for this outside of just contains.

Yeah, that approach does make a lot more sense -- more clarity and less clutter in the syntax.  Although I might use NEUTRAL instead of CATALYST, just in case people haven't taken chemistry.

I'd use a new tag for that as well [PRODUCT_CONTAINER:container type:ID for which product goes here], this would make it clear that the container is not a 'real' reagent and you would only have to specify the container once rather then something like [REAGENT: empty container] [PRODUCT: container full of actual product] which is more entries and more error prone.  The correct number of empty container are automatically brought to the workshop based on the maximum amount of product that could be created and the size of the containers.  In addition it would allow for 'smart' behavior like automatically using any container that reagents came in to count towards the needed product containers if their compatible.   

For example, converting Strawberry wine to Strawberry vinegar would have the wine as the reagent and the vinegar as the product and if I specify Barrel as the Product container then the AI will recognize that the barrel the wine comes in is usable for the vinegar and no extra barrel fetching is needed.  But say I wanted to bottle the vinegar I could put bottles as the container and this would require that an appropriate number of bottles be fetched and used for the product.  Allowing the game to determine how many of the specified product containers are necessary on the fly will avoid impossible to fulfill 'cramming' or loss of products or excessive containers being used if someone miscalculates the number of necessary containers.

Just to be clear -- in this approach, an additional PRODUCT_CONTAINER tag would be needed for each product that gets placed in a container?  Hmm, that could mean a lot of tags, and it wouldn't let you specify that two items should be placed in the same container (probably okay for fluids, but not for items in bins).  It also doesn't allow you to use one of the products as a container for another product, as in my craft-in-bin example.  You are right, though, that the containers don't need full REAGENT or CATALYST syntax -- the material doesn't matter, all you need is the container type.

Doing things "on the fly," while definitely the most flexible approach, might require changes to the entire job system -- I'm not sure the game currently allows the dependence of one job item on another (i.e. you may need one barrel or two depending on how many strawberries you're brewing) -- and I'm trying to stick to relatively easy-to-implement stuff. (lol)

Maybe you could just have a [CONTAINER:id_string_for_this_container:BIN] type thing, and then every product would specify either a container, another product to use as a container, or nothing.  This gives the benefits you mentioned of a) making containers distinct from real reagents and catalysts and b) leaving the container material open-ended, while also giving you more control over how products get placed in containers.
« Last Edit: November 16, 2008, 12:13:18 am by Footkerchief »
Logged

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Reactions (yet another boring raws suggestion)
« Reply #5 on: November 16, 2008, 05:09:14 pm »

On second thought, placing one product within another product is just kind of useless and introduces other complications, like how to handle things if the container product has only a partial chance of appearing.  Edited the OP with a revised section on containers incorporating a bunch of Impaler's ideas.
« Last Edit: November 16, 2008, 05:11:37 pm by Footkerchief »
Logged

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile
Re: Reactions (yet another boring raws suggestion)
« Reply #6 on: November 16, 2008, 05:33:57 pm »

Allow unconsumed reagents via a special tag like CATALYST or maybe NEUTRAL.

This can already be done. Just make a product that's identical to one of the reagents. Example:

Code: [Select]
[REAGENT:1:SKIN_TANNED:NO_SUBTYPE:LEATHER:DRAGON]
[REAGENT:2:BAR:NO_SUBTYPE:METAL:LEAD]
[PRODUCT:100:1:SKIN_TANNED:NO_SUBTYPE:LEATHER:DRAGON]
[PRODUCT:100:1:BAR:NO_SUBTYPE:METAL:GOLD]

It's a bit of a workaround, but it's nowhere near being so unwieldly as to require Toady to take the time to program in a new token.



Also:

Note that this proposed system still is NOT flexible enough to handle jobs such as:

intelligent ore smelting, i.e. doesn't require a separate reaction for each ore -- game has to look up the resulting metal in matgloss_stone_mineral

Unless I'm misunderstanding what you're trying to say here, the game already does this. There is no "smelt native gold into gold bar" reaction, because there's a stone token that handles ores.
« Last Edit: November 16, 2008, 05:38:29 pm by Untelligent »
Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Reactions (yet another boring raws suggestion)
« Reply #7 on: November 16, 2008, 05:58:44 pm »

This can already be done. Just make a product that's identical to one of the reagents. Example:

Code: [Select]
[REAGENT:1:SKIN_TANNED:NO_SUBTYPE:LEATHER:DRAGON]
[REAGENT:2:BAR:NO_SUBTYPE:METAL:LEAD]
[PRODUCT:100:1:SKIN_TANNED:NO_SUBTYPE:LEATHER:DRAGON]
[PRODUCT:100:1:BAR:NO_SUBTYPE:METAL:GOLD]

It's a bit of a workaround, but it's nowhere near being so unwieldly as to require Toady to take the time to program in a new token.

That is an acceptable workaround in some cases, but the problem is that it destroys any special information about the old dragon leather (such as who it came from) and replaces it with generic dragon leather.  It would work properly if it used material inheritance, though.

Unless I'm misunderstanding what you're trying to say here, the game already does this. There is no "smelt native gold into gold bar" reaction, because there's a stone token that handles ores.

Yes, the game already does this.  What I was talking about in that part was the capability of these reactions to handle existing workshop jobs, so that they can be moved into the raws rather than being hardcoded.
Logged

Impaler[WrG]

  • Bay Watcher
  • Khazad Project Leader
    • View Profile
Re: Reactions (yet another boring raws suggestion)
« Reply #8 on: November 17, 2008, 10:40:33 am »

Quote
Include a skill token in the reaction entry to specify what kind of labor the job needs.  Currently only furnace operators will do a reaction job.  Skill tokens already exist, so hopefully this isn't too hard.  A few wildcard tokens like ANY_METALSMITHING might be needed.

How about having this tag also list the minimum level of skill necessary to perform the reaction, I've always found it a bit disappointing that 'high' tech reactions like making Steel require nothing more then designating a peasant as a Furnace operator.  Having some limits that would require me to level-up my dwarfs before I could undertake certain task would be very interesting and make the level-up process more rewarding and make 'rare' items and materials truly rare.
Logged
Khazad the Isometric Fortress Engine
Extract forts from DF, load and save them to file and view them in full 3D

Khazad Home Thread
Khazad v0.0.5 Download

Granite26

  • Bay Watcher
    • View Profile
Re: Reactions (yet another boring raws suggestion)
« Reply #9 on: November 17, 2008, 03:30:33 pm »

Quote
Include a skill token in the reaction entry to specify what kind of labor the job needs.  Currently only furnace operators will do a reaction job.  Skill tokens already exist, so hopefully this isn't too hard.  A few wildcard tokens like ANY_METALSMITHING might be needed.

How about having this tag also list the minimum level of skill necessary to perform the reaction, I've always found it a bit disappointing that 'high' tech reactions like making Steel require nothing more then designating a peasant as a Furnace operator.  Having some limits that would require me to level-up my dwarfs before I could undertake certain task would be very interesting and make the level-up process more rewarding and make 'rare' items and materials truly rare.

especially for quality-less outputs

Warlord255

  • Bay Watcher
  • Master Building Designer
    • View Profile
Re: Reactions (yet another boring raws suggestion)
« Reply #10 on: November 17, 2008, 03:57:46 pm »

Opening up the tags and all workshops would allow such lovely horrors as making crafts out of chunks or using sacrifices to bless armor.

[REAGENT:LIVE_ANIMAL:NO_SUBTYPE]
Logged
DF Vanilla-Spice Revised: Better balance, more !!fun!!
http://www.bay12forums.com/smf/index.php?topic=173907.msg7968772#msg7968772

LeadfootSlim on Steam, LeadfootSlim#1851 on Discord. Hit me up!

Granite26

  • Bay Watcher
    • View Profile
Re: Reactions (yet another boring raws suggestion)
« Reply #11 on: November 17, 2008, 05:38:11 pm »

Opening up the tags and all workshops would allow such lovely horrors as making crafts out of chunks or using sacrifices to bless armor.

[REAGENT:LIVE_ANIMAL:NO_SUBTYPE]
awesome... especially if we have control over the modifiers (rings just for price, spikes increase damage, leather images only effect price, but contain an image, and 'blessed with the blood of a unicorn' gives it both a cost and an effectiveness increase.)

awesome