Body Parts XML

Started by Chthonic One, July 29, 2016, 05:23:19 PM

Previous topic - Next topic

Chthonic One

At the top of the BodyParts_General.xml it has a blurb:
Quote<activities>
      <li>Manipulation_way1</li>
   </activities>
   
   means that this body part is responsible for Manipulation activity in group "way1".
   Efficiency of Pawn activity X is minimum of all X activity groups efficiency values.
   X activity group efficiency is average value of all body parts efficiency values responsible for this activity in this group.
   
   So if there are body parts responsible for (1)Manipulation_foo, (2)Manipulation_foo, (1)Manipulation_bar, (2)Manipulation_bar
   then Manipulation efficiency is min(avg((1)Manipulation_foo, (2)Manipulation_foo), avg((1)Manipulation_bar, (2)Manipulation_bar))

I take this to mean that moving efficiency would be:
min(avg((Moving_leftWay1, Moving_Way2), avg(Moving_rightWay1, Moving_Way2))

Since legs are Moving_leftWay1, and Moving_rightWay1, and have 30 hp, and feet are Moving_Way2 in both cases, and hp of 20, then each foot also has 50 hp of toes. I think that this means that if you lose one toe, the foot is at 50% efficiency at that point. Losing two makes it 0% efficiency.

Am I thinking about this correctly? Why do both feet have Moving_Way2 as their activity? Does this cause problems?

Also as an aside, if I choose to modify this file, do I have to include the whole XML file in the same directory structure in my mod folder, or can I just insert the body part I am modifying and cut out the rest? (Of course keeping the <BodyPartsDefs> tags)

Shinzy

I'm not really familiar with the bodypart stuffs but you can modify just the part you need, cutting out the rest
as long as the part's defname is the same as in vanilla it'll override it

Chthonic One

#2
Well after some testing, I found out that the movement efficiency is directly related to the number of body parts left with the activity "<li>Moving_tool</li>" Adding it to feet and legs improves the situation, but still there doesn't seem to be any XML way to properly weight how much each part is devoted to moving.

I may have to add more foot parts, making them more complicated.

Edit: I did do just that and it works, but not on old saves with people who are already injured. I also found out that I have to include the entire body file for humanoids, not just the legs, or my fix won't work. Here's what I did:

I created 44 fake body parts attached to each foot called "Phantom Foot" that cannot be targeted in combat, nor can they take damage from any source I could find. Therefore they will not show up at all. Each one of these, and the foot itself has the movement tag associated with movement efficiency on it, so they count 1 part for movement. Note: The phantom feet will be lost with the foot they are attached to.

I also created 4 fake body parts attached to the big toe, and 2 attached to each of the middle toes. They are called "Phantom Toes." Like the Phantom feet they should never show up in unless you load an old save with injured people, and the phantom toes are lost with the toe they are attached to. Each toe and phantom toe count for 1 part movement each.

The net effect is that the foot itself counts for 45 parts of your moment ability, the big toe counts for 5, the middle toes count for 3 each, and the pinky toe counts for 1. That is a total of 60 which is a nice dividable number to use. If you lose all of your toes, you lose 25% of your mobility in that leg, and it does not make sense to replace it with prosthetics or peg-legs unless your leg or foot is scarred or lost. If your foot is lost, you instantly lose all 60 points of mobility in that leg regardless of the state of your leg.

This is still not optimal however, as foot scars impact only one of it's 45 mobility parts, however foot scars are pretty rare, so that isn't noticeable. Leg scars are more common.

I am considering doing a similar overhaul of the hands. For now my work is up on the steam workshop under a mod called RimToes. I will be making a forum post in the development section later today about the future of the mod.