Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Help me figure out the weapons  (Read 814 times)

Marshall Burns

  • Bay Watcher
  • American Wizard
    • View Profile
    • Beyond the Wire Productions store
Help me figure out the weapons
« on: June 28, 2010, 02:15:32 pm »

Now let's take a look at the weapon code.

Spoiler (click to show/hide)

I can't figure out most of this.

SIZE: Must have something to do with how big the weapon is, but what is the effect? What are the units?

SKILL: Clearly the skill used to fight with this weapon.

TWO_HANDED: This must have something to do with whether this weapon is two-handed, but how does it work? I note that for crossbows its value is zero. Crossbows are two-handed, so at first I thought that if some property of the weapon is above this value, it must be wielded with two hands.

MINIMUM_SIZE: What are the units? What does it mean? Does any battle axe made have to have this size regardless of what it's made from? And if so, what's up with SIZE? Or maybe this is the minimum size a creature has to be to be capable of wielding it?

MATERIAL_SIZE: I just don't know. The only thing I can think of is that it's some manner of quotient  that indicates how much of this weapon's constituent material is present in the weapon, in order to determine its weight. If so, anyone got a guess what the math is?

Weight = mass divided by the acceleration of gravity, and mass = density multiplied by volume. We have access to all of the material densities, but there's no indication what the unit is or how volume is handled.

ATTACK: Luckily, this is mostly documented. The format is:
[ATTACK:EDGE or BLUNT:contact area:penetration size:verb used in the second person:verb used in the third person:noun substituted for the weapon's name:velocity modifier]

The difference between EDGE and BLUNT is documented: it determines whether penetration is a factor. That is, it determines whether this attack is compared against the yield, fracture, and elasticity against shearing or impact.

Contact area: I'm assuming that the higher this number, the larger the amount of tissue that is struck by the attack. I'm basing this on the fact that it's really high for the battle axe and really low for the spear. I'm assuming that, the larger the contact area, the larger the amount of tissue that can be damaged. This is surely a factor in whether limbs get cut off; it happens all the time with battle axes but never happens with bolts.

However, the way that tissues are damaged is handled by scores measured in kPa: kilopascals, a unit of pressure equal to 1000 Newtons of force over an area of one square meter. That's about 0.132 pounds per square inch. As a reference point, the typical pressure applied by the atmosphere on our bodies is 101.325 kPa, or 14.7 pounds per square inch. But that's not the point. The point is, assuming the same amount of force, a large contact area means a lower chance to fracture tissues than a small contact area. Therefore, weapons with a high contact area are inferior (they'd only inflict bruises) unless there's enough extra force behind them to make up for it. Question is, what determines the force of the blow?

If we tackle this from a mechanical physics level (an experimental approach supported by the fact that kPa are used in the game's math), then force = mass times acceleration, and mass = weight divided by the acceleration of gravity. Problem is, in order to calculate the amount of force at the time of impact, I gotta know the weight of the weapon, the distance that the weapon has to travel, and the amount of energy per unit of time that a given dwarf can exert. (Since there's no variable for weapon length, I can assume that the system doesn't take leverage into account. In order for it to do so, there'd also have to be a way to define, f'rinstance, how much an axe blade weighs in relationship to the rest of the axe. Not to mention a difference between thrusts and swings that wasn't merely cosmetic.)

If we can figure all that out, I can calculate how many kPa of pressure a given dwarf with a given weapon can apply to a tissue, which could be compared to the material fracture values to determine whether he'd be able to break that material (there's also clearly some random element at work in combat; there'd have to be some experimentation to determine whether the amount of pressure a blow applies is modified in either direction -- i.e. a ratio or additive modifier is applied to deviate from an average pressure -- or only downwards, as with a percentile ratio). Furthermore, it'd be nice to know what happens to a tissue that is merely bruised and not broken. Does bruising compromise the tissue's resistances? In what manner?

Not only would this information be useful for weapon and material modding, but it would also help to test the given fracture values to see if they're realistic -- and whether, even if they *are* realistic, if they are stylistically acceptable to Toady's or any modder's genre/gameplay sensibilities. In other words, I'm saying that Toady should enlighten us because it will help us test (and thus help him design) his game.

Penetration size: clearly, the higher this value, the greater the penetration of the attack, since piercing weapons have really high values for this. But how does it work? Since crossbow bolts have a higher penetration size than they do contact area, we can assume that it's not the portion of the contact area that gets penetrated. It must have something to do with penetration *depth*. Therefore, it must have something to do with how much strike energy is lost after breaking through one tissue, thus modifying the pressure applied to the next. Relative tissue thickness must also have something to do with this.

Moving past the verbs and noun, let's get to...

Velocity modifier: whoa. I'm really stuck now. This value either modifies the velocity of the blow (and by extension the pressure it applies on impact), or it modifies how long it takes the dwarf to perform this attack. Either way, it would appear that lower values are faster -- otherwise there's no advantage to pommel strikes, making them a useless thing to add to the game. I'm also guessing that 1000 is an average amount -- that it doesn't change anything in any way.

What makes me think that it might have something to do with how long it takes a creature to perform the attack is that the game seems to have an initiative system similar to that of ADOM. In ADOM, everything has a "Speed" score that averages at a hundred; every unit of time, that Speed value is added to a score called "Energy." When Energy reaches 1000, that creature gets to perform an action. I've noticed from adventurer mode that creatures in DF also have a speed score, although it seems to have an average of 1000. The manual says that every 10 frames, an "average, unburdened" dwarf will move one square. So it looks to me that this system is the same as the one in ADOM, except it's calculated out to one more digit.

(And, no, I don't think that reflects poorly on Toady. For one, I designed the same damn system myself almost ten years ago, except that the average speed was 15 and the total you had to reach to act was 30 -- it's common for people to design the same things without know about each other. For two, there's nothing wrong with stealing mechanics from other games. It's a normal and healthy part of game design. You can't copyright a rule, and for good reason.)

If that's true, then the velocity modifier might affect how often a creature gets to act. I dunno, though. It's gonna take some experimentation to figure out which of the above (if either) is true.

Now let's look at a ranged weapon.
Spoiler (click to show/hide)

We can ignore the stuff that's the same as contact weapons, but it bears mentioning that the ATTACK tag here isn't the one used for shooting; it's the one used for when you clobber things with your crossbow when you run out of ammo. The same goes for the SKILL tag. The edge/blunt, contact area, and penetration size of a ranged weapon are determined by the ammo you're using. (The AMMO definitions contain nothing that we haven't already seen, so there's no need to cover them.)

RANGED:CROSSBOW:BOLT identifies this as a ranged weapon, using the crossbow skill, and loaded with the BOLT subtype of AMMO.

SHOOT_FORCE must indicate how much force the weapon is fired with. Since it's not a contact weapon, force can't be calculated based on how much power the creature has; it has to be a property of the weapon. If you know the force behind the shot (given here) and the mass of the projectile (which can be calculated from its material density once we figure out how volume works), then you know how much it accelerates once that force is applied.

Now, in the real world, it will immediately begin decelerating once it leaves the bow, because the force has been removed; the only thing keeping it moving forward will be its own momentum, which will gradually give in to friction. Before it runs out of momentum, though, it's going to hit the ground. See, if you fire a bullet parallel to the ground and drop a bullet from the same height, they'll hit the ground at the same time. Going fast doesn't give you more hang-time. (I was going to say "arrow" instead of bullet, but I just remembered that the flights on arrows probably convert some of its thrust into lift, meaning that it *won't* fall as fast as a dropped arrow. It'll still fall before it runs out of momentum though.)

But, I've got no clue whether any of that is accounted for by DF's system. Until I know, there's no hope of calculating the actual effectiveness of a ranged weapon.

SHOOT_MAXVEL would seem to put a cap on how fast the projectile can travel. I wonder if this is necessary, though. If densities, volumes, and SHOOT_FORCE are set properly, nothing should be able to travel at an unrealistic speed. Also, to address Toady's comment in the file, it's not exactly relevant how *fast* the string moves. What matters is how much energy is being transferred from the bow to the string and from the string to the bolt. Which determines speed, sure, but speed *by itself* is irrelevant. The bolt and the string don't have to travel at the same speed, and probably won't (at least as soon as they lose contact) because of their different masses.

This post was basically a long way of saying that I don't know. But I wanted to show that I was trying. I'm pretty much lost in this stuff. The blend of absolute units (like kPa) with arbitrary units (like relative tissue thickness) with mystery units (like contact area) has me hopelessly confounded. Can anyone shed some light on the issue?

edited to correct a typo
« Last Edit: June 28, 2010, 05:05:01 pm by Marshall Burns »
Logged
By the way, I design table top RPGs and other games. You can buy some.

Star Weaver

  • Bay Watcher
    • View Profile
Re: Help me figure out the weapons
« Reply #1 on: June 28, 2010, 03:26:20 pm »

Well, I now know MORE about the physics stuff than I did before I read this post, but I can help a mite with the incidentals:

MINIMUM_SIZE is the minimum size a creature must be to use the weapon at all. Creatures between MINIMUM_SIZE and the badly-named TWO_HANDED have to use two hands to manage the weapon, and above the TWO_HANDED limit they can hold it in one hand.

MATERIAL_SIZE used to relate to how many metal bars were needed to create an item; something like "s < 4 = 1 bar; 4 < s < 9 = 2 bar; 9 < s = 3 bar". I'm not sure this is true anymore though, I think I read something indicating that it wasn't?
Logged

Marshall Burns

  • Bay Watcher
  • American Wizard
    • View Profile
    • Beyond the Wire Productions store
Re: Help me figure out the weapons
« Reply #2 on: June 28, 2010, 04:42:38 pm »

Oooh, thanks! That stuff about minimum size and two-handed is going to be really useful for my ideas.

On a side note, anyone know why my post above requires scrolling to the right? Anyone know how to fix that?
Logged
By the way, I design table top RPGs and other games. You can buy some.

afoninv

  • Bay Watcher
    • View Profile
Re: Help me figure out the weapons
« Reply #3 on: June 28, 2010, 04:58:10 pm »

Because it's code-tagged. Code will not be preformatted by forum engine, that's what this tag is here for - to retain strings, white space etc.
Logged
-
V.

Marshall Burns

  • Bay Watcher
  • American Wizard
    • View Profile
    • Beyond the Wire Productions store
Re: Help me figure out the weapons
« Reply #4 on: June 28, 2010, 05:04:11 pm »

Huh. That's annoying that it messes up the whole post, though. That must be why everyone uses spoilers to do that here.
Logged
By the way, I design table top RPGs and other games. You can buy some.

afoninv

  • Bay Watcher
    • View Profile
Re: Help me figure out the weapons
« Reply #5 on: June 28, 2010, 05:17:22 pm »

re your OP's questions: I've never been into materials modding (or any serious modding anyway), but there is a fair number of research threads on that. Here  what comes from the top of my mind:
http://www.bay12forums.com/smf/index.php?topic=53100.0

Information is plentiful; the point is, there are not so much people putting effort in bringing pieces of data together. But info - it is somewhere out there =)
Logged
-
V.

Marshall Burns

  • Bay Watcher
  • American Wizard
    • View Profile
    • Beyond the Wire Productions store
Re: Help me figure out the weapons
« Reply #6 on: June 28, 2010, 05:23:16 pm »

Man. Information about everything I want to know is scattered to all five corners of the earth. Guess I'll have to fix that, once I get all the data.
Logged
By the way, I design table top RPGs and other games. You can buy some.