Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Bug bites  (Read 1221 times)

Absentia

  • Bay Watcher
  • On Break
    • View Profile
Bug bites
« on: May 13, 2010, 10:33:26 pm »

I had fun screwing around with modded creatures in 40d, but the new system has me perplexed. Specifically the fact that there doesn't seem to be any way to affect the power of a creature's attack. Even more specifically, the fact that my cat-sized beetles with LARGE_MANDIBLES can't even scratch a groundhog, let alone swarm over my enemies like a plague of scuttling death. Is there something else I need to add that will at least let the things break skin? Here's what I have, most of it copy-pasted from giant desert scorpion with reduced size, no poison, different body stuff, and the bite attack copied from a cat:

Spoiler (click to show/hide)

And while we're here: Why are my beetles always "gigantic" when I spawn them in arena?
Logged

derigo

  • Bay Watcher
    • View Profile
Re: Bug bites
« Reply #1 on: May 13, 2010, 10:55:13 pm »

First off, natural weaponry (like teeth) are currently configured to be as hard as skin.  This results in poor performance for bite claw attacks.   
See http://www.bay12forums.com/smf/index.php?topic=55798.0 , for the discussion/method to fix.  After that, the effectiveness of a creatures natural weaponry is mostly dependant on the size of the thing its biting (or clawing or whatever) with, and its strength.  Larger teeth hit a lot harder than small teeth, because natural weapon attacks are all blunt, and blunt damage is determined by hardness first, then weight.

You can go a step further and mod in custom super teeth(or whatever) that are much harder than normal teeth and apply them to specific creatures if you want.

Are they called 'gigantic blister beetles?' Or are they described as gigantic in the creature description?  I don't see anything off hand that would cause that in your raws, maybe you're just rolling high.

"Urist McConfused-About-Anatomy likes blister beetles, for their tails."
Logged

Absentia

  • Bay Watcher
  • On Break
    • View Profile
Re: Bug bites
« Reply #2 on: May 14, 2010, 02:36:54 am »

"Urist McConfused-About-Anatomy likes blister beetles, for their tails."

Didn't quite clean up all the scorpion bits.

So what are mandibles made of? Chitin? Is making chitin mandibles a decent weapon going to make it better than it should be for armor? I kinda wish there was just an attack multiplier or something I could use without getting waist-deep in shear and torsion and whatever else. I know Toady wants to model reality, but I don't want to have to take a class in material physics just to add in a lousy beetle.

I may have to go with plan B and just fill these things with poison gas blood.
Logged

derigo

  • Bay Watcher
    • View Profile
Re: Bug bites
« Reply #3 on: May 14, 2010, 05:05:30 am »

Quote
I kinda wish there was just an attack multiplier or something I could use without getting waist-deep in shear and torsion and whatever else. I know Toady wants to model reality, but I don't want to have to take a class in material physics just to add in a lousy beetle.

The idiot proof way to make animals hit harder is to make them BIGGER. ;p 

Honestly though its REALLY not that hard to adjust the materials.  People see this (spoiler for space)
Spoiler (click to show/hide)
and turn around and run screaming in the other direction.  A few moments close examination, though, and you see toady left notes. (spoiler for space)

Spoiler (click to show/hide)

Most of the values are not currently used at all for anything.  If all you're worried about is animal bites, then the ONLY values you care about are the 3 IMPACT_*** values.   


Quote
So what are mandibles made of? Chitin?
 

Ok, first lets look at LARGE_MANDIBLES in body_default.txt  All that's important to find out here, is what CATEGORY mandibles are in.  I'll explain why in a bit.

Quote
[BODY:LARGE_MANDIBLES]
   [BP:R_MAND:right mandible:STP][CONTYPE:HEAD][CATEGORY:MANDIBLE]
      [DEFAULT_RELSIZE:200]
   [BP:L_MAND:left mandible:STP][CONTYPE:HEAD][CATEGORY:MANDIBLE]
      [DEFAULT_RELSIZE:200]

Now, let's take a look at a scorpion.  creature_savage_tropical.txt

Quote

   [BODY:SPIDER:2EYES:HEART:GUTS:BRAIN:TAIL:TAIL_STINGER:UPPERBODY_PINCERS]
...
   [BODY_DETAIL_PLAN:EXOSKELETON_TISSUE_LAYERS:CHITIN:FAT:MUSCLE]


Ok, what's that mean?  The token itself tells you where to look: b_detail_plan_default.txt  Also note, that scorpions don't have mandibles, they have UPPERBODY_PINCERS. (spoilered for bolds and readability)

Spoiler (click to show/hide)
Lots of code in thar!  Most of it has nothing to do with what you're doing.  If you look at the the original entry in the scorpion definition, it called this token with 3 arguments.  As far as a scorpion is concerned, inside this definition ARG1 is CHITIN, ARG2 is FAT, and ARG3 is MUSCLE.  Toady uses this token as a shortcut.  By including all possible body parts in in this method, he can just call it with some creature specific arguments and define the materials of their entire body with 1 line.  If you had a custom body part, you could add it to these shortcuts to define it.  OR you could define it by hand in your creature definition like this. 

Quote
        [BP_LAYERS:BY_CATEGORY:CUSTOM_PART:MUSCLE:6:FAT:1:CHITIN:2]
You could even make your own shortcut tokens and call them if you want to.

Now find mandibles in there, because we know MANDIBLES_LARGE are in the CATEGORY MANDIBLE its easy to find them.   

Quote
        [BP_LAYERS:BY_CATEGORY:MANDIBLE:ARG3:6:ARG2:1:ARG1:2]

This means mandibles have a later 6 "thick" of MUSCLE under a layer 1 "thick" of FAT under a layer 2 "thick" of CHITIN.  Thickness describes how difficult it is to piece the layer into the next layer.  If you see other entries that seem to say the layers are 100 "thick", 100 is a magic number that means  'entirely composed of this material.'  So a mandible is good amount of chitin, over a little fat, over a huge chuck of muscle.  Sounds good. 

Now we know what a mandible is made of.  Unforunetly, CHITIN is currently bugged, and only as hard as skin. 

Let's look back at the scorpion definition again. 
Quote
...
      [USE_MATERIAL_TEMPLATE:CHITIN:CHITIN_TEMPLATE]
...
      [USE_TISSUE_TEMPLATE:CHITIN:CHITIN_TEMPLATE]
...

This is a little confusing hard to follow.  It turns out, tissues need both a MATERIAL definition as well as a TISSUE definition.  The tissue definition can be found in tissue_template_default.txt.  Tissue definitions concern things like how fast it heals, how much it bleeds, anything to do with how it functions inside an organism.  This isn't what we're looking for, so lets look at the material definition of CHITIN in material_template_default.txt, but only at the parts we're concerned with:

Quote
[MATERIAL_TEMPLATE:SKIN_TEMPLATE]
...
   [IMPACT_YIELD:10000]
   [IMPACT_FRACTURE:10000]

   [IMPACT_ELASTICITY:50000]
...

[MATERIAL_TEMPLATE:CHITIN_TEMPLATE]
...
   [IMPACT_YIELD:10000]
   [IMPACT_FRACTURE:10000]
   [IMPACT_ELASTICITY:100]
...

[MATERIAL_TEMPLATE:BONE_TEMPLATE]
...
   [IMPACT_YIELD:200000]
   [IMPACT_FRACTURE:200000]

   [IMPACT_ELASTICITY:100]
...

From play testing, I can tell you that the bolded values affect how much force the material will deal when you use it in a blunt attack(which makes sense!).  No one is entirely sure what elasticity does exactly, but more elasticity is more flexible, whatever that means.  Now compare the values.  Chitin is only as hard as skin, and that's not very hard.  No wonder you can't bite through anything!  Copy and replace the values from bone onto chitin and you make chitin as hard(and brittle) as bone.  This is a quick fix, I don't have realistic numbers for you, but this will work for now.  While you're at it, do the same for TOOTH, HORN, and HOOF, and NAIL.  Give those poor war dogs a fighting shot(not to mention the grizzly bears)!

Now let's look at your blister beetle.

Quote
...
      [ATTACK:BITE:BODYPART:BY_CATEGORY:MOUTH]
      [ATTACK_SKILL:BITE]
      [ATTACK_VERB:bite:bites]
      [ATTACK_CONTACT_PERC:100]
      [ATTACK_PRIORITY:MAIN]
      [ATTACK_FLAG_CANLATCH]
...

Turns out they're not even using their MANDIBLEs!  They're using their MOUTH.  I was a little uncertain about this, so i went and found another creature that bites with mandibles, a bugbat.  Here's it's attack, use this instead.

Code: [Select]
[ATTACK:BITE:CHILD_BODYPART_GROUP:BY_CATEGORY:HEAD:BY_CATEGORY:MANDIBLE]
[ATTACK_SKILL:BITE]
[ATTACK_VERB:bite:bites]
[ATTACK_CONTACT_PERC:100]
[ATTACK_PENETRATION_PERC:100]
[ATTACK_FLAG_EDGE]
[ATTACK_PRIORITY:MAIN]
[ATTACK_FLAG_CANLATCH]

And that's that.  You just had to change 4 lines of code, I could've just told you what to do, but I'm sure other people will get a kick out of this.
« Last Edit: May 14, 2010, 05:15:46 am by derigo »
Logged

Absentia

  • Bay Watcher
  • On Break
    • View Profile
Re: Bug bites
« Reply #4 on: May 14, 2010, 12:36:05 pm »

That... actually makes sense! And I do appreciate you taking the time to explain it instead of just telling me what to change. Many thanks.

EDIT: So I was curious about chitin and how hard it is relative to bone. Wikipedia is silent on that issue, but it does say that pure chitin is leathery (like caterpillar skin), and the much harder version in beetles and such is "modified" with calcium carbonate. So I guess what's in the raws is technically close to correct for pure chitin, and there needs to be another, harder chitin material used for claws/mandibles/shells. Being lazy, I'm just going to make regular chitin hard as you suggested.
« Last Edit: May 14, 2010, 01:07:27 pm by Absentia »
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Bug bites
« Reply #5 on: May 14, 2010, 01:05:19 pm »

You can apply specific materials to specific bodyparts. That's easy to make, check the ironman. He has iron applied to ALL, but you can replace ALL with needed categories (i.e. MANDIBLE).
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Absentia

  • Bay Watcher
  • On Break
    • View Profile
Re: Bug bites
« Reply #6 on: May 14, 2010, 01:15:25 pm »

Ooh, so I could copy bone as "hard chitin," then apply hard chitin to the mandibles. I think that would work nicely.
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Bug bites
« Reply #7 on: May 14, 2010, 01:26:02 pm »

Yeah, that's how I've made deathclaws in Wasteland mod to rip metal armor to shreds. I've made "hard nail" material (which is still called nail but is a bit different) and applied it to claws. Also I've made hard teeth and hard horns for other monsters as well.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

derigo

  • Bay Watcher
    • View Profile
Re: Bug bites
« Reply #8 on: May 14, 2010, 02:02:29 pm »

Yea you can also create custom materials on the fly within a creature definition.  The raws are VERY flexible when it comes to things like this.

Logged