ID:154160   May 1 2002, 5:58 am I was messing around with my battle system. And newbies who fight each other fight a decent battle. But once somebody has a little bit more stat in some areas, (say 10) the results come out too big. proc/Attack(mob/M) var/damage = (usr.toughness/2)/ (M.protection/2) var/accuracy = usr.precision var/evasion = M.swiftness if(accuracy < evasion) if(accuracy < evasion/1.5) //do a million inefficient accuracy checks //add some alternate damage(plus rand(1,3) and minus rand(1,3) This gets pretty bad with somebody of a toughness stat of 30 and one with a protection stat of 5-15. ANybody have any similar problems or have any tips?
 <-> May 1 2002, 7:21 am Sariat wrote: var/damage = (usr.toughness/2)/ (M.protection/2) Unless you were to use round() to round off either /2 value to a whole number, the /2 in both stats will cancel out, so it works out just to usr.toughness/M.protection. Randomness would probably be helpful here, such as damage=rand(1,usr.toughness)/M.protection. However, that's only part of the solution. As you say, the numbers are too big based on stats. Damage in battle, however, usually has more to do with the type of weapon involved, the momentum of the blow, the defender's vulnerability to them, the skill of the strike (factoring in defensive maneuvers), and any armor blocking it. Weapon type is constant for the weapon, and won't change; a few of its factors in battle, like sharpness, could change, but otherwise it's set. The momentum of a blow has to do with the attacker's strength; a strike might be strong but go wild, whereas a carefully thought-out strike might be only a medium blow; only with luck and a good opening can an attacker acheive both a strong blow and a skilled one. (Projectiles are an obvious exception to this.) The defender's vulnerability is a stat of major importance--by which I mean their physical resistance to the weapon, not their ability to dodge; think of this like constitution. Armor will absorb most of the energy of a strike--unless penetrated. If the weapon type is one that can penetrate armor, its ability to do so will depend on the skill of the strike. I'm going to make up a few formulas here, which probably aren't good but may be tweakable. proc/sigma(x) return 2**x/(1+2**x) var/luck=rand(1,100)/100 var/strikestrength = attacker.strength*(2-(1-attacker.recklessness)*(1-luck))/2 var/strikeskill = sigma( (1-attacker.recklessness)*attacker.skill*attacker.swiftness - (1+defender.feint-defender*recklessness)*defender.skill*defen der.swiftness ) I didn't touch armor calculations, in which you'd have to determine the piece of armor hit, the type of armor and whether the weapon involved would hurt it (or whether the armor could absorb the blow), if the weapon would pierce the armor, and so on. The amount of damage without armor would be mostly dependent on the strength of the blow, but would be increased by a particularly skilled blow. The result would then be modified by the defender's constitution (again, physical vulnerability), and probably cut down considerably. Lummox JR
 <-> May 7 2002, 4:10 am In response to Lummox JR very... very nice Lummox... I will look at your equations when I get home tonight :) I've been looking to redue my combat system a little...
 <-> May 8 2002, 7:07 am In response to Lummox JR Lummox makes some excellent points about combat. Also remember that generally weapons and armor are somewhat specialized and reflect the results of a continuing arms race. For example, simple blades and simple hafted bludgeoning devices are very effective against an unarmored human. But against creatures with denser muscles, hide, etc. they are ineffective. Thus man learned to stitch hides and furs to create more protective garments, which often negated such instruments. So time went on and man found that copper blades and axe heads could cut through hide and fur. So man began beating the copper into scales and plates to provide better protection. Then came bronze. Then iron. Then steel. Even weapon design was influenced by what rmor it was designed to face (even though combatants were often limited by resources as to what they could actually employ). Facing an unarmored foe? A skilled rapier or dagger wielder can slay him with a flick of the wrist. But any protective covering of the vitals will negate this. Got a horseman in plate mail? Either use one of the variety of spiked polearms (often resembling can openers!) or just knock him to the ground. Heavy blunt tools also work well to bend the armor into unmovable pieces and may drive the metal back into the poor sod's body. Got chainmail? Arrows and bolts worked wonders (more thin than the openings between chains so they often slid through) as were blunt weapons that just crushed the body underneath. Kevlar vest? Teflon bullets slide right through. Point being? You should probably take into account the relative protection a victim has to his attacker's weaponry. That will work to encourage much more strategy in combat and will make sure no one is really ever "safe" from another player, if that pkayer has the right weapons. -James
 <-> May 8 2002, 7:27 am In response to Jmurph Gah.... I really don't feel like making all of that... I'm having trouble now JUST with super powers
 <-> May 8 2002, 8:28 am In response to Lummox JR Lummox JR wrote: var/luck=rand(1,100)/100 var/strikestrength = attacker.strength*(2-(1-attacker.recklessness)*(1-luck))/2 var/strikeskill = sigma( (1-attacker.recklessness)*attacker.skill*attacker.swiftness - (1+defender.feint-defender*recklessness)*defender.skill*defen der.swiftness ) That is sooo complex...
 <-> May 8 2002, 5:44 pm In response to Jmurph don't forget the fact about polearms, if they get too close to you and they're armored you're basically dead. Plus the fact alot of weapons take alot out of the wielder just to swing, and the fact that some weapons are hard to swing again right after they've been swung once is another story... Then there's bowmen, of course if this was the Lord of the Rings movie I guess you could just pull out an arrow and stab the guy in the head omg...
 <-> May 8 2002, 8:00 pm In response to Jon Snow Techincally, you can. You'd just need strong wood or you'd need to hold the arrow near the head. Pulling it out without breaking it is a different matter though.