Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Innate containers and glands  (Read 1271 times)

Strik3r

  • Bay Watcher
  • Persistently work-in-progress.
    • View Profile
Innate containers and glands
« on: December 26, 2018, 10:03:17 am »

This idea was partially born out of the Stomach capacity, metabolism, and digestion thread. Also inspired in part by Rain World.
In real life, creatures have a variety of organs which are used for storage, but this is something that is not repersented at all in DF.

A great example of this are kangaroos, which in DF lack their distinctive pouches.
Similarly, stomachs lack any function whatsoever in DF, in fact a creature can lose it in combat and they'll still be able to eat just fine.
In addition there are a number of other organs which either do nothing or are absent entirely.

So i wanted to suggest the addition of several new tags for bodyparts and the associated functionality inside the code to allow creatures to have innate containers:

[CONTAINER:X]: Makes the BP act as a innate container, 'X' is the maximum volume of the container as a percentage of the volume of the BP itself.
  • 'X' can be higher than 100, to simulate distension of the organ. Most organs will have above 100% max volume.
  • Anything stored in any of these innate containers adds the items' weight to the creature. Insignificant detail in most cases, critical in some.
  • If the BP is also [INTERNAL], then these containers are not accessible and can not have items put into them directly, it is also by default considered to be not ventilated, I.E. any living creatures ending up in there will likely suffocate.
  • If the BP is not [INTERNAL], then items can be put into them, and it is also considered to be [VENTILATED] and living beings can be put there safely. These bodyparts can have things put into them directly.
  • If the creature secretes something from a BP with [CONTAINER], it is put into the the BP's container on secretion. Useful for glands(Will cover this soon)

[STOMACH]: This tag marks the BP as a stomach, with everything it entails. can have multiple stomachs. Does not require nor imply [CONTAINER].
  • Is not needed for the creature to be able to eat, this tag makes just makes it possible for the consumption of food to be disabled.
  • IF a BP with [STOMACH] also has [CONTAINER], then eating anything will cause it to end up in here. If multiple BP's with [STOMACH] and [CONTAINER] are present, then it is possible to choose which stomach eaten things end up in.
  • Having both at least one BP with both [STOMACH] and [CONTAINER], then the creature uses slightly altered food mechanics:
    • Any eaten food will reside in the stomach for a while before it is destroyed
      • Inedible items will not be destroyed. Vomiting will bring these items back up
      • Living beings are considered edible.
         
    • How much food a creature can consume is determined by how much empty space there is in the stomach.
  • If the creature does not have any BP's with both [STOMACH] and [CONTAINER], then current food mechanics are used.
  • If all BP's with [STOMACH] are disabled, the creature can no longer eat food and will starve.

[VENTILATED]: Makes it possible to store living beings in [INTERNAL] [CONTAINER]s without them suffocating.

[PATHWAY:X:Y]: Grants a [CONTAINER] BP a pathway to another BP and the possiblity to move items between them.
  • X is either BY_TOKEN, BY_TYPE or BY_CATEGORY.
  • Y is either the name of a BP(BY_TOKEN), a type of BP(BY_TYPE) or a BP category(BY_CATEGORY)
  • [PATHWAY:BY_TYPE:MOUTH] and equivalents in particular make it possible to select it as a destination for swallowed items as if it was a stomach.

[GLAND]: Marks the BP as a gland, and makes the game track it as such.
  • If the creature has at least one [CONTAINER] [GLAND] then any interactions which use a material will attempt to draw a corresponding amount of the material from a gland storing that material through a [PATHWAY], provided there is enough.
  • If there isn't enough material or the gland is disabled, the interaction will be 'dry' and will not inject or launch the specified material.
  • The main use for this is more realistic handling of venomous creatures, as such creatures realistically do not have infinite amounts of venom.

Other mechanics changes:
Allow swallowing of anything(provided its small enough) in Adventure mode, including vermin and creatures.
   Eating of living creatures is done through a special attack, only possible if the attacker is much larger than their target, for example a dragon eating a dwarf.
   [INTELLIGENT] creatures willing to eat vermin (such as creatures with [HUNTS_VERMIN] and/or [GOBBLE_VERMIN_CLASS]) will always do so in Fortress mode.

Clarifications:
Creatures will typically not use their stomach as a container, so there is no worry about dwarves swallowing socks constantly, then starving because there aint enough room left in there for food.
Though kangaroo people anyone with an external [CONTAINER] will use it for storing random crap, unless its already occupied(would need additional programming to make creatures with safe [CONTAINER]s put their young there(and not eat them))
Yes, swallowing anything putting anything with an edge in any innate contaier will cut you.
Handling of happens when a creature or even the player is eaten alive is beyond the scope of this thread.
Logged
NOTICE: If you can't update your profile/signature, stop using a Imgur URL for your profile picture.
Upload it to somewhere else.

voliol

  • Bay Watcher
    • View Profile
    • Website
Re: Innate containers and glands
« Reply #1 on: December 27, 2018, 05:16:23 am »

+1 more specific suggestions like these token ones are always good to see, beyond the usual token-free ”should we have this feature or not” discussions. Having more to the creatures is also something I can’t get enough of.

I have some questions though. How does [GLAND] work if left on its own? Here it is only described when working in conjunction with [CONTAINER].

With multiple stomach containers, you write that the destination of the swallowed item can be ”chosen”. Is this something done by the player/creature AI, or something too decided in the raws?

I also assume internal [CONTAINER] organs are accessed through putting [PATHWAY] tunnel from an external organ (such as the mouth). Creatures having one of these should be aware of it, and putting things there as needed. Similarly, the organ needed for consuming food should be recognized as not simply the mouth (with the old [MOUTH] token), but any external organ with a [PATHWAY] to a [STOMACH] organ. This both makes it easier to have multiple mouths on a creature (marginally, they need one token less), but also makes it possible for creatures to have a ”mouth” being used as both a feeding organ when hungry, and the opening chute to an internal container, such as a hamster’s cheeks.

therahedwig

  • Bay Watcher
    • View Profile
    • wolthera.info
Re: Innate containers and glands
« Reply #2 on: December 27, 2018, 06:05:11 am »

Hm... maybe with gland.

1. Make it so that a certain amount of production allows milking the gland. This allows for creatures that have poison glands or whatever in their skin, which can contaminate and have a rest-pause, but doesn't necessarily mean they can be milked.
2. Glands can be milked by an entity if it has a full domestication tag for that creature. It would make sense for a civ that has domesticated snakes to be able to milk them without little fuss, but to have trouble with trying to milk a forgotten beast.
Logged
Stonesense Grim Dark 0.2 Alternate detailed and darker tiles for stonesense. Now with all ores!

Strik3r

  • Bay Watcher
  • Persistently work-in-progress.
    • View Profile
Re: Innate containers and glands
« Reply #3 on: December 27, 2018, 07:54:24 am »

I have some question though? How does [GLAND] work if left on its own? Here it is only described when working in conjunction with [CONTAINER].

Good question, a [GLAND] BP without [CONTAINER] either does nothing or  behaves as a infinite reservior for the purposes of interactions. Up to Toady.

With multiple stomach containers, you write that the destination of the swallowed item can be ”chosen”. Is this something done by the player/creature AI, or something too decided in the raws?

Chosen by the player/creature AI, the logic being that if a creature has multiple stomachs, it will most likely have the muscles needed to direct swallowed things to wherever they want, in some way.
AI will probably pick randomly, unless its swallowing a living creature and wants to keep it alive for whatever reason, then it'll pick randomly between [VENTILATED] [CONTAINER]s.

I also assume internal [CONTAINER] organs are accessed through putting [PATHWAY] tunnel from an external organ (such as the mouth). Creatures having one of these should be aware of it, and putting things there as needed. Similarly, the organ needed for consuming food should be recognized as not simply the mouth (with the old [MOUTH] token), but any external organ with a [PATHWAY] to a [STOMACH] organ. This both makes it easier to have multiple mouths on a creature (marginally, they need one token less), but also makes it possible for creatures to have a ”mouth” being used as both a feeding organ when hungry, and the opening chute to an internal container, such as a hamster’s cheeks.

Accessing an internal container through an external organ probably needs the external organ to have [APERTURE], [MOUTH] just makes it so that things have to be (e)aten to put things into the internal container, whereas in the case of an internal container connected to a BP without [MOUTH], things can be (p)ut into them and retrieved at will. To retrieve anything from a stomach via mouth, the creature will have to throw it up.(might have to give creatures the ability to induce vomiting at will, somehow) A non-stomach container can always have stuff retrieved from it, even if it only has a connection to a mouth.
In the case of a pathway to a NON-[APERTURE] external BP, stuff can't be put into to the container via that BP, but the pathway is valid for the purposes of interactions drawing materials from a gland.
For BP's without [MOUTH], they can not be used to put things into a stomach but may be used to retrieve them. Stuff can be moved from a [CONTAINER] into a stomach via pathway however, meaning that hampster cheeks will work as intended.

Also another thing i forgot to clarify: the [STOMACH] to [MOUTH] connection is implied by [STOMACH], I.E. All stomachs will automatically connect to any mouths without having to connect them manually via [PATHWAY], although there is potential merit in making the connection manual, as it would allow multiple separate digestive systems within 1 creature or inticrately complex digestive systems.

I think i also made a small mistake in regards to internal vs external container handling: I did not account for external but not directly accessible spaces, such as insect abdomens.
Im not sure how to resolve this.
« Last Edit: December 27, 2018, 08:04:14 am by Strik3r »
Logged
NOTICE: If you can't update your profile/signature, stop using a Imgur URL for your profile picture.
Upload it to somewhere else.

KittyTac

  • Bay Watcher
  • Impending Catsplosion. [PREFSTRING:aloofness]
    • View Profile
Re: Innate containers and glands
« Reply #4 on: December 27, 2018, 08:43:40 am »

+1.
Logged
Don't trust this toaster that much, it could be a villain in disguise.
Mostly phone-posting, sorry for any typos or autocorrect hijinks.

FantasticDorf

  • Bay Watcher
    • View Profile
Re: Innate containers and glands
« Reply #5 on: December 28, 2018, 02:55:23 am »

A [SMALL] bp udder gland on female cow's/most bovine/mammals lower bodies and a [SMALL] breast bp on the upper body for most female humanoids could fit in with this.

I mean i don't want to get too distracted by this, but 'feeding' baby infants implicitly if in the hands of the mother if they have access to this external gland could be a useful asset. Besides being connected to usual milk production of which the milk of the creature could be set seperately and the actual process of extracting from a creature could look generally for glands.

  • No dwarf, human or elf milk in fortress unless devious modders do something  >:( ;)
I think there is a arguement for bodygloss exemption to have certain glands too small to see, while other named glands are able to be cut out and used as single purpose object or container (chopping up forgotten beast corpses to collect exotic poison or dust etc). A poison gland would need to be different than a milk udder or ooze/other secretive unless the actual parts were entirely seperate rather than the same class assigned different reagents.

  • Dragons could have a gland that lets them shoot fire connected to the interaction linked in, with a high capacity and relsized gland, a reanimated dragon couldn't shoot fire if you cut off its head where the interaction is expelled, or otherwise lost its upper body guts (possibly to rotting or attack) where the gland is stored.
« Last Edit: December 28, 2018, 02:57:46 am by FantasticDorf »
Logged

Azerty

  • Bay Watcher
    • View Profile
Re: Innate containers and glands
« Reply #6 on: December 28, 2018, 07:13:31 pm »

It might be good for marsupials.

Maybe plants might enjoy this, and we could have carnivorous plants and calabashes.
Logged
"Just tell me about the bits with the forest-defending part, the sociopath part is pretty normal dwarf behavior."

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Innate containers and glands
« Reply #7 on: December 29, 2018, 06:01:23 am »

Also another thing i forgot to clarify: the [STOMACH] to [MOUTH] connection is implied by [STOMACH], I.E. All stomachs will automatically connect to any mouths without having to connect them manually via [PATHWAY], although there is potential merit in making the connection manual, as it would allow multiple separate digestive systems within 1 creature or inticrately complex digestive systems.
Cows shouldn't have all 4 of their stomachs connected to the mouth.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

therahedwig

  • Bay Watcher
    • View Profile
    • wolthera.info
Re: Innate containers and glands
« Reply #8 on: December 29, 2018, 09:58:29 am »

Yeah, wikipedia even goes as far to say that it's one stomach with 4 compartments :) So unless we can think of a creature that has multiple non-connected stomachs, the default is proly better to be connect all the digestive elements in order of appearance, and if there's a creature which does have seperated digestive tracts use the tags? (Unless I misunderstands how raws are parsed and order-of-appearance is super tricky).

Really, looking at wikipedia, the main thing this would do is give 4 stomachs in which:
- the first one contains undigested food and the gizzard stone if any (and this one is the one which contents are regurgitated)
- the second things like swallowed metal objects
- the last one secretes rennet if dealing with a calf
- all can be used for tripe.

I'm trying to think, but the only other unique digestion system I can think of is Rabbit/Hare two pass digestion, and I'm pretty sure that just requires two containers of which the last one contains grass pellets...
Logged
Stonesense Grim Dark 0.2 Alternate detailed and darker tiles for stonesense. Now with all ores!