Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Help Me Understand Creature RAWs  (Read 890 times)

Help Me Understand Creature RAWs
« on: October 30, 2015, 08:57:03 pm »

I understand tokens and such, I understand some of the basic layout and everything from the wiki; but when I look at some of the vanilla races like Humans and Dwarves, they have a lot more stuff going on in them.

I just want some help understanding the minimum I need to produce a creature that works in the game and is complete; IE it is not just a living thing, but a living thing with all the proper organs, tissues, extremities and abilities (if it has any) as I imagine it to have, as well as of the correct size. Size and tissue thickness are the most relevant to me as I do not seem able to tell what in the vanilla raws is being used to determine them for creatures.
Logged

Jay

  • Bay Watcher
  • ☼Not Dead Yet☼
    • View Profile
Re: Help Me Understand Creature RAWs
« Reply #1 on: October 30, 2015, 11:59:19 pm »

The important thing is to just, erm, read the tokens.
The Wiki explains them all, and the DWARF entry even has significant commenting.

Code: [Select]
These tags establish the growth phases of the creature's life.  The format is (BODY_SIZE|<year>|<day>|<average size>).

[BODY_SIZE:0:0:3000]
[BODY_SIZE:1:168:15000]
[BODY_SIZE:5:0:60000]

Tissue thickness is defined using the RELATIVE_THICKNESS tag of the template/material, and also by the body detail plan layers. Note that in both cases it's defined as a relative number, a ratio of each material in correlation to the sum total, and so increasing one will decrease the thickness of the other layers.
Logged
Mishimanriz: Histories of Pegasi and Dictionaries

Bearskie

  • Bay Watcher
  • Nyam nyam
    • View Profile
Re: Help Me Understand Creature RAWs
« Reply #2 on: October 31, 2015, 01:07:01 pm »

I assume you know how to define body parts, and are only having trouble regarding the tissue layering process.

So, tissues. Stuff like muscle, bone and skin. Different tissues behave in different manners, as you can see in the tissue_template_default file. Tags that determine scarring, pain intensity (bone is very high), bleeding (heart tissue is very high) and stuff. But what is important to realise is that material properties are NOT directly defined in tissues. They are defined earlier, and then when the tissue is created, you reference the material with [TISSUE_MATERIAL:______].

This means that bone (the tissue) is not necessarily be made out of bone (the material). You could define a skin tissue, and set it's material to adamantine. It will function identically to normal skin, but as expected it'll be alot harder to penetrate due to it's enhanced material properties. Remember, materials deal with things such as physics (shear, impact, tensile values) and temperature, tissues deal with the in-game behaviour of said tissue.



Let's define a material. Generally, you do this by referencing material templates found in, well, material_template_default. The line below goes into your creature.

Code: [Select]
[USE_MATERIAL_TEMPLATE:MYMATERIAL:CREATURE_CHEESE_TEMPLATE]
So, this line tells the game we're using CREATURE_CHEESE_TEMPLATE, which you can find somewhere in material_template_default. Essentially the physical properties of cheese. It 'imports' the material into the local creature raws you are editing, and nicknames it MYMATERIAL. You will have to declare and 'import' any material templates that you plan on using before they can be used in your local creature. Defined things tend to be local, meaning that if you move on to another creature, you'll have to redefine everything again for that new creature.

-

Now, time to define a tissue. This is the most basic way to define a tissue:

Code: [Select]
[TISSUE:MYTISSUE]
[TISSUE_NAME:cheese flesh:NP]
[SCARS]
[TISSUE_MATERIAL:LOCAL_CREATURE_MAT:MYMATERIAL] <----
[RELATIVE_THICKNESS:1]
[HEALING_RATE:100]
[VASCULAR:1]
[PAIN_RECEPTORS:5]
[CONNECTS]
[TISSUE_SHAPE:LAYER]

There's alot of stuff, but just pay attention to the TISSUE_MATERIAL line. I declared the material of the tissue (named MYTISSUE) to be made of LOCAL_CREATURE_MAT:MYMATERIAL. MYMATERIAL is the cheese material we defined earlier. But since MYMATERIAL belongs only within this creature, it has to be preceded by LOCAL_CREATURE_MAT, otherwise known as local creature material.

-

You could also use this instead:

Code: [Select]
[TISSUE_MATERIAL:INORGANIC:ADAMANTINE]
Adamantine, and a host of other stuff such as iron, gabbro, microcline, belong in the inorganics file. If you look at any inorganic entry, you can see they're basing their properties off material templates as well. Anyway, the point is, these are NOT defined locally within a creature, these have been predefined in the inorganic files. Meaning you can reference any one of them, as long as you have the tag INORGANIC before the material's name.

-

Anyway, tada, tissue is defined. You can now layer the tissue on a chosen bodypart using:

Code: [Select]
[TISSUE_LAYER:BY_CATEGORY:HEAD:MYTISSUE]
I've chosen to layer his head with MYTISSUE, which is made out of MYMATERIAL, which uses a cheese template.



Sounds easy I hope. Unfortunately, a quick look at the raws, and you realise that barely anything uses the manual tissue definition method. There is a better alternative, and it's called tissue templates.

Code: [Select]
[USE_MATERIAL_TEMPLATE:BONE:CREATURE_CHEESE_TEMPLATE]
[USE_TISSUE_TEMPLATE:BONE:BONE_TEMPLATE]

As before, starting with material templates. I'm not using MYMATERIALS and MYTISSUES as names anymore; this time, I'm naming my material BONE, and it matters. Note that the material, despite me naming it BONE, is still made out of the cheese material template.

The tissue_template_default file contains many manual tissue definitions. This is the tissue template I'm referencing in the second line:

Code: [Select]
[TISSUE_TEMPLATE:BONE_TEMPLATE]
[TISSUE_NAME:bone:NP] Whether it has a plural depends on exact part
[STRUCTURAL]
[CONNECTIVE_TISSUE_ANCHOR]
[TISSUE_MATERIAL:LOCAL_CREATURE_MAT:BONE] <-----
[RELATIVE_THICKNESS:2]
[HEALING_RATE:1000]
[VASCULAR:3]
[PAIN_RECEPTORS:50]
[CONNECTS]
[TISSUE_SHAPE:LAYER]
[SETTABLE]
[SPLINTABLE]

You can see that our bone tissue is made of LOCAL_CREATURE_MAT:BONE. That's why I needed to name my material BONE; if I named it MYMATERIAL, it wouldn't be referenced by my tissue template, which specifically only looks for BONE. I've also named this bone tissue I defined using tissue templates to be BONE as well. It's slightly confusing, and you can name it MYTISSUE or whatever, but generic naming helps further on.

Then you can layer it as usual.

Code: [Select]
[TISSUE_LAYER:BY_CATEGORY:ALL:BONE]
This gives every body part some bone tissue. Which is kind of excessive once you think about it, since you end up with bone-layered lungs and brains (which have the material properties of cheese).



But modders are a lazy bunch. The average dwarf has something like 20+ tissues made of 20+ materials, ranging from heart tissue made of heart materials, to tooth tissues made of tooth materials (ivory, really). Imagine doing the above 20+ times. So here comes the last bit of shortcut tissue and materials layering...

Body detail plans are essentially a bunch of shortcuts to be used in creature raws for a whole gamut of situations. In b_detail_plan_default, you can find body plans that arrange facial positions, adjust relative sizes, layer tissues, and yes, define materials and tissues. Remember that: not everything in that file has the same function.

Code: [Select]
[BODY_DETAIL_PLAN:STANDARD_MATERIALS]
[BODY_DETAIL_PLAN:STANDARD_TISSUES]

You can see this in the dwarf raws. These two commands add a whole host of materials and tissues (check them in b_detail_plan_default). It's like the bone example just now, but done on a larger scale. It's the generic sort of stuff you normally find in DF creatures (fat, bones, skin), but nothing so exotic such as cheese bones. Here, bones are made of bones, skin is made of skin.

Lastly, body detail plans can also be used to layer those 20+ materials onto the creature. Instead of [TISSUE_LAYER:____], we use:

Code: [Select]
[BODY_DETAIL_PLAN:VERTEBRATE_TISSUE_LAYERS:SKIN:FAT:MUSCLE:BONE]
which in the b_detail_plan_default is:

Code: [Select]
[BODY_DETAIL_PLAN:VERTEBRATE_TISSUE_LAYERS]
This body detail plan accepts argument tokens that can fill the role of the tissue token.  For instance, the dwarf sends in SKIN, FAT, MUSCLE, BONE and CARTILAGE.
[BP_LAYERS:BY_CATEGORY:BODY:ARG3:50:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:BODY_UPPER:ARG3:50:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:BODY_LOWER:ARG3:50:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:GROWTH:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:ARM:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:ARM_UPPER:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:ARM_LOWER:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:HAND:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:LEG:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:LEG_UPPER:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:LEG_LOWER:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:LEG_FRONT:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:LEG_REAR:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:FOOT:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:FOOT_FRONT:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:FOOT_REAR:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:HEAD:ARG3:50:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:NECK:ARG3:50:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:WING:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:TENTACLE:ARG3:50:ARG1:1]
[BP_LAYERS:BY_CATEGORY:CLAW:NAIL:100]
[BP_LAYERS:BY_CATEGORY:PINCER:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:TAIL:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:STINGER:ARG4:100]
[BP_LAYERS:BY_CATEGORY:SHELL:SHELL:100]
[BP_LAYERS:BY_CATEGORY:EYE:EYE:100]
[BP_LAYERS:BY_CATEGORY:TOOTH:TOOTH:100]
[BP_LAYERS:BY_CATEGORY:TUSK:IVORY:100]
[BP_LAYERS:BY_CATEGORY:NOSE:ARG5:4:ARG1:1]
[BP_LAYERS:BY_CATEGORY:PROBOSCIS:ARG5:4:ARG1:1]
[BP_LAYERS:BY_CATEGORY:ANTENNA:ARG5:4:ARG1:1]
[BP_LAYERS:BY_CATEGORY:MANDIBLE:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:EAR:ARG5:4:ARG1:1]
[BP_LAYERS:BY_CATEGORY:LUNG:LUNG:100]
[BP_LAYERS:BY_CATEGORY:MOUTH:ARG3:10:ARG1:1]
[BP_LAYERS:BY_CATEGORY:BEAK:ARG4:100]
[BP_LAYERS:BY_CATEGORY:RIB_TRUE:ARG4:100]
[BP_LAYERS:BY_CATEGORY:RIB_FALSE:ARG4:100]
[BP_LAYERS:BY_CATEGORY:RIB_FLOATING:ARG4:100]
[BP_LAYERS:BY_CATEGORY:HEART:HEART:100]
[BP_LAYERS:BY_CATEGORY:GUTS:GUT:100]
[BP_LAYERS:BY_CATEGORY:LIVER:LIVER:100]
[BP_LAYERS:BY_CATEGORY:STOMACH:STOMACH:100]
[BP_LAYERS:BY_CATEGORY:GIZZARD:GIZZARD:100]
[BP_LAYERS:BY_CATEGORY:PANCREAS:PANCREAS:100]
[BP_LAYERS:BY_CATEGORY:SPLEEN:SPLEEN:100]
[BP_LAYERS:BY_CATEGORY:KIDNEY:KIDNEY:100]
[BP_LAYERS:BY_CATEGORY:JOINT:ARG4:4:ARG3:1]
[BP_LAYERS:BY_CATEGORY:SPINE:NERVE:2:ARG4:2]
[BP_LAYERS:BY_CATEGORY:BRAIN:BRAIN:100]
[BP_LAYERS:BY_CATEGORY:HORN:ARG4:2:HORN:2]
[BP_LAYERS:BY_CATEGORY:FINGER:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:TOE:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:FIN:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:FLIPPER:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:HUMP:ARG2:50:ARG1:1]
[BP_LAYERS:BY_CATEGORY:LIP:ARG3:10:ARG2:5:ARG1:1]
[BP_LAYERS:BY_CATEGORY:TONGUE:ARG3:10:ARG1:1]
[BP_LAYERS:BY_CATEGORY:CHEEK:ARG1:100]
[BP_LAYERS:BY_CATEGORY:EYELID:ARG1:100]
[BP_LAYERS:BY_CATEGORY:THROAT:ARG1:100]
[BP_LAYERS:BY_CATEGORY:HOOF:HOOF:100]
[BP_LAYERS:BY_CATEGORY:HOOF_FRONT:HOOF:100]
[BP_LAYERS:BY_CATEGORY:HOOF_REAR:HOOF:100]
[BP_LAYERS:BY_CATEGORY:SKULL:ARG4:100]

Ugh god I hate body detail plans.

Anyway, BP_LAYERS work quite similar to TISSUE_LAYER, except if you noticed, you have ARGs and weird numbers next to them. Those numbers are the relative thickness of a tissue compared to other tissues, so the first entry, BY_CATEGORY:BODY, 50/56 will be tissue ARG3, 5/56 will be ARG2, and 1/56 will be ARG1. The ARGs are usually quite fixed, ARG3 tends to be MUSCLE tissue, ARG2 BONE tissue, ARG1 SKIN tissue. Detail plans are easy to use, but they don't really offer much room for customization unless you define a plan yourself. Don't worry if you don't have some of the bodyparts such as HOOF, or BEAK, or TUSK; they'll just be skipped over.

VERTEBRATE_TISSUE_LAYERS vs EXOSKELETON_TISSUE_LAYERS vs MOLLUSC_TISSUE_LAYERS. What's the difference? Well, they have different ARG requirements (latter two requires only 3 ARGs, which are usually CHITIN, FAT & MUSCLE). Also some very minor differences -- EXOSKELETON uses CHITIN for its shell bodypart as opposed to SHELL, for example. They're usually negligible at best.



I tried to be realllllly slow because I myself had alot of troubles figuring out the whole system when I first started. The problem was that there were so many methods of varying complexity to define those materials and tissues, which was very very confusing. Why did bronze colossi use manual definition, while dwarves used complex body detail plans?

So hopefully I was able to offer you a comprehensive understanding on tissue management in creatures. If this wasn't what you were expecting to learn, please be more specific as to what you wish to know, and I'll try my best to answer it using my dabbling modding skills :).
« Last Edit: November 14, 2015, 09:59:51 pm by Bearskie »
Logged

Lightningy

  • Bay Watcher
  • MOM GET THE CAMERA!!!
    • View Profile
Re: Help Me Understand Creature RAWs
« Reply #3 on: November 14, 2015, 04:24:24 pm »

Thanks for taking the time to write such a informative guide.  :'(
Logged
'What is life?', you ask. Fundamentally life is the apotheosis of pointlessness. We live to multiple. But what for? The Endless cycle of carnage pulls hardest on the furthest victim. An inescapable fate; one no one wants but we all desire. The more immoral we become the more ideal we are. A perverse oxymoron. We who live unencumbered but are the most burdened. We fight but at the end it is all for naught, as in life there are no winners; only the undistinguished.

GENERATION 29:
Copy and add 1.